I am stuck on what may be a simple algorithm, that has yet to pop into my head. Essentially, I am parsing this report, by line, using a stem variable and looking for the line that contains the word 'AMOUNT.' My problem is, after I find that line, I need to return values from the NEXT line.
Here is a snippet of the report:
Here is the REXX code I am currently using to find the line containing 'AMOUNT':
"Alloc F(ddname) shr ds('SOME.REPORT')"
"Execio * Diskr ddname (Finis Stem rpt1."
"Free F(ddname)"
do i=1 to rpt1.0
if Subword(rpt1.i,2,1) = 'AMOUNT' THEN
say rpt1.i
end
"Execio * Diskr ddname (Finis Stem rpt1."
"Free F(ddname)"
do i=1 to rpt1.0
if Subword(rpt1.i,2,1) = 'AMOUNT' THEN
say rpt1.i
end
Any suggestions are much appreciated!