CODING THE INPUT PROCEDURE - IBM Mainframe

Use SORT . . . USING if you don't need to process the records in an input file (or files) before they are released to the sort program. With SORT ... USING file-name, the compiler generates an input procedure to open the file, read the records, release the records to the sort program, and close the file. The input file must not be open when the SORT statement begins execution. If you want to process the records in the input file before they are released to the sort program, use the INPUT PROCEDURE option of the SORT statement. Each input procedure must be contained in either paragraphs or sections. For example, to release records from Working Storage (a table) to the new file:

CODING THE INPUT PROCEDURE

An input procedure contains code for processing records and releasing them to the sort operation. You might want to use an input procedure to:

  • Release data items to the new file 6 on Working-Storage
  • Release records that have already been read in elsewhere in the program
  • Read records from an input file, select or process them, and release them to the new file

To transfer records to the new file, all input procedures must contain at least one RELEASE or RELEASE FROM statement. To release A from X, for example, you can enter:

CODING THE INPUT PROCEDURE


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics