Week 13 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 July 2001 These notes are largely based on lectures by Harold Smith: - DAT2330 - Harold Smith Class - Thu Feb 10, 2000 Notes on Winter 2000 Lab assignment #1 -------------------------------------- This description and JCL from last year was provided as an extra example for this term, to give you more practice at reading JCL job descriptions. - don't specify DSORG, LRECL if you don't need them (keep it simple) - remember to code LABEL for ANSI tapes - remember the 2K output block size limit for ANSI tapes - need to catalog dataset on its last use, not its first use - use "PASS" on intermediate steps - spelling counts: MSGCLASS - CLASS= tells which job queue to wait in - want the fastest class - PRTY= chooses priority within the selected job queue - consider *whole* job when picking job class - MSGLASS= sets JES output message spool queue - typically no special forms - often select a queue to hold for TSO - DISP=(MOD) used for extending sequential datasets - not used to modify datasets during update - you cannot make up DDnames - all the DDnames were in the question specifications for Lab 1 - no labels means SL (standard labels); a reasonable assumption - note that LRECL defaults to 80 only for *instream* data - watch the DCB of your input when you use IDCAMS - IDCAMS copies input DCB to output DCB - review text p.44 for "The C.L.G. Process" - input to compiler must use step name of compiler - input to run/go step must use that step name --------------------------------------- MVS JCL Example 3 and attached homework --------------------------------------- New Parameters -------------- For //ddname DD ... SYSOUT=(class,,form) [using special forms] BURST= COPIES= DEST=nodename.userid FLASH= HOLD= OUTLIM= SPACE=(blksize,(primary,secondary)) New item: modifying SYSLIB SYSOUT=(class,,form) [using special forms] - special form name is third positional parameter (p.175) - used to tell operator to change paper in printer for this output - operator has to align the paper with the printed output - special forms may cause output to be delayed until printer isn't busy and special form can be installed and lined up - let second SYSOUT parameter default (two commas) BURST= - YES to have continuous form fan-fold paper split at the perforations into individual sheets by the operator - a mechanical "burster" machine is very noisy! - may also apply to continuous-sheet laser printers that cut their output into individual pages - doesn't apply to single-sheet printers COPIES= - request multiple copies of the spooled output - each copy counts towards your job class output line limits DEST=nodename.userid - send output to a TSO user on a particular machine - e.g DEST=ACADMVS.IDALLEN or DEST=MVS1.SMITHH FLASH= - (laser printer only) specify a background form to print first - your data text will print on top of the background form - easy to use; no special forms alignment required by operators HOLD= - means: don't send this to the printer; hold it before printing - hold the output in the spool queue for pick-up and viewing via TSO - may be used even if there is no special TSO sysout queue OUTLIM= - limit the number of lines of output - typically only done while testing your code, to prevent errors - production programs are presumed to work correctly and don't need this; indeed, an incorrect value may cause a production program that is working correctly to fail due to "too many" output lines SPACE=(blksize,(primarycount,secondarycount)) - request a specific amount of disk (not tape) output space - never need to specify space for a tape - blksize is the same number as you choose for the DCB BLKSIZE - don't normally use TRK or CYL sizes; they are device-dependent - primarycount and secondarycount are counts of blksize blocks e.g. SPACE=(4096,(100,10)) requests an initial allocation of 100 4K blocks (409600 bytes) called the "primary extent", with growth in chunks of 10 4K blocks (40960 bytes) called "secondary extents". - Warning: Unless SMS is in use, you only get 15 secondary extents before your dataset is out of space and has to be copied to a new dataset with new SPACE parameters! Modifying SYSLIB ---------------- The linker (link editor) searches a library to find all the object code needed to make your program complete. You can change this library by over-riding the SYSLIB DDname in the Link step in the Compiler/Link/Go procedure. Review: The Compile, Link, and Go process (p.44) Review: Rules for ordering DD statements when using a PROC Coding the JCL for Example #3 ----------------------------- Step One -------- CBL step name in the proc is given, but not the DDname for the source program. - can't always look in the PROC to find out a DDname - DDname is in the compiler, not in the PROC - though the PROC may supply a "default" compiler input dummy DD statement - running the compiler will generate an error message to tell us what DDname to use, if we guess wrongly - this is a run-time error, not a JCL error Can TYPRUN=SCAN on the JOB card detect an invalid DDname? - no, since SCAN doesn't run any programs - programs must run to detect incorrect DDnames - in a long-wait job queue, scanning JCL first is a good idea - but we won't detect the DDname guesses until actual run time DDnames are coded inside the programs (PGM=) we run - DDnames connect the programs to the world (their datasets) - the programs don't know the names of the files (datasets), only the DDnames. We code JCL to connect the program DDnames to dataset names (or to sysout spool queues). - MVS programs never contain the *names* of any datasets (files)! - they only contain *DDnames* - your JCL connects the program DDnames to datasets Need to modify LINK step of PROC to use a different link library - we have our own subroutines we want to use - need to bring in a different library - we are *replacing* the COBOL standard link library - this is not SYS1.LINKLIB, which is actually a library of executable *programs* (e.g. IDCAMS), not a library of *object code* modules - linker expects COBOL standard library on DDname SYSLIB - refer to diagram of CLG process (Figure 3.5, p.44) - see where link editor expects to add subroutine libraries - this "SYSLIB" DDname for the link editor is used in the PROC - we can use our JCL to *over-ride* the given SYSLIB in that step - not adding a *new* DDname, we are *changing* an existing one - we lose access to original library given in the PROC, unless we also add that library to our own JCL (not in this course) Missing DDname for special forms INVC output - this DDname lies inside our test COBOL program - the PROC definitely will not have it listed - TYPRUN=SCAN will not discover the error - this is a run-time error, not a JCL error - need to look at the COBOL source code - read the instream source and find the SELECT statement - if you don't read COBOL, or don't have the source, run the job and look at the run-time error messages from the program Document your guesses using JCL comments: //* I AM GUESSING SEVERAL DDNAMES IN STEP ONE. //* I NEED TO SEE THE RUN-TIME ERROR MESSAGES TO FIX THIS JCL. //* //CBLTSTE3 JOB 3000EX,'MY NAME',CLASS=E, - CLASS=E is the only job class that allows multi-tapes *and* special forms - would prefer not to run in this slow class - may be behind a long-running job - may not be scheduled until much later (night or weekend!) - we want to see our DDname errors quickly - may sit a long time in CLASS=E before job is run // MSGCLASS=A, - this is the JES sysout message queue, not a job class - note that this installation has no TSO sysout HOLD spool queue // MSGLEVEL=(0,0), - we can safely set JCL to minimum messages right away - our guesses are run-time DDname guesses, not JCL step name guesses // PRTY=7 - find out which version of JES to determine actual top priority - medium priority is approx int(15 / 2) = 7 //CLG EXEC PROC=COBOLCLG - proc over-ride DD statements must follow order given in the proc //* I AM GUESSING THIS COMPILER INPUT DDNAME - NOT GIVEN IN JOB SPEC. //* THIS WILL GENERATE A RUN-TIME ERROR AND I CAN CODE THE RIGHT DDNAME. //* SYSIN IS A PRETTY GOOD GUESS FOR AN IBM UTILITY. //* //CBL.SYSIN DD * ...COBOL source program goes instream here... /* - we weren't given the DDname for the compiler input in step CBL - document your guesses using JCL comments - don't have the source for the compiler to find out the DDname - ask around; copy existing JCL; or, run the job and look at the errors - DD order: all the proc step CBL JCL must come before all proc step LINK JCL - we can't put this instream data last //LINK.SYSLIB DD DSN=TEAM1.MODLIB,DISP=(SHR,KEEP) - this over-rides the SYSLIB DDname in the LINK step of the proc COBOLCLG - UNIT and VOL are only required to *find* an uncataloged volume - we assume this lib was catalogued, since we weren't told where it was - must specify at least UNIT if dataset is uncataloged - DCB is (almost) never required for an existing dataset - LABEL is only required for non-IBM tape labels - SHR: we want to share this library, not exclusively lock it - SHR: read only, shared with others, no modifications - remember always to SHR libraries! //GO.TSTOUT3 DD DSN=TESTOUT,DISP=(NEW,PASS), // BLKSIZE=4000,RECFM=FB, - always code DSN and DISP first on DD statements, followed by DCB - shortcut: the "DCB=" keyword and parentheses are optional! - DCB parameters were promoted to "real" (not sub-) parameters - only specify missing or changed DCB parameters - parameters specified in the program must not appear in JCL - COBOL program specified DSORG and LRECL; but, not block size - always specify RECFM when you specify BLKSIZE - FB means fixed length records (typical of COBOL): blocking used - 4000 is closest multiple of LRECL=100 below 4K: - int(4K / 100) * 100 = 4000 bytes // UNIT=DASD, - we pick the dataset name (not specified) - we will pass it by name to the next step - shop says "DASD" is the way to specify disks - no need for VOL=SER to force use of particular disk volume - VOL=SER= almost never done for online disk datasets // SPACE=(4000,(125,25)) - always need to code SPACE for a new *disk* dataset (not for tapes) - may want large, unfragmented, reserved disk space (fast processing) - may want to use minimal space and risk fragmenting disk (slower processing) - avoid allocating space using tracks (TRK) or cylinders (CYL) - too hardware dependent - first specify the block size (must match program block size) - next, specify number of primary blocks and number of extent blocks - these two numbers are *counts* of blocks; not block sizes - go back to question and examine space needs: - 5000 records of 100 bytes each = 500,000 byte output dataset - we already coded (above) that our BLKSIZE=4000 - 500,000 divided by 4000 = 125 primary blocks needed - must specify secondary space extents for future dataset growth - specifying growth increment controls dataset fragmentation on disk - you need to know your application to pick this well - our job specification says growth is 20% per update - 20% of 125 blocks is 25 blocks - Note: without SMS, we only get 15 secondary extents before dataset is "full" and needs to be re-allocated with fewer extents //* I AM GUESSING THE DDNAME OF THIS OUTPUT - NOT GIVIN IN JOB SPEC. //* THIS WILL GENERATE A RUN-TIME ERROR AND I CAN CODE THE RIGHT DDNAME. //* I SHOULD LOOK IN THE COBOL SOURCE BUT MAYBE I'M TOO LAZY. //* //GO.LAZYGUES DD SYSOUT=(C,,INVC),BURST=YES, - we weren't given the DDname for this output; we have to guess - document your guesses using JCL comments - since you will have the COBOL source instream, you can look in the source to find the DDnames yourself - no need to guess! - run-time error will tell you the actual DDname - SYSOUT C: sysout is always a JES spool queue - 2000 lines and special forms means sysout class "Charlie" - SYSOUT INVC: special forms is third positional parameter - commas are needed! (three positional parameters) - for special forms, see text page 175 (missing from index!) - BURST: separate the fan-fold pages at the perforations - only applies to printers that use continuous, fan-fold paper // OUTLIM=2100 - limit number of output lines (in case of runaway job!) - OUTLIM= is used for programs being tested, not production jobs - the MVS sysout spool queue class may also have an output lines limit //GO.TSTMSG DD SYSOUT=A,DEST=MVS1.LESLIE - DEST is another way to hold any output for TSO screen viewing - don't need any special HOLD sysout queue - user doesn't have to come looking for the output in the queue - this TSO user gets notification when output is available - specify TSO userid LESLIE at node name MVS1 //GO.TSTIN DD DSN=ATB.TESTDATA,DISP=(OLD,KEEP) - catalogued dataset is easy to find and easy to use! - no need for UNIT or VOL=SER! (they are in the catalog) - existing dataset doesn't need for DCB (it's in the label) Step Two -------- Print out the TESTOUT dataset for verification. //VERIDISK EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=A,HOLD=YES - this installation has no sysout class to hold output for TSO - another way to hold the output is HOLD=YES - might be coded as Y or might be coded as YES; ask around //OUT DD SYSOUT=L,COPIES=2,FLASH=DATA - order multiple SYSOUT parameters alphabetically (e.g. COPIES before FLASH) - specify laser printer sysout spool queue - flash the "DATA" form behind the text being printed - two copies are required //IN DD DSN=TESTOUT,DISP=(OLD,CATLG) - this is the PASSed test data from the previous step (same name) - passed dataset is easiest to specify! - no need for LABEL, DCB, UNIT, or VOL=SER= - we were told to catalog this tape for future use //SYSIN DD * REPRO INFILE(IN) OUTFILE(OUT) /* - request a standard IDCAMS copy operation - no need to re-block output that is going to a sysout queue // End of job. To get a listing of just the JCL from this file, use the Unix command: $ grep '^/' thisfile Do the "MVS JCL Example 3 Homework" question; we will review it next class.