I need to sort the INFILE on IN-PA-CODE, IN-PROD-TYPE and IN-AGT-NAME in that order. However, I need to have a different value in the SORT-PROD-TYPE field which will be hard coded in the Input procedure. After sorting, and releasing the record, I need to write a report based on OUT-PROD-TYPE.
1. What would be the definition of the SORT-REC?
2. If the SORT field is a part of the data record, does it affect the output records?
3. Can anybody list the algorithm of how this can be done?
Joined: 06 Jun 2008 Posts: 8220 Location: Dubuque, Iowa, USA
I will be using Input Procedure & Output Procedure to do it.
I need to sort the INFILE
Either you are using INPUT PROCEDURE and OUTPUT PROCEDURE, or you are using a file sort -- you can't have it both ways unless you're doing two sorts.
Define your SORT RECORD with the fields you want to sort -- and the SORT RECORD does not have to match your input file layout, your output file layout, or anything else. Code up your INPUT PROCEDURE and OUTPUT PROCEDURE statements to do the processing you want. Compile, bind, and run.