Hello,
My input file is as follows :
mainframe > xx*
xxst1
xxst2
xxstdatasome
xxsomepoints
yyyy
zzzz
end of file
I want to search for string "mainframe >" which is a constant then sort all the subsequent records into output file as follows :
xxst1
xxst2
xxstdatasome
xxsomepoints
here string "xx" is two characters but it is variable e.g. if it is "te" then subsequent records are :
test1
test2
testdatasome
testsomepoints. Please tell me if this can be done and how.
I have code for searching the string "mainframe >" and sorting the subsequent records into output file. This is as follows :
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
------------------
-----------------
mainframe > xxxxxxxxxxxxx
ramesh
suresh
nnnn
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,11,CH,EQ,C'mainframe >'),
PUSH=(81:ID=1))
OUTFIL OMIT=(81,1,CH,EQ,C' ',OR,1,11,CH,EQ,C'mainframe >'),
BUILD=(1,80)
/*