COBOL Batch Program Example

COBOL Batch program(example) is a cobol program that runs in a bath mode. Unlike the Online programs, batch programs runs in background. To execute any Batch program a JOB written in JCL(Job Control Language) is required. This JOB is also used to specify any files that are used in that program. Generally Batch programs are developed perform any particular functionality which needs to be run in a specific time frequency say Daily, weekly, monthly etc. To run a program in a specific frequency, there is no specific coding is needed and a JOB scheduling tool takes care of this. There are several scheduling tools available in the market like CA7, Zeke, ESP etc.

Below is the sample Batch COBOL program that reads a flat input file and generates an output file. Input file is a customer file which contains CUSTOMER details like Number, Name and Transaction type etc. Output should contain Number and Name for the Credit type of transactions and also the Counts need to be displayed.


Leave a Reply

Your email address will not be published. Required fields are marked *