Week 13-B 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 Spring 2002 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) - if they have correct defaults (e.g. an IDCAMS copy), don't specify them - remember to code LABEL for ANSI tapes - remember the 2K output block size limit for ANSI tapes - catalog a dataset on its last use, not its first use - use "PASS" on intermediate steps; use CATLG on the last step - spelling counts: MSGCLASS - CLASS= tells which overall system job queue to wait in - want the fastest class; but, be accurate about resource usage - PRTY= chooses priority within the selected CLASS= job queue - consider *whole* job when picking job CLASS= queue - MSGCLASS= sets JES (JCL) output message spool queue - directs the JCL and allocation messages to the queue you specify - typically no need for special forms - often select a queue to hold for TSO viewing - DISP=(MOD) is used for extending sequential datasets - not used to modify datasets during an update - we never use MOD in this course - you cannot make up DDnames - the expected DDnames are built into the programs you are using - all the DDnames were given in the question specifications for Lab 1 - no labels means SL (standard labels); a reasonable assumption - no need to code LABEL= for standard labels - note that LRECL defaults to 80 only for *instream* data - watch the DCB of your input when you use IDCAMS - IDCAMS copies the input DCB to output DCB unless you over-ride it - 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 the special form paper can be installed and lined up - let second SYSOUT parameter default (two adjacent 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 (ignored) COPIES= - request multiple copies of the spooled output - each copy counts towards your job CLASS= output line limits DEST=nodename.userid [NOT COVERED IN WINTER 2002] - 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. (You must know the internal step name of the Link step!) 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 -------- A Compile, Link, and GO step using a cataloged procedure (EXEC PROC=). The CBL step name in the proc is given, but not the DDname by which the compiler will read the COBOL source program. - you can't always look in the PROC to find out a DDname, since some DDnames don't have default values in the PROC (e.g. the source input) - the DDname we are looking for is in the compiler, not in the PROC - though the PROC may supply a "default" compiler input dummy DD statement - only by running the compiler will we 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 - we are 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 done in this course) We are missing the DDname for the special forms INVC output - this DDname lies inside our test COBOL program (not in the compiler!) - the PROC definitely will not have it listed - TYPRUN=SCAN will not discover the error - this is a DDname guess, a run-time error, not a JCL error - need to look at the COBOL source code for the program we are running - 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 - when the program runs, it will look for its compiled-in DDnames 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 - we may end up waiting behind another 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 (JCL) SYSOUT message queue, not a job class - note that this installation has no TSO SYSOUT HOLD spool queue - we can't code HOLD= on the JOB card - HOLD= is a DD SYSOUT parameter! // 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 - no need to waste paper printing the JCL listing // PRTY=7 - find out which version of JES to determine actual top priority - medium priority is approx integer(15 / 2) = 7 //CLG EXEC PROC=COBOLCLG - we are using a cataloged procedure named COBOLCLG - the PROC over-ride DD statements we supply (below) must follow the order of the internal steps inside the PROC being used //* 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 (run time or JCL error?) - we 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 - order of DD statements: - all the proc step CBL JCL must come before all proc step LINK JCL - we can't put this source program instream data last; it must appear before the LINK step DDnames //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 - cataloged datasets are very easy to use! - DCB is (almost) never required for an existing dataset - the DCB info is retained in the label on the dataset itself - LABEL is only required for non-IBM (e.g. ANSI) tape labels - DISP=SHR: we want to share this library, not exclusively lock it - SHR: read only, shared with others, no modifications - remember always to SHR libraries - KEEP the library, don't delete it! //GO.TSTOUT3 DD DSN=TESTOUT,DISP=(NEW,PASS), // BLKSIZE=4000,RECFM=FB, - this is a NEW dataset, we must specify the 4 DCB parameters - 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 the DCB parameters that are absolutely necessary - parameters specified in the program must not appear in JCL - the COBOL program specified DSORG and LRECL; but, not block size - therefore, we only code the missing BLKSIZE and RECFM - 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: - integer(4K / 100) * 100 = 4000 bytes // UNIT=DASD, - we pick the new dataset name (it was not specified) - this is a "choice", not a "guess"; any syntactically correct name will do - we will pass the dataset by name to the next step - the shop specifications say "DASD" is the way to specify disks - there is 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)) - we 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 SPACE parameter is 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 (ask around) - 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 (run-time or JCL error?) - 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 when the program runs - SYSOUT C: SYSOUT is always a JES output spool queue - 2000 lines and special forms means SYSOUT class "Charlie" - SYSOUT INVC: special forms is third positional parameter - both 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 not used in DAT2330 WINTER 2002 ***] - 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 any DCB (it's in the label) Step Two -------- Print out the TESTOUT dataset for verification. This is a standard IDCAMS copy (REPRO) operation with 4 DDnames: //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 the laser printer SYSOUT spool queue - flash the "DATA" form behind the text being printed as we print each page - two copies are required (both count towards JOB CLASS= resource limits) //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 - this is the last time we use this dataset; catalog it now //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 - if this were changed to output to a disk or to tape, we should specify BLKSIZE= and RECFM=FB to avoid inter-block gaps // 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.