I have an input file that goes like the following :
01 heading of data
inline-data of heading 01
inline-data of heading 01
09 heading of data
inline-data of heading 09
inline-data of heading 09
inline-data of heading 09
inline-data of heading 09
05 heading of data
inline-data of heading 05
Expected output :
01 heading of data
inline-data of heading 01
inline-data of heading 01
05 heading of data
inline-data of heading 05
09 heading of data
inline-data of heading 09
inline-data of heading 09
inline-data of heading 09
inline-data of heading 09
- My break point in my program is the heading.
- I need to sort the whole block of data (heading with its inline-data) to manage the lower numbers first.
- The inline data can vary from 1 to an infinit number of lines
- There is nothing on inline-data lines that indicates that they belong to a heading or another.
(although I am almost certain that there isn't because I searched), I'd like to know if there a way to do this in either JCL or the program ?
Thank you in advance.
SORT in JCL : sorted the headings separately from data,
Breaking point by program (if numeric, and if not, but cannot store the inline data beucase I don't know how many lines can there be for any given heading) : it requires reading the input file multiple times (hundreds of thousands of lines).
Shecodes,
Look at the DFSORT smart trick "Sort groups of records" which can found be at
https://www.ibm.com/support/pages/smart-dfsort-tricks
In your case assuming that your input has LRECL=80 and RECFM=FB, you can use the following control cards
If your input is RECFM=V or VB then you can use the following control cards