I have fixed-width data and need to display a maximum of two (2) records when data in specific fields match. Otherwise, only a single record will be displayed. The field to match is contiguous. Below is the code used to sort this out in legacy PP7:
% &HoldName is a Global Variable that keeps track of the previous Name
if(ne(&HoldName,mid(&str,157,10)))
set(&HoldName,mid(&str,157,10))
if(ne(¤t.line,0))
doform()
clearpage()
endif()
endif()
set(¤t.line,¤t.line + 1)
store(¤t.line,&str)
if(ge(¤t.line,¤t.lpp))
doform()
clearpage()
endif()