adspace


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

Answer Posted / Dhirendra Kuamr

COBOL provides a SORT statement for sorting records within a data set. The SORT statement is used with an input/output SECTION and an associated SORT-FILE.nnFile Definition:n```coboln 01 EMPLOYEE-RECORD.n 05 EMPLOYEE-ID PIC X(4).n 05 NAME PIC X(30).n WORKING-STORAGE SECTION.n 01 SORT-FILE.n 05 ID PIC X(4) VALUE ZEROS.n 05 SEQ PIC 9(4) VALUE ZEROS.n 05 NEXT PIC 9(4) VALUE ZEROS.n```nSort Statement:n```coboln SORT EMPLOYEE-RECORD BY ID INTO SORT-FILE OUTPUT RECORDING ONLY.n```nThis statement sorts the records in an EMPLOYEE-RECORD file by employee id and writes the sorted records to the SORT-FILE.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

i need a small 3d program using inline and outline.

2307


Are you comfortable in cobol or jcl?

1114