0000-MAIN-PARA. PERFORM 1000-INITIALIZE-PARA THRU 1000-EXIT. PERFORM 2000-MAIN-PARA THRU 2000-EXIT UNTIL END-OF-FILE. PERFORM 3000-END-PARA THRU 3000-EXIT. STOP RUN. |
IDENTIFICATION DIVISION. ---> Identification division starts here PROGRAM-ID. HELLOWRD. ---> Identification division ends here ENVIRONMENT DIVISION. ---> Environment division starts here CONFIGURATION SECTION. SOURCE-COMPUTER. XXX-ZOS. OBJECT-COMPUTER. XXX-ZOS. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT FILEN ASSIGN TO INPUT. ORGANIZATION IS SEQUENTIAL. ACCESS IS SEQUENTIAL. ---> Environment division ends here DATA DIVISION. ---> Data division starts here FILE SECTION. FD FILEN 01 NAME PIC A(25). WORKING-STORAGE SECTION. 01 WS-STUDENT PIC A(30). 01 WS-ID PIC 9(5). LOCAL-STORAGE SECTION. 01 LS-CLASS PIC 9(3). LINKAGE SECTION. 01 LS-ID PIC 9(5). ---> Data division ends here PROCEDURE DIVISION. ---> Procedure division starts here DISPLAY 'Executing COBOL program using JCL'. STOP RUN. ---> Procedure division ends here |
Não precisa entender cada linha de código. Este exemplo, apenas para mostrar como o COBOL fica quando codificamos todas as divisões.