Showing posts with label hello world. Show all posts
Showing posts with label hello world. Show all posts

Thursday, March 1, 2012

COBOL code to display Hello World, Compile and Run COBOL code using JCL


       IDENTIFICATION DIVISION.                            
       PROGRAM-ID.    WELCOME.                             
       AUTHOR.        KK.                                  
       DATE-WRITTEN.  11-11-1111.                           
       SECURITY.                                           
                      A SAMPLE PROGRAM ON HELLO WORLD.
       PROCEDURE DIVISION.                                 
       0000-MAIN SECTION.                                   
                DISPLAY "HELLO WORLD".                
                STOP RUN. STOP RUN.            



Create a loadlib where the compiled cobol file is placed i.e. executable.
Loadlib must be a pds and block record must be undefined ‘U” instead of ‘FB”


//* Compile the cobol code JCL


//usernm  JOB 'WIPRO TRG','KK',NOTIFY=&SYSUID,
// MSGCLASS=X,MSGLEVEL=(2,0)

//STEP1     EXEC  PROC=IGYWCL

//COBOL.SYSIN  DD DSN=usernm.JAN.COBOLPGM(welcome),DISP=SHR

//LKED.SYSLMOD DD DSN=usernm.JAN.COBOLPGM.LOADLIB(welcome),     

//   DISP=SHR                                                        

//* Run the welcome program using JCL

//usernm  JOB  'Training','KK',NOTIFY=&SYSUID             

//JOBLIB    DD  DSN=Wusernm.JAN.COBOLPGM.LOADLIB,DISP=SHR  

//STEP1     EXEC  PGM=WELCOME                                

//                                                           

//* Check the output inside the spool, i.e. using tso sdsf st