Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning.

0
Posted

How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning.

0

Syntax: SORT file-1 ON ASCENDING/DESCENDING KEY…. USING file-2 GIVING file-3. USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2 GIVING It can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2. file-1 is the sort (work) file and must be described using SD entry in FILE SECTION. file-2 is the input file for the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL. file-3 is the out file from the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL. file-1, file-2 & file-3 should not be opened explicitly. INPUT PROCEDURE is executed before the sort and records must be released to the sort work file from the input procedure. OUTPUT PROCEDURE is executed after all records have been sorted. Records from the sort work file must be returned one at a time to the output procedure. My program has an array defined to have 10 items. Due to a bug, I find that even if the program access the 11th

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123