COBOL HELLO WORLD Program

Let us code a simple COBOL HELLO WORLD Program

Step1: Code the COBOL Program

Step2: Prepare the COMPILE JCL to compile and Link Edit the COBOL Program

Step3: Prepare the RUN JCL to execute the COBOL Program

Step 1 - Simple HELLO COBOL WORLD Program

Copy this HELLO WORLD COBOL Program

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLOWRD.

PROCEDURE DIVISION.
DISPLAY "SIMPLE HELLO WORLD".
STOP RUN.
TutorialBrain-Compile JCL to compile and link edit the COBOL Program
SIMPLEST HELLO WORLD PROGRAM

Step 2 - JCL Compile - To Compile the COBOL Program

Note/warning/suggestion/improvement:
TutorialBrain is providing 2 types of compile JCL  because most of the organization has their own customized COMPILE as per their requirement. You can choose which one works for you.

compiling- First form of JCL

//MATEKSD JOB MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*
//* COMPILE A COBOL PROGRAM
//*
//CL EXEC COBOLCL,
// COPYLIB=MATEKS.COPYLIB, <= COPYBOOK LIBRARY
// LOADLIB=MATEKS.LOADLIB, <= LOAD LIBRARY
// SRCLIB=MATEKS.COBOL.SRCLIB, <= SOURCE LIBRARY
// MEMBER=COB001 <= SOURCE MEMBER

compiling- The Second form of JCL

//COMPJCL JOB 1AD40G12,'COMPCOB-COMPLINK',NOTIFY=&SYSUID
//*************************************************************
//*COMPILAR Y LINKEDITAR
//*************************************************************
//STEP0 EXEC IGYWCL,PARM.COBOL='LIB,APOST,XREF,MAP,OFFSET'
//* -----------------------------------------------------------
//* JCL PARA COMPILAR PGM DE COBOL (SIN DB2 Y SIN CICS)
//* -----------------------------------------------------------
//* -----------------------------------------------------------
//COBOL.SYSLIB DD DISP=SHR,DSN=MATEKS.COBOL.COPYLIB
//COBOL.SYSIN DD DISP=SHR,DSN=MATEKS.COBOL.SRCLIB(COB001)
//LKED.SYSLMOD DD DISP=OLD,DSN=MATEKS.COBOL.LOADLIB(COB001)
/*
//
TutorialBrain-Compile JCL to compile and link edit the COBOL Program
JCL COMPILE

Step 3 - Run JCL - To Run(Execute) the COBOL program)

Run JCL

//MATEKSD JOB MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*
//* RUN A COBOL PROGRAM,
//*
//STEP01 EXEC PGM=COB001
//STEPLIB DD DSN=MATEKS.LOADLIB,DISP=SHR
//SYSOUT DD SYSOUT=*
TutorialBrain-Sample RUN JCL to execute the HELLO WORLD COBOL Program
RUN JCL

Output

TutorialBrain-HELLO WORLD displayed in SPOOL
Output displayed in SPOOL

Tutorials for all brains!