DAT2330 - Harold Smith Class - Thu Jan 27, 2000 Last week: sample JCL, flow diagrammed and analysed - JCL checklist - Basics (see course outline for details) - see the outline for the list of things we learn this week Today: "MVS JCL Example 1" (and attached homework) - instructions to test a program (usually COBOL) - how do we actually code JCL (as on the job) - we will assume many defaults - few things to learn to start out - this will be a real, working job - look up each of the parameters as we explore it - start with a flow diagram (not formal; only for you) - what are we being asked to do? - develop JCL to compile and run a program - start with title on flow diagram - 8 chars - read chapter 4 as you code (I won't teach it) - flow diagram: COBOLTST - JOHN SMITH - how many boxes for copile, link, and run COBOL? - three steps (three EXEC needed) - refer to "the CGL process" flow diagram Figure 3.5 - how can I do all three steps in one EXEC? - use a catalogued procedure: COBOLCLG - procedures come from sys1.proclib - call in this already-written procedure - one box, a dotted box in the flow diagram - three step names in the proc: COMP, LINK, TEST - hidden steps inside the PROC - different coding for proc and real steps - a proc doesn't have all the info about the job - e.g. missing OUTLIM for printing? - e.g. what kind of test data is needed? - e.g. where does output go? - e.g. where does the input come from? - can specify information that over-rides default assumptions made by the PROC and that supplies missing information - flow dia: create a dotted box named: step CLG - COBOLCLG - code instream COBOL source program as oval labelled "cobol source" - program is on SYSIN, but SYSIN to which step? - must qualify DD name; must know names of three steps inside the PROC - must use step name chosen by PROC writer - how to find out what DDname was used by the PROC writer? - try something! Error messages will tell me. - arrow labelled COMP.SYSIN goes from source oval to main PROC box - HINT: cross out each sentence in the assignment as you do it. - anything left over will need doing - add another oval for instream Test Data, label "test data" - where does test data come from? From DD name INDATA - DD name is TEST.INDATA on arrow from oval to dotted box - "dotted boxes require dotted DDnames on their arrows" - why not test programs with live data on datasets? - maybe it might damage the real data (could back it up?) - live data may not test all my conditions - may only test the IF part of IF ELSE - design the test data to exercise all parts of the program - update step (go) is both input and output - dataset must already exist for an update step - actual data set name is TESTMAST <== DSname - DDname derived from examining actual COBOL code - find the DDname used in the SELECT statement - SELECT MAST-FILE ASSIGN TO UPDTMST <= DDname FD MAST-FILE <== internal, cobol name RECORD CONTAINS 100 CHARACTERS BLOCK CONTAINS 10 RECORDS - arrow labelled as TEST.UPDTMST points to TESTMAST disk symbol - why not put DSname (actual name of dataset) right in the source? - would hard-wire the program to that dataset - have to rewrite the program to change datasets - want one level of indirection - another level of redirection gives COBOL a MAST-FILE name - the DSname may have to change if we port to another o/s - insulate cobol from change in DDname - tape DSname is PRODLIST - tape symbol labelled PRODLIST - arrow labelled TEST.LSTIN - print output - DDname is PRINTOP - arrow is labelled TEST.PRINTOP - EXEC VERDATA step - box label is ISITRUE exec VERDATA box - arrow from disk needs a DDname - but not given! - you cannot invent your own DDName - must use the one expected by the program! - go fish for name of DDname for program VERDATA - program probably in sys1.linklib - production programs may not have source - run the job and see what error I get - need DDname for print output (for TSO) - guess at PRTOUT, label the arrow Start coding - editor similar to wordpad - use fixed-width (monospace) font so that blanks are clear - must stop before column 72! - wordpad size 11 is about 10 chars/inch - consult JCL checklist - tests can have 1 side of 1 8.5x11 cheat sheet - submit sheet to professor ahead of time - prepare your own - UPPER CASE ONLY //coboltest job 1234,'john smith',class=B - watch out for positional parameters - keyword parms follow - CLASS: types of output queues - similar to priority, but technically not a priority - see web for sample classes - complex jobs may take longer to set up and run - use letter closest to A for best turn around time - check out which class satisfies job, closest to A - operator may kill or extend job when it runs out of resources - automated software may do this, not a human //clg exec proc=cobolcgl - proc must be from the library (use the exact name) - need 5 DD statements - order must follow order in catalogued procedure! //comp.sysin dd * ...cobol source goes here... /* - remember the /* to end the COBOL stream - put output first and input last so that instream data doesn't separate the output JCL from the rest of the JCL //test.printop dd sysout=A - see web for classes of SYSOUT spool queues //test.updtmst dd dsn=testmast,disp=(old,pass) - catalogue has all the other info about the dataset - no need to type it - has: unit, volume, space, - even offline data is catalogued - disp has positional parameters (but it, itself, is not positional!) - second parm says what to do with dataset - third says what to do if job fails (usually okay; leave it out) - no trailing comma! //test.lstin dd dsn=prodlist,disp=(old,keep) - what do we do with the dataset after the step ends - question doesn't say what to do - keep it - "pass" at end of job probably means "keep" //test.indata dd * ...test data appears here (on its own line).... /* //isittrue exec pgm=verdata //diskin dd dsn=testmast,disp=(old,delete) //prtout dd sysout=D - see web for classes of SYSOUT spool queues - want job held for TSO viewing - NOT class A or job will end up on paper! // - end of JOB Do the "MVS JCL Example 1" homework question - we will review it next week