I need help on processing of SORTIN file in COB2 module. SORTIN and SORTOUT files are defined at linkage section. I can see in the code FIRST-RECORD,OTHER-RECORD and END-RECORD are defined.
I am not clear how each record is getting read? and how FIRST-RECORD,OTHER-RECORD and END-RECORD are set ?
The program gets control with each record from the SORTIN, and returns a Return Code that tells Sort to accept the record, delete it or modify it.
There are other options (insert a new record, end the sort...)
You should check you SYNCSORT/DFSORT documentation.
FIRST-RECORD, OTHER-RECORD and END-RECORD are set by the sort program and allow you to do extra processing, like opening (at FIRST) and closing (at LAST) a secondary file.
What I would do before running the program:
1. Search all JCL libraries for a job having "YourProgramName" in it.
2. Check the source code to see if there is any information about the input dataset (in working-storage and linkage, in copybooks and in comments for example).
It still did not work with E15, for first record , sort-flag is 0 , for second record sort-flag is 4 , from 3rd record onwards sort-flag value is 655360.