Saturday, September 5, 2009

FILE SECTION

FILE SECTION


The FILE SECTION is used to define the files that will be used in the program. There will be on file description (FD) for each file followed by a record description for each different record format associated with the file. For example:
































FD



FILE-NAME.



01



RECORD-NAME.





05



FIELD-NAME-1



PIC X(5).





05



FIELD-NAME-2



PIC 99V99.





05



FIELD-NAME-3



PIC X(20).



In the example, the file is named FILE-NAME-1. It is the same file name that was specified in the SELECT statement for the file. The 01 following the FD is called a record description entry. Multiple 01 entries can be included if there is more than one applicable record format for the file. See Data Items for further information on the record description and its subordinate items.