The FILE SECTION must contain a level-indicator for each input and output file. For all files except sort or merge files, the FILE SECTION must contain an FD entry. For each sort or merge file, the FILE SECTION must contain an SD entry.
Syntax:DATA DIVISION. FILE SECTION. FD FILENAME. RECORD CONTAINS N CHARACTERS. BLOCK CONTAINS N CHARACTERS/RECORDS. RECORDING MODE IS F/FB/V/VB/S/U. DATA RECORD IS FILE-REC. 01 FILE-REC PIC X(N). |
Let us take a employee file,
DATA DIVISION. FILE SECTION. 01 EMPLOYEE-DETAILS. 05 EMPLOYEE-ID PIC 9(05). 05 EMPLOYEE-NAME PIC X(20). 05 EMPLOYEE-GRADE PIC X(01). 05 EMPLOYEE-SALARY PIC 9(10). |
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!