Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

5.2 Data Division--File Description Entries



In a COBOL program, the File Description (FD) Entry (or Sort File Description (SD) Entry for sort/merge files) represents the highest level of organization in the File Section. The order in which the optional clauses follow the FD or SD entry is not important.


    ___ Format 1--Sequential Files ____________________________________________________ 
   |                                                                                   |
   | >>__FD__file-name-1__ __________________ __ ________________ ___________________> |
   |                      |_ ____ __EXTERNAL_|  |_ ____ __GLOBAL_|                     |
   |                        |_IS_|                |_IS_|                               |
   |                                                                                   |
   | >__ ___________________________________________________________________ ________> |
   |    |_BLOCK__ __________ __ _______________ __integer-2__ _CHARACTERS_ _|          |
   |             |_CONTAINS_|  |_integer-1__TO_|             |_RECORDS____|            |
   |                                                                                   |
   | >__ ____________________________________________________________________ _______> |
   |    |_RECORD__ _ __________ __integer-3__ ____________ ________________ _|         |
   |              | |_CONTAINS_|             |_CHARACTERS_|                |           |
   |              |_ __________ __integer-4__TO__integer-5__ ____________ _|           |
   |              | |_CONTAINS_|                            |_CHARACTERS_| |           |
   |              |_| clause 1 |__ ________________________________ _______|           |
   |                              |_DEPENDING__ ____ __data-name-1_|                   |
   |                                           |_ON_|                                  |
   |                                                                                   |
   | >__ ________________________________________________________ ___________________> |
   |    |_LABEL__ _RECORD__ ____ ___ __ _STANDARD______________ _|                     |
   |             |         |_IS_|   |  |_OMITTED_______________|                       |
   |             |_RECORDS__ _____ _|  | <___________________  |                       |
   |                        |_ARE_|    |___ _______________ _|_|                       |
   |                                       |_ data-name-2 _|                           |
   |                                                                                   |
   | >__ ______________________________________________________ _____________________> |
   |    |           <________________________________________  |                       |
   |    |_VALUE OF____system-name-1__ ____ __ _data-name-3_ _|_|                       |
   |                                 |_IS_|  |_literal-1___|                           |
   |                                                                                   |
   | >__ _____________________________________________ ______________________________> |
   |    |                             <_____________  |                                |
   |    |_DATA__ _RECORD__ ____ ___ ____data-name-4_|_|                                |
   |            |         |_IS_|   |                                                   |
   |            |_RECORDS__ _____ _|                                                   |
   |                       |_ARE_|                                                     |
   |                                                                                   |
   | >__ __________________________________________________________ _________________> |
   |    |_LINAGE__ ____ __ _data-name-5_ __ _______ __| clause 2 |_|                   |
   |              |_IS_|  |_integer-8___|  |_LINES_|                                   |
   |                                                                                   |
   | >__ ___________________________________________ ________________________________> |
   |    |_ RECORDING __ ________ __ ______ __ mode _|                                  |
   |                   |_ MODE _|  |_ IS _|                                            |
   |                                                                                   |
   | >__ _________________________________ __.______________________________________>< |
   |    |_CODE-SET__ ____ __alphabet-name_|                                            |
   |                |_IS_|                                                             |
   |                                                                                   |
   | clause 1:                                                                         |
   | |__ ____ __VARYING__ ____ __ ______ __ _____________________ ___________________> |
   |    |_IS_|           |_IN_|  |_SIZE_|  |_ ______ __integer-6_|                     |
   |                                         |_FROM_|                                  |
   |                                                                                   |
   | >__ _______________ __ ____________ ____________________________________________| |
   |    |_TO__integer-7_|  |_CHARACTERS_|                                              |
   |                                                                                   |
   | clause 2:                                                                         |
   | |__ ____________________________________________ _______________________________> |
   |    |_ ______ __FOOTING__ ____ __ _data-name-6_ _|                                 |
   |      |_WITH_|           |_AT_|  |_integer-9___|                                   |
   |                                                                                   |
   | >__ _________________________________________ __________________________________> |
   |    |_ _______ __ ____ __TOP__ _data-name-7_ _|                                    |
   |      |_LINES_|  |_AT_|       |_integer-10__|                                      |
   |                                                                                   |
   | >__ ____________________________________________ _______________________________| |
   |    |_ _______ __ ____ __BOTTOM__ _data-name-8_ _|                                 |
   |      |_LINES_|  |_AT_|          |_integer-11__|                                   |
   |                                                                                   |
   |___________________________________________________________________________________|

    ___ Format 2--Relative/Indexed Files ______________________________________________ 
   |                                                                                   |
   | >>__FD__file-name-1__ __________________ __ ________________ ___________________> |
   |                      |_ ____ __EXTERNAL_|  |_ ____ __GLOBAL_|                     |
   |                        |_IS_|                |_IS_|                               |
   |                                                                                   |
   | >__ ___________________________________________________________________ ________> |
   |    |_BLOCK__ __________ __ _______________ __integer-2__ _CHARACTERS_ _|          |
   |             |_CONTAINS_|  |_integer-1__TO_|             |_RECORDS____|            |
   |                                                                                   |
   | >__ ____________________________________________________________________ _______> |
   |    |_RECORD__ _ __________ __integer-3__ ____________ ________________ _|         |
   |              | |_CONTAINS_|             |_CHARACTERS_|                |           |
   |              |_ __________ __integer-4__TO__integer-5__ ____________ _|           |
   |              | |_CONTAINS_|                            |_CHARACTERS_| |           |
   |              |_| clause 1 |__ ________________________________ _______|           |
   |                              |_DEPENDING__ ____ __data-name-1_|                   |
   |                                           |_ON_|                                  |
   |                                                                                   |
   | >__ ___________________________________________ ________________________________> |
   |    |_LABEL__ _RECORD__ ____ ___ __ _STANDARD_ _|                                  |
   |             |         |_IS_|   |  |_OMITTED__|                                    |
   |             |_RECORDS__ _____ _|                                                  |
   |                        |_ARE_|                                                    |
   |                                                                                   |
   | >__ ______________________________________________________ _____________________> |
   |    |           <________________________________________  |                       |
   |    |_VALUE OF____system-name-1__ ____ __ _data-name-3_ _|_|                       |
   |                                 |_IS_|  |_literal-1___|                           |
   |                                                                                   |
   | >__ _____________________________________________ __.__________________________>< |
   |    |                             <_____________  |                                |
   |    |_DATA__ _RECORD__ ____ ___ ____data-name-4_|_|                                |
   |            |         |_IS_|   |                                                   |
   |            |_RECORDS__ _____ _|                                                   |
   |                       |_ARE_|                                                     |
   |                                                                                   |
   | clause 1:                                                                         |
   | |__ ____ __VARYING__ ____ __ ______ __ _____________________ ___________________> |
   |    |_IS_|           |_IN_|  |_SIZE_|  |_ ______ __integer-6_|                     |
   |                                         |_FROM_|                                  |
   |                                                                                   |
   | >__ _______________ __ ____________ ____________________________________________| |
   |    |_TO__integer-7_|  |_CHARACTERS_|                                              |
   |                                                                                   |
   |___________________________________________________________________________________|

 X  ___ Format 3--Line Sequential Files (Workstation Only) ____________________________ 
 X |                                                                                   |
 X | >>__FD__file-name-1__ __________________ __ ________________ ___________________> |
 X |                      |_ ____ __EXTERNAL_|  |_ ____ __GLOBAL_|                     |
 X |                        |_IS_|                |_IS_|                               |
   |                                                                                   |
 X | >__ ____________________________________________________________________ __.___>< |
 X |    |_RECORD__ _ __________ __integer-3__ ____________ ________________ _|         |
 X |              | |_CONTAINS_|             |_CHARACTERS_|                |           |
 X |              |_ __________ __integer-4__TO__integer-5__ ____________ _|           |
 X |              | |_CONTAINS_|                            |_CHARACTERS_| |           |
 X |              |_| clause 1 |__ ________________________________ _______|           |
 X |                              |_DEPENDING__ ____ __data-name-1_|                   |
 X |                                           |_ON_|                                  |
   |                                                                                   |
 X | clause 1:                                                                         |
 X | |__ ____ __VARYING__ ____ __ ______ __ _____________________ ___________________> |
 X |    |_IS_|           |_IN_|  |_SIZE_|  |_ ______ __integer-6_|                     |
 X |                                         |_FROM_|                                  |
   |                                                                                   |
 X | >__ _______________ __ ____________ ____________________________________________| |
 X |    |_TO__integer-7_|  |_CHARACTERS_|                                              |
   |                                                                                   |
   |___________________________________________________________________________________|


    ___ Format 4--Sort/Merge Files ___________________________________________________________________ 
   |                                                                                                  |
   | >>__SD__file-name-1__ ____________________________________________________________________ ____> |
   |                      |_RECORD__ _ __________ __integer-3__ ____________ ________________ _|      |
   |                                | |_CONTAINS_|             |_CHARACTERS_|                |        |
   |                                |_ __________ __integer-4__TO__integer-5__ ____________ _|        |
   |                                | |_CONTAINS_|                            |_CHARACTERS_| |        |
   |                                |_| clause 1 |__ ________________________________ _______|        |
   |                                                |_DEPENDING__ ____ __data-name-1_|                |
   |                                                             |_ON_|                               |
   |                                                                                                  |
   | >__ _____________________________________________ _____________________________________________> |
   |    |                             <_____________  |                                               |
   |    |_DATA__ _RECORD__ ____ ___ ____data-name-4_|_|                                               |
   |            |         |_IS_|   |                                                                  |
   |            |_RECORDS__ _____ _|                                                                  |
   |                       |_ARE_|                                                                    |
   |                                                                                                  |
   | >__ _______________________________________________________________________________ ___________> |
   |    |_ BLOCK __ ____________ __ ___________________ __ integer-2 __ _ CHARACTERS _ _|             |
   |               |_ CONTAINS _|  |_ integer-1 __ TO _|               |_ RECORDS ____|               |
   |                                                                                                  |
   | >__ __________________________________________________________ ________________________________> |
   |    |_ LABEL __ _ RECORD __ ______ ___ __ _ STANDARD ________ _|                                  |
   |               |           |_ IS _|   |  |_ OMITTED _________|                                    |
   |               |_ RECORDS __ _______ _|  | <_______________  |                                    |
   |                            |_ ARE _|    |___ data-name-2 _|_|                                    |
   |                                                                                                  |
   | >__ ______________________________________________________________ ____________________________> |
   |    |             <______________________________________________  |                              |
   |    |_ VALUE OF ____ system-name-1 __ ______ __ _ data-name-3 _ _|_|                              |
   |                                     |_ IS _|  |_ literal-1 ___|                                  |
   |                                                                                                  |
   | >__ __________________________________________________________________ ________________________> |
   |    |_ LINAGE __ ______ __ _ data-name-5 _ __ _________ __| clause 2 |_|                          |
   |                |_ IS _|  |_ integer-8 ___|  |_ LINES _|                                          |
   |                                                                                                  |
   | >__ _______________________________________ __._______________________________________________>< |
   |    |_ CODE-SET __ ______ __ alphabet-name _|                                                     |
   |                  |_ IS _|                                                                        |
   |                                                                                                  |
   | clause 1:                                                                                        |
   | |__ ____ __VARYING__ ____ __ ______ __ _____________________ __ _______________ _______________> |
   |    |_IS_|           |_IN_|  |_SIZE_|  |_ ______ __integer-6_|  |_TO__integer-7_|                 |
   |                                         |_FROM_|                                                 |
   |                                                                                                  |
   | >__ ____________ ______________________________________________________________________________| |
   |    |_CHARACTERS_|                                                                                |
   |                                                                                                  |
   | clause 2:                                                                                        |
   | |__ ____________________________________________________ ______________________________________> |
   |    |_ ________ __ FOOTING __ ______ __ _ data-name-6 _ _|                                        |
   |      |_ WITH _|             |_ AT _|  |_ integer-9 ___|                                          |
   |                                                                                                  |
   | >__ _________________________________________________ _________________________________________> |
   |    |_ _________ __ ______ __ TOP __ _ data-name-7 _ _|                                           |
   |      |_ LINES _|  |_ AT _|         |_ integer-10 __|                                             |
   |                                                                                                  |
   | >__ ____________________________________________________ ______________________________________| |
   |    |_ _________ __ ______ __ BOTTOM __ _ data-name-8 _ _|                                        |
   |      |_ LINES _|  |_ AT _|            |_ integer-11 __|                                          |
   |                                                                                                  |
   |__________________________________________________________________________________________________|

Subtopics:



Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.