codegurukool.com · Free coding tutorials & online compiler

Home › Mainframe Tutorial › COBOL batch program on z/OS

COBOL batch program on z/OS

Compile, link and run COBOL in one job.

Most business batch programs are written in COBOL. The cataloged procedure IGYWCLG compiles, links and runs a program. The source goes in COBOL.SYSIN and the output of DISPLAY goes to GO.SYSOUT.

Example code

//COBJOB JOB (ACCT),'COBOL',CLASS=A,MSGCLASS=X
//STEP1    EXEC IGYWCLG
//COBOL.SYSIN DD *
       IDENTIFICATION DIVISION.
       PROGRAM-ID. HELLO.
       PROCEDURE DIVISION.
           DISPLAY "HELLO FROM COBOL ON Z/OS".
           STOP RUN.
/*
//GO.SYSOUT DD SYSOUT=*

Run this code in the online editor

← VSAM and IDCAMSDB2 basics →