Week 15 Notes for DAT2330 - Ian Allen Supplement to Text, outlining the material done in class and lab. Remember - knowing how to find out the answer is more important than memorizing the answer. Learn to fish! RTFM![*] ([*] Read The Fine Manual) ==================================== MVS - O/S 390 - Job Control Language ==================================== -IAN! idallen@ncf.ca August 2001 These notes are largely based on lectures by Harold Smith: - DAT2330 - Harold Smith Class - Wed Feb 23, 2000 --------------------------------------------------------- Today: review the homework - "MVS JCL Example 4 Homework" --------------------------------------------------------- Approach: Cross out every line in job specification as you add it to JCL. Use a Flow Diagram if you find it useful. Review ------ What is the difference between a PROC and a program? - proc is a set of JCL (it is text; it can't be executed as machine code) - program is machine code (binary; it can't be included as a PROC) Where does MVS find cataloged procedures? - these are specified by saying EXEC PROC= - in SYS1.PROCLIB Where does MVS find programs (e.g. IDCAMS, COBOL compiler, linker)? - these are specified by saying EXEC PGM= - in SYS1.LINKLIB How can I make EXEC PGM= find my own program in my own library? - use a JOBLIB or STEPLIB DD statement Coding the JCL for Example 4 Homework ------------------------------------- No guesses were made in coding this job. Where information was missing in the job spec, we could find it by looking it up in the given PROC listing. Step One -------- //COBOLCLG JOB 4111HW,'MY NAME',CLASS=D, // MSGCLASS=D,MSGLEVEL=(1,1) - CLASS= specifies the JES job queue - looks like less than 5000 lines of output (but more than 500) - we do use tapes - we will be coding a REGION that fits under 100M - use job CLASS=D - MSGCLASS= specifies sysout print queue for *JCL/JES* messages only - always send it to TSO if possible, to class A if not - TSO sysout queue is class D for this example //TESTGEN EXEC PGM=TESTGEN,PARM=(PAYROLL,HOURLY) //STEPLIB DD DSN=TEAM1.PVTLIB,DISP=(SHR,KEEP) - program TESTGEN: - using your own program to generate test data is common - need to test all your program boundary conditions - real data may not be varied enough for testing - the TESTGEN program uses PARMs for "command line parameters" - IDCAMS uses DDname SYSIN to read its parameters (options) - no need to qualify a PARM used on a PGM= with a step name - this is not a PROC; there is only one program being executed - there is only one program (PGM=) in one step here - need to get TESTGEN executable program from a private library - PGM= will look for programs in library given by JOBLIB or STEPLIB - PGM= will find the TESTGEN program in the given STEPLIB library - these libraries contain *executable* modules, not object files - only one program (TESTGEN) comes from the private library of executables - use STEPLIB for the one step, not JOBLIB for the whole job - no need for COND on first step of a job! - there is no previous step to check //TSTOUT DD DSN=TESTDATA,DISP=(NEW,PASS), // UNIT=DASD,SPACE=(4000,(125,10)) - we choose the output dataset name (this is not a "guess") - output DCB (DSORG, LRECL, BLKSIZE, and RECFM) is fully given in job spec - the TESTGEN program specifies the whole DCB for us - no need for DCB at all in the JCL - calculate SPACE needed on disk: 10,000 records of 50 bytes each = 500,000 bytes 500,000 bytes divided by 4000 bytes in a block = 125 blocks (primary extent) - no secondary extent size suggested - I picked a round number a bit less than 10% Step Two -------- //CLG EXEC PROC=COBOLCLG,COND=(3,LT), - COND defaults to test against return codes of *all* previous steps - there is only one previous step at this point - COND is reversed - encode it as follows: Step 1: execute IF RC <= 3 (this is given in the job spec) Step 2: execute IF 3 >= RC Step 3: skip IF 3 < RC Step 4: COND=(3,LT) - Check it: decode it as follows: 3 < RC means skip 3 >= RC means execute RC <= 3 means execute - that's correct // PARM.COB2=(XREF,OBJ), - PARMs could be applied to pass options to any step in a proc - but the job spec says to only affect the compiler - the compiler executes in PROC step name COB2 - therefore: add step name suffix to PARM --> PARM.COB2= - job spec says this PARM is to be completely over-riding - no need to copy the other PARM values from the PROC listing // COND.GO=(4,LE,CLG.COB2), - job spec says to execute the GO step only if the compile step (step name COB2) sets a code less than 4 - must affect only the GO step in the PROC, not all the steps - we code COND.GO= to set the COND on only the GO step in the PROC - COND is reversed - encode it as follows: Step 1: execute IF RC < 4 (this is given in the job spec) Step 2: execute IF 4 > RC Step 3: skip IF 4 <= RC Step 4: COND=(4,LE, ... - Check it: decode it as follows: 4 <= RC means skip 4 > RC means execute RC < 4 means execute - that's correct - this COND must check the return code from the compile step - don't check all the steps (default); only check the compile step - need to code the step name to check as: mystepname.procstepname - step name is coded as: CLG.COB2 - write: COND=(4,LE,CLG.COB2) // TIME.GO=(,30),REGION.GO=4M,ADDRSPC.GO= - these EXEC parameters need step name .GO on the end - must affect only the GO step in the PROC, not all the steps - remove ADDRSPC when you find it //COB2.SYSLIB DD DSN=TEAM1.SRCLIB,DISP=SHR - job spec says to use our own COBOL source library - it is the compiler program that will get source from a *source* library - source is not an executable program - source is not an object module - this library is not a linklib-style library - this library is a library of *source code* - this is not an object library! - compilers do not read object modules; compilers read source code - read the given PROC to locate the DDname for the source library - proc step COB2 - DDname SYSLIB --> we code //COB2.SYSLIB DD to over-ride it //COB2.SYSPRINT DD SYSOUT=D - job spec says hold compiler output for TSO - To send compiler output to TSO, we need to over-ride the default SYSOUT specification set inside the PROC we are using. - look at PROC to discover where PROC sends compiler output - find the step name that uses the compiler program - proc step COB2 has compiler EXEC in it - the DDname for the listing is given there as SYSPRINT - over-ride this line using //COB2.SYSPRINT //COB2.SYSIN DD * [...instream COBOL source goes here...] /* - we prefer to put instream data last (of all the COB2 DD statements) //LKED.SYSLIB DD DSN=Y2K.OBJLIB,DISP=SHR - job spec says over-ride (replace) the library used by the link editor - read the given PROC to locate the DDname for the linker library - step LKED, DDname SYSLIB --> //LKED.SYSLIB //GO.DATOUT DD DSN=TESTOUT,DISP=(NEW,CATLG), // BLKSIZE=4000,RECFM=FB, // UNIT=DASD,SPACE=(4000,(250,10)) - we choose the output dataset name (this is not a "guess") - catalog this dataset now, since we don't use it later in this job - check my COBOL source to see what DCB it specifies - don't specify DCB parameters that the COBOL already specifies - int(4K / 100) * 100 = 4000 bytes per block - 10,000 records of 100 bytes each = 1,000,000 bytes 1,000,000 bytes divided by 4000 bytes per block = 250 blocks (primary extent) secondary extent size was not given; I estimate 10 blocks (4%) //GO.SUMM DD DSN=SUMMTAPE,DISP=(NEW,PASS), // BLKSIZE=2000,RECFM=FB, // LABEL=(,AL), // UNIT=TAPES,VOL=SER=123456 - we choose the output dataset name (this is not a "guess") - ANSI label tapes have 2k blocksize limit - int(2K / 100) * 100 = 2000 bytes per block - no SPACE= needed for tapes //GO.DATIN DD DSN=TESTDATA,DISP=(OLD,DELETE) - this is the dataset PASSed in from the first step - PASSed datasets need nothing except DSN and DISP - job spec says to delete this after its last use Step Three ---------- //SHOWTAPE EXEC PGM=IDCAMS,COND=(0,NE) //SYSPRINT DD SYSOUT=D //OUT DD SYSOUT=(C,,GRLN),COPIES=2 //IN DD DSN=SUMMTAPE,DISP=(OLD,KEEP) //SYSIN DD * REPRO INFILE(IN) OUTFILE(OUT) /* - all previous steps must work correctly: calculate COND Step 1: execute IF RC = 0 (this is given in the job spec) Step 2: execute IF 0 = RC Step 3: skip IF 0 != RC Step 4: COND=(0,NE) - PASSed datasets need nothing except DSN and DISP // - End of Job. To get a listing of just the JCL from this file, use the Unix command: $ grep '^/' thisfile Notes on Optimal Blocking ------------------------- SMS will let you leave out BLKSIZE if you run SMS in your MVS shop - but not all MVS shops run it! - leave out BLKSIZE only if SMS is running - 4K is a good compromise; but, it isn't best - want one full track for best disk use - hence, "half-track" blocking is often suggested *** END OF DAT2330 NOTES ***