Page 1 of 1

Learning JCL

PostPosted: Wed Oct 13, 2021 11:40 pm
by Mark Harvard
Hi, I am trying to teach myself JCL and COBOL so that I can understand what is going on when the devs push their code to certain areas of the mainframe. In doing so I understand Cobol but I am struggling to understand JCL and hoping I could get some pointers.

I wrote the cliche hello world code in COBOL and trying to write a JCL script to run it. I think I need 's but I am not sure which ones. Also, this just does not look right. Any advice would be helpful. Below is my script.


Basic Job Card
//STEP1        EXEC PRG=IGYCRCTL,COND(4,LT)
//*
//STEPLIB    DD DSN=<COMPILER-LOCATION>
//*
//SYSIN       DD DSN=<MY-COBOL-PROGRAM>
//*
//SYSOUT   DD SYSOUT=*  
 

Re: Learning JCL

PostPosted: Thu Oct 14, 2021 12:19 am
by sergeyken
You need at least three job steps in your test JCL:

1) The compilation step, running the standard COBOL compiler as a program, taking your test program text as its input, and producing the compiler listing, and compiled object code as its output.

2) The linkage or binder step, running the standard BINDER as a program, taking the object module from step 1 as its input, also looking into standard libraries for any external functions, combining all needed stuff together, and producing the load module of your test program as its output, along with the binder listing.

3) The run or go or execute step, it runs the test load module produced in step 2, and allows it to do whatever it wants to do.

Take a look at this example for the first two steps: https://www.ibm.com/docs/en/adfz/adffzscc/1.8?topic=eczvp-sample-jcl-compiling-enterprise-cobol-zos-version-programs

The best way is, to consult with your site administration, because many settings may be very specific to a particular company.
Often there are customized JCL procedures combining all required JCL steps under a single // EXEC PROC=procname JCL statement.