JCL Tutorials: Features and Practical Examples

Welcome to our JCL (Job Control Language) programming tutorial portal! Here at cobolcoder.com, we are dedicated to providing you with detailed and accessible resources to help you master JCL and optimize your workflows in mainframe environments.

What is JCL? Job Control Language (JCL) is essential in the world of mainframes, as it allows the definition and management of task and program execution in operating systems like IBM z/OS. On our platform, you will find a series of step-by-step tutorials designed to help you understand the fundamentals of JCL, from job creation to resource management and performance optimization.

Dive into the fascinating world of JCL with us! Explore our tutorials, participate in the community, and take your mainframe programming skills to the next level. We are excited to be a part of your JCL learning journey!

Basic Guides to Programming in JCL

SORT in JCL

In JCL (Job Control Language), you can use the SORT program to sort two files.

//SORTJOB JOB (123),'Nombre del job',CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1) 
//STEP1 EXEC PGM=SORT 
//SYSOUT DD SYSOUT=A 
//SORTIN1 DD DSN=your.input.file1,DISP=SHR 
//SORTIN2 DD DSN=your.input.file2,DISP=SHR 
//SORTOUT DD DSN=your.output.file,DISP=(NEW,CATLG,DELETE), 
//           UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE) 
//SYSIN DD * SORT FIELDS=(start_position,length,format,A/D) /*

This article explains its main features with programming examples.

SUM FIELDS

The SUM FIELDS JCL statement indicates that when two records have equal control fields in a SORT or merge operation, the summary fields are summed, the sum is placed in one of the records, and the other is deleted. If the EQUALS option is activated, the first record is retained; if the NOEQUALS option is activated, the retained record is unpredictable.

//SORTJOB JOB ...
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=input.dataset,DISP=SHR
//SORTOUT DD DSN=output.dataset,DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,SPACE=(CYL,(5,5)),DCB=(RECFM=FB,LRECL=80)
//SYSIN DD *
  SORT FIELDS=(1,3,CH,A)
  SUM FIELDS=(10,3,ZD),FORMAT=BI
/*

The following entry details and explains its main features with examples and illustrations.