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 |
Don't need to understand each line of code. This example, just to show you how COBOL looks when we code all the divisions.
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!