Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
Answer / 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 |
Write a program that uses move corresponding.
Write the syntax of a two dimensional array?
What is the point of the REPLACING option of a copy statement?
When can the USING phrase be included in the call statement ?
Can you call an OS VS COBOL pgm from a VS COBOL II pgm ?
how the control comes back from subprogram to mainprogram
I have two sequential files, FILE-1 and FILE-2. FILE-1 contains 2 columns(A,B) and FILE-2 contains 3 columns (C,D,E).I want an output file, FILE-3 which has all five columns with duplicates eliminated from column A.
1)what is the maximum limit for occurs? Eg: 01 A PIC X(10) OCCURS N TIME. What is the max value for N?
Describe the cobol database components?
record length in spool?
which is better comp or comp-3 in terms of memory utilization?
What is inspect in cobol ?