• Save

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Slides jcl day1

on

  • 1,775 views

jcl_Day1

jcl_Day1

Statistics

Views

Total Views
1,775
Views on SlideShare
1,775
Embed Views
0

Actions

Likes
2
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • JCL (Job Control Language) – It is a set of control statements that provide the specifications necessary to process a job. Job - is the execution of one or more related programs in sequence. Each program to be executed by a job is called a job step. Batch work– It is the execution of a program without Human Interaction. JCL is a means of communication between a program that can be written in an application language and the MVS operating system. If you write a program in COBOL which accesses files or writes output, then it will be the JCL that will identify to the OS the resources that your program expects to use. JCL is not a procedural language like COBOL, Assembler or C. It’s not an OO Language like C++, JAVA or Smalltalk. Why JCL? Without JCL, programs can’t be run on an IBM mainframe environment. JCL is the command language of MVS and consists of a set of control statements that identifies the program to be executed and the data to be read or written. Jobs written in JCL are managed by an operating system (OS) component called the Job Entry Subsystem or JES . For every job that is submitted to OS for execution, we need to tell the OS, the programs it has to execute, the inputs that are required, the location of input and the location for output. These information are provided using statements known as Job Control Statements.
  • 1) JCL statements are coded in 80 byte records – Only 72 of the 80 chars are available to code the JCL. The columns 73-80 is reserved for an optional sequence number. 2) Each JCL statement is logically divided into five fields. All five fields may not appear on every statement.
  • Format of JCL statements (2 of 2) – Notes The format of a JCL statement is shown here. This is an example JOB statement. It has five parts namely identifier, name, operation, parameters and comments.
  • Basic Format of a JCL : ... Identifier [Name] [Operation] [Parameters] [Comments] Identifier - Two slashes ( // ) starting in col 1. Exceptions are For a delimiter statement , /* starting in col 1 For a comment statement , //* starting at col 1 Name – It can be from one to eight characters long, consisting of alphanumeric (A-Z and 0-9) and National (@,#,$) characters. Name should start with an alphabet or national ($, #, @) character. It must begin at col 3.
  • Operation – A valid operation code, such as JOB, EXEC or DD. Must be preceded and followed by a space. Parameters – One or more parameters depending on the operation. Individual parameters are separated from one another by commas, no intervening spaces. Comments – comments may follow parameters, preceded by one space and not extending beyond col 71 (All five fields may not appear on every statement.) 3) JCL parameters : a) Positional parameters are coded first in the parameter field. If you omit a positional parameter and code a following positional parameter, then code a comma to indicate the omitted parameter. Do not code the replacing comma if: The omitted positional parameter is the last positional parameter. All following positional parameters are also omitted. Only keyword parameters follow. All positional parameters are omitted b) Keyword parameters - A keyword consists of characters that appear in uppercase followed by an equals sign (e.g. NOTIFY=&SYSUID) followed by either characters that must be coded or variable information. Code any of the keyword parameters for a statement in any order in the parameter field after the positional parameters. Because of this positional independence, never code a comma to indicate the absence of a keyword parameter.
  • Positional Parameters : These parameters are coded first in the parameters field, and the operating system interprets the meaning based on the order in which they are presented. If any positional parameter is omitted, then we code an extra comma as a placeholder for it. Keyword Parameters : These Parameters are not interpreted based on its position in the parameter field. The parameter is coded with a keyword followed by a (=) equal sign and a value. They must always come after any required positional parameters. They can be coded in any order. The subparameters are coded in the same way as that of parameter and can also be positional or keyword. if you code more than one subparameter for a parameter then enclose it with parenthesis.
  • Various stages of JOB Processing Input : Job is taken as an input to JES Conversion : Job statements are converted into internal text for execution Execution : Selection of Initiator for execution of Job Output : Control of JCL Output messages Hardcopy : moving the output to output spool Purge : release of JCL from the spool for the next job
  • JES- Job Entry Subsystem. To process a job, a Job Entry Subsystem, or JES is used. It keeps track of jobs that enter the system, presents them to OS for processing, and sends their spooled output to the correct destination.
  • Mainly there are 3 types of JCL statements : JOB , EXEC and DD. The other types of statements are Null Statement, Comment Statements and some special statements.
  • This is a Sample JCL Code to execute a COBOL Program. It consists of a JOB Statement, EXEC Statement and a DD Statement JOB Statement includes the details of JOB Submitter, Priority and Class of Execution EXEC Statement consists of name of the program to be executed DD Statement consists of name of the dataset containing the Load Module of the COBOL Program At the End, The JCL is terminated by a Null Statement(optional). (For a null statement, only code // starting in col 1)
  • JOB statement: In JCL, a job can be considered as a unit of work that has to be executed. In a job statement, the following issues are addressed: The start of a new job must be specified. 2) A JOBName can be any name (but give your Mainframe ID, eg. TXXXXX) but JOBID (when you submit the job) is unique and distinct, so that it can be differentiated from other jobs. 3) A job is billed for usage of CPU time, resources, and so on. In order to bill it, an account information has to be provided (positional parameter). 4) The name of the programmer of the job can be specified (positional parameter). 5) Jobs can be categorized in different ways based on the following: a) Jobs that utilize lot of CPU time or those in which CPU time is not significant b) Jobs that take a very long time to execute or those that take relatively short time c) Jobs that have higher priority over others. 6) As job executes ,many kind of messages are generated. The device to which the these messages will be written must be specified. 7) Messages generated by the job itself, indicating the status of the job, error status of the job etc. The device to which these messages are to be written has to be specified. 8) If you want to continue the statement in the next line give a comma at the end of the current line and continue in the next line giving a space (col 3) after the identifier field.
  • JOB statement – Notes In INFOSYS mainframe, Job statement can be printed automatically by typing JOBCARD (or JC) command at the TSO command prompt. Example: //IN10878J JOB ,,NOTIFY=&SYSUID,CLASS=D,MSGLEVEL=(1,1),MSGCLASS=X . Here “IN10878J” is Job name, and maximum length is 8 character. As a standard on INFOSYS, Mainframe Job name should be user mainframe ID suffixed with J. For example, if your user id is T100000, then the job name should be T100000J.
  • This is used to bill or charge back any job that is run on the mainframe. More examples: //TXXXXXJ JOB ACCT12 //TXXXXXJ JOB (ACCT12,ER) //TXXXXXJ JOB (ACCT12,'EDUCATION-RESEARCH',123) //TXXXXXJ JOB (ACCT12,'O''RAEILY',123) //TXXXXXJ JOB 'ACCT12,ER' //TXXXXXJ JOB (,ER) Note: As far as the contents of these parameters are concerned, you need not bother about it, because the installation will give you the exact instruction to code it.
  • There is no special syntax for this. It should be followed immediately after the accounting information parameter. It can be 1 to 20 characters in length. More examples: //TXXXXXJ JOB ACCT12,SHIBU //TXXXXXJ JOB ACCT12,'SHIBU KUMAR' //TXXXXXJ JOB ACCT12,(SHIBU KUMAR) //TXXXXXJ JOB ACCT12,'O''RELY' //TXXXXXJ JOB ACCT12,'SHIBU.KUMAR'
  • CLASS parameter : This is used to assign a job-class to a job. A job-class identifies the nature of the job that is to be submitted. Some jobs can be executed very fast, whereas others take long time. Some jobs might be CPU intensive, some will require one or more tapes etc. The job class is used to identify these characteristics to the OS, thereby categorizing the job. Installation will fix the initiators associated with a job-class. The syntax of this statement is: CLASS=job-class where, job-class is any character between (A-Z) or number b/w 0 to 9. example: //TXXXXXJ JOB ,,CLASS=B //TXXXXXJ JOB ,,CLASS=2 Note : The meaning of a particular job-class is installation defined. So the letter A could be used to indicate that a job uses a lot of CPU time, or one that is a low priority one.
  • Jobs are assigned to various job classes. The Scheduler picks the job from each job class based on the priority value. This priority can be set by using the PRTY parameter on the JOB statement. Usually 0 has the lowest priority and 14 or 15 has the highest priority.
  • The MSGCLASS parameter allows you to assign an output class to your job log. The job log is a record of job-related information that you may find useful. The output classes you can use are defined by your installation. Job scheduler messages includes the JCL messages and system messages. If you specify MSGCLASS=A, your job’s message output is assigned to output class. Most of the time (depending on installation) it means the output will be printed on one of the printers. The Format is MSGCLASS=CLASS. NOTE: The installation decides the specific output device associated with each output-class. Job scheduler messages include all messages not printed by the job steps being executed but the JCL messages and system messages.
  • MSGLEVEL parameter: This parameter is used to specify the type of JCL and allocation messages which will be recorded on the output device specified in the MSGCLASS. When a job is submitted for execution, different kinds of messages are generated by the system. For ex. a) Log messages indicating jobname, username,etc are routed to the output device. b) JCL statements comprising the job will be output. c) Messages related to output of the job will be output. d) The output of the program being executed is output. e) Allocation and Deallocation (of resources) messages are output. The syntax of the parameter is: MSGLEVEL=(statements, messages) where a) statements: 0 - messages related to JOB statement only will be output. 1 - All JCL statements including cataloged procedure, symbolic parameter are output. 2 - Only the input JCL statements will be output. b) messages: 0 - Allocation/termination messages will be output only if the job terminates abnormally. 1 - Allocation/termination messages will be output regardless of whether the job terminates normally or abnormally.
  • Coding the parameter on job statement, a message is sent to your TSO/E terminal when the job completes execution. The Notify parameter requires either a valid TSO/E user-id or the &SYSUID. When &SYSUID is used, the system automatically inserts the user-id of the user who submits the job.
  • TYPRUN parameter: This parameter is used to specify a special type of job processing, such as whether a job is to be held until it is released, or whether its execution is to be suppressed altogether. The syntax of this statement is: TYPRUN= HOLD or SCAN or JCLHOLD or COPY a) TYPRUN=SCAN This will scan the JCL for syntax errors like invalid keywords, illegal characters and incorrect use of parenthesis, and reports it. The job will not be executed, even if there are no errors. b) TYPRUN=HOLD This will result in the job being held until it is released by the operator. This is useful when a job which utilize lot of resources are required to be held until a time when the system is relatively unused. It will check for errors when the job is submitted. c) TYPRUN=JCLHOLD This is same as HOLD option, but checks for JCL errors only when the operator releases the job. d) TYPRUN=COPY The job stream is printed as a SYSOUT dataset but not processed.
  • The syntax for the RESTART parameter of the JOB statement: RESTART=* or STEPNAME or STEPNAME.PROCSTEPNAME where, * indicates start from the first job step (default) STEPNAME indicates the start from the specified step in the JCL . STEPNAME.PROCSTEPNAME indicates start from the specified step within a procedure Examples: 1) //TXXXXXJ JOB ,,RESTART=STEP3 2) //TXXXXXJ JOB ,,RESTART=STEP3.STEP4
  • EXEC Statement: The general syntax of EXEC statement is: //stepname EXEC operands comments where, stepname - It is the name assigned to the job step. EXEC - It indicates that it is a job step NOTE: A maximum of 255 exec statements can be coded within a single job. Atleast one EXEC statement should be there for a single job. stepname: A stepname is optional. But it is required in the following conditions: If within a job a reference is made to a previously executed step, then the previous step must have a name. This is called REFERBACK. The syntax for referback is: DSN=*.ddname DSN=*.stepname.ddname DSN=*.stepname.procstepname.ddname Ex. //TXXXXXX JOB NOTIFY=&SYSUID,MSGLEVEL=(1,1),MSGCLASS=X //STEP1 EXEC PGM=IEFBR14 //SYSPRINT DD SYSOUT=* //DD1 DD DSN=EXXXXXX.JCL.TEST,DISP=(NEW,CATLG,DELETE),DCB=(LRECL=80,RECFM=FB,BLKSIZE=800), // SPACE=(TRK,(1,1)) //STEP2 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT1 DD * HELLO /* //SYSUT2 DD DSN=*.STEP1.DD1,DISP=SHR //SYSIN DD DUMMY 2) When we are overriding parameters, stepname is mandatory. 3) During abends, when we have to start the job (RESTART) again from a particular step, stepname is required.
  • The syntax of this parameter is: //stepname EXEC PGM=program-name where, program-name is a member of a system library or user-defined library You should also know that even though the PGM parameter looks like a keyword parameter, it is in fact a positional parameter. So make sure that it’s the first parameter coded on the EXEC statement.
  • Procedures will be covered in detail on Day 4.
  • ACCT parameter: This is used to supply accounting information for the job step that it is used. If coded, this is passed to the installation accounting routines. The syntax of this statement is: ACCT=(accounting information1,accounting information2,...) or ACCT=accounting information note: These accounting information are defined by the installation. example: //STEP1 EXEC PGM=PROG1,ACCT=(SHIBU,ER) //STEP1 EXEC PGM=PROG2,ACCT=SHIBU //STEP1 EXEC PGM=PROG3,ACCT=(SHIBU,ER,'EMPNO=1200') NOTE: The maximum no: of characters that you can include in accounting information including comma is 142. Also, if a sub-parameter consists of special characters, like = or -, then it must be enclosed in apostrophes.
  • PARM parameter: This is used to pass any information to a program as it executes. The syntax of the PARM parameter is: PARM=information string If the string contains special characters, it must be enclosed in single quotes. If the string is composed of several substrings, each substring must be separated from the next by a comma and the string must be enclosed inside parentheses . Information string is 1 to 100 characters in length. Any information coded in PARM field is program dependent. As a result, there are no special JCL rules to adhere to other than the rules of punctuation you must follow for any parameter value. example: //STEP1 EXEC PGM=PRIME,PARM='1,2,3' //STEP1 EXEC PGM=PRIME,PARM=(1,2,3) //STEP1 EXEC PGM=PALEND,PARM='SHIBU,LAAL,RAM'
  • If coded on JOB, it applies to all the job steps within that job. If coded on EXEC , it applies to only that job step. The significance of TIME and REGION parameters are same as in JOB Statements, but it will be for a specific STEP only.
  • Time parameter is coded in either in JOB, EXEC statements or both. The syntax is the same for both the JOB and EXEC statements with the exception of the ‘0’ value, which can be coded only in EXEC statement. Explanation for the Syntax : Minutes : Specifies the maximum number of processor minutes o job or job step can use. The number of minutes can range from 0 to 357912 (248.55 days). Seconds : Specifies the maximum nuber of processing seconds a job or a job step can use. The number of seconds range from 0 to 59. NOLIMIT : Specifies that a job or job step can use the processor for an unlimited amount of time. : Specifies that a job or job step can use the processor for an unlimited amount of time. Corresponds to the number of minutes in 24 hours MAXIMUM : Specifies that a job or job step can use the processor for the maximum amount of time(357,912 minutes or 248 days) 0 (EXEC only): Specifies that the job step can use the time remaining from the previous step. If the step exceeds the remaining time available, it will abend. The usefulness of TIME parameter is evident in test environments, e.g.., you can avoid wasting CPU time if the job or job step goes to an endless loop. Time out error = *S322
  • Reason for coding the TIME Parameter: You want to decrease or increase the amount of processor time for a job or job step from the default installation value. the output messages generated by the TIME parameter tell you how much processor time a job or job step used. If you are debugging a program, specifying the TIME parameter can limit the amount of time it runs if it gets caught in an endless loop. Your installation may require it. NOTE : Avoid coding TIME=0 on a JOB Statement. The results are unpredictable.
  • If you code TIME=0 on the EXEC statement, the job step can use the time remaining from the previous step. If it exceeds the remaining time available, the Step will fail.
  • A potential conflict occurs when an EXEC statement specifies a time limit that’s more than the limit remaining for the entire job. In that case, the job time limit takes precedence over the step time limit. In this example, The overall time allocated for the job is 5 minutes, but the time allocated to STEP1 and STEP2 is 3 minutes each. If STEP1 runs for 2.25 minutes, STEP2 will have only 2.75 minutes left to run, not the 3 minutes specified in its EXEC statement.
  • ADDRSPC parameter: This is used to indicate to the system that the job or job step is to use either virtual or real storage. The REAL storage can be appropriate for some time-dependent programs or specialized programs that perform system I/O operations. The syntax of the ADDRSPC is: ADDRSPC=VIRTUAL or ADDRSPC=REAL Setting it to VIRTUAL results in the job step being paged. If it is REAL ,the job step is executed in the real storage only. example: //STEP1 EXEC PGM=PROG3,ADDRSPC=REAL //STEP2 EXEC PGM=PROG3,ADDRSPC=VIRT It can be coded on both JOB and the EXEC statement.
  • REGION parameter: This is used to override the default amount of memory allocated to a job or job step. The syntax of REGION is: REGION=value1K REGION=value2M where, value1 and value2 are the size of memory in KB and MB respectively. Note: value1 can be upto 7 digits, whereas value2 can only be upto 4 digits. If coded in KB format, number should be a even number(otherwise, it will be rounded to next even number). If REGION=0K or 0M ,then all the available storage will be assigned to that job. example: //STEP1 EXEC PGM=PROG7,REGION=128K //STEP1 EXEC PGM=PROG8,REGION=91M NOTE: When we code these parameters on both statement: JOB - REGION will override EXEC - REGION If the Job step requires more space than what was specified by a REGION parameter, the JOB abends with an 804 or 80A completion code.
  • When you specify the COND parameter in a JOB statement as shown in the above example, you specify the conditions that cause the job to stop processing. For example, you have a job with several steps. If any of the steps issues a return code of 4 or more, the job should stop processing, bypassing the remaining steps. In such case, the COND parameter would be coded like this: //TXXXXXXJ JOB (115710),’SMYTH’,COND=(4,LE) This means that if 4 is less than or equal to the return code issued by any job step, the remaining job steps are to be bypassed. So if the return code is 8, the remaining steps are bypassed because the condition is true. In contrast, if the return code is 0, the condition is not true, so the job continues with next step. Below is the table showing the relational operators that you can code in the COND parameter: Operator Meaning GT Greater than GE Greater than or equal to LT Less than LE Less than or equal to EQ Equal to NE Not Equal to NOTE : The COND parameter specifies not the conditions under which processing is to continue, but rather the condition under which processing is to be terminated. Below table explains how the COND parameter handles return codes(RC) COND parameter Continue Job Terminate Job COND=(4,GT) RC>=4 RC8 RC0 COND=(8,LE) RC=8 COND=(12,EQ) RC<>12 RC=12 COND=(0,NE) RC=0 RC<>0 NOTE : you can combine up to eight conditions on a single COND parameters. Then, if any one of the conditions is true, the job terminates. This can be useful in situations where you are interested in stopping the job only if certain return codes are issued.
  • COND on EXEC: COND=(4,GE,STEP1) should be read as “If 4 is greater than or equal to the return code from step1, then bypass the current step. But if COND is coded only for a step and if that step bypasses, other steps will execute as normal. //TXXXXXJ JOB ,,NOTIFY=&SYSUID,CLASS=D,MSGLEVEL=(1,1),MSGCLASS=X //STEP1 EXEC PGM=IEFBR14 //STEP2 EXEC PGM=IEFBR14 //STEP3 EXEC PGM=IEFBR14,COND=(0,EQ) //STEP4 EXEC PGM=IEFBR14 //STEP5 EXEC PGM=IEFBR14 //STEP6 EXEC PGM=IEFBR14 //STEP7 EXEC PGM=IEFBR14 **************************** Bottom of Data **************************** Only step3 is bypassed, other steps will execute. IF a step gets abended, all the subsequent steps get bypassed, unless COND=ONLY or EVEN is specified. NOTE : If the COND parameter is coded on the JOB statement as well as the EXEC statement, then the COND on JOB will be executed first , then the COND on the EXEC will be executed.
  • COND on EXEC: //TXXXXXJ JOB ,,NOTIFY=&SYSUID,CLASS=D,MSGLEVEL=(1,1),MSGCLASS=X //STEP1 EXEC PGM=IEFBR14 //STEP2 EXEC PGM=IEFBR14 //STEP3 EXEC PGM=IEFBR14,COND=(0,EQ) //STEP4 EXEC PGM=IEFBR14 //STEP5 EXEC PGM=IEFBR14 //STEP6 EXEC PGM=IEFBR14 //STEP7 EXEC PGM=IEFBR14 **************************** Bottom of Data **************************** Only step3 is bypassed, other steps will execute. IF a step gets abended, all the subsequent steps get bypassed, unless COND=ONLY or EVEN is specified. NOTE : If the COND parameter is coded on the JOB statement as well as the EXEC statement, then the COND on JOB will be executed first , then the COND on the EXEC will be executed.
  • You can use the COND parameter on an EXEC statement to test return codes from previous job steps to determine whether or not to bypass the current job step. You can code an expression with a relational operator in the COND parameter to test the return code from a particular job step or from every job step.
  • This example explains the COND=ONLY parameter. NOTE: If a step does not execute because of Duplicate dataset names, RC for that step will be FLUSH. NOTE: But if a step ABENDS because of wrong program name etc, RC will be the ABEND CODE (like *S806) , In that case the execution of the subsequent steps depends on whether COND parameter is specified there or not. Only COND values we can give is COND=EVEN or ONLY. For other COND values (like COND=(0,eq)) or if no COND is coded, the step will be bypassed.
  • This example explains the COND=EVEN parameter.
  • In the above JCL, STEP1 executes with RC = 8 , hence the COND parameter coded in JOB statement is satisfied and the JOB terminates as the comparison returns true. Incidentally, if the condition of a COND parameter on a JOB statement is satisfied, the JOB terminates regardless of any COND parameter on EXEC statements. Note : If COND parameter is coded on both JOB and EXEC statement, then the condition on JOB is checked before checking the condition on EXEC statement.
  • IF statement: The Syntax of the IF/THEN/ELSE/ENDIF statement is : //name IF (Relational Expression) THEN JCL statements-executed if true //name ELSE JCL statements-executed-if-not-true //name ENDIF The Syntax of the Relational Expression is: Keyword [operator value] Operator Meaning NOT Logical not GT or > Greater than LT or < Less than NG Not Greater Than NL Not Less than EQ or = Equal to NE Not Equal to GE or >= Greater than or Equal to LE or <= Less than or Equal to AND or & And OR or | Or Keyword Meaning RC The highest return code issued by the job step previously executed. Stepname[procstep.]RC The return code issued by the specified job step or procedure step. ABEND True if an abend has occurred. Stepname,[procstep.]ABEND True if the specified job step or procedure step has abended. -ABEND True if an abend has not occurred. Stepname.[procstep.]-ABEND True if the specified job step or procedure step has not abended. ABENDCC=Sxxx True if the most recent system abend code is the abend code specified ABENDCC=Uxxxx True if the most recent User abend code is the abend code specified Stepname.[procstep.]RUN True if the specified job step or procedure step started execution Stepname.[procstep.]-RUN True if the specified job step or procedure step did not start execution.
  • Example for IF/THEN/ELSE/ENDIF. It’s self explanatory. Note : An IF construct can appear anywhere in the job after the first EXEC statement. The THEN clause and if used, the ELSE clause must contain at least one EXEC statement. You can nest IF construct up to a maximum of 15 levels.
  • This is JCL Code sample for executing more than one COBOL Program in a Sequence using Single JCL. Accordingly the step number is also incremented to show the sequence.
  • This JCL sample Code is used to execute a COBOL Program, which is accessing two file (INFILE and OUTFILE) for input and output. In INFILE DD statement the name of the input dataset, which is already created using ISPF, is mentioned In OUTFILE DD statement the dataset is newly created by giving all necessary parameters like DCB and Space including the name of dataset which is not created using ISPF before. It is very difficult to write the entire DD parameters for OUTFILE in one line and hence we have to continue the statements onto one or more lines. First, break the parameters field after comma that follows a parameter or subparameter. Second, code slashes in columns 1 and 2 of the following line. Third, Code the next parameter or subparameter beginning anywhere in columns 4 to 16 . We can use a Continuation character (X) in Column 72 to continue any non-parameter field.
  • The Job Entry Subsystem (JES) is the part of MVS, which manages batch jobs, and SYSOUT under MVS. The basic responsibilities of JES are: Entering the job into the system Schedule the job Job Processing Output
  • Various stages of JCL execution Input : Job is taken as an input to JES Conversion : Job statements are converted into internal text for execution Execution : Selection of Initiator for execution of Job Output : Control of JCL Output messages Hardcopy : moving the output to output spool Purge : release of JCL from the spool for the next job
  • JES2 accepts jobs, in the form of an input stream, from input devices, from other programs through internal readers, and from other nodes in a job entry network. The internal reader is a program that other programs can use to submit jobs, control statements, and commands to JES. Any job running in z/OS can use an internal reader to pass an input stream to JES. JES can receive multiple jobs simultaneously through multiple internal readers.
  • we often use the same set of job control statements repeatedly with little or no change, for example, to compile, assemble, link-edit, and execute a program. To save time and prevent errors, you can prepare sets of job control statements and place, or catalog, them in a partitioned data set (PDS) or partitioned data set extended (PDSE) known as a procedure library. The data set attributes of a procedure library should match SYS1.PROCLIB (record length of 80 and record format of FB). Such a set of job control statements in the system procedure library, SYS1.PROCLIB (or an installation-defined procedure library), is called a cataloged procedure. a procedure in an input stream is called an in-stream procedure. JES uses a converter program to analyze a job's JCL statements. The converter takes the job's JCL and merges it with JCL from a procedure library. Then, JES converts the composite JCL into Internal text that both JES and the initiator can recognize. Next, JES stores the Internal text on the spool data set. If JES detects any JCL errors, it issues messages, and the job is queued for output processing rather than execution. If there are no errors, JES queues the job for execution. Input to the conversion process consists of the Original JCL and any cataloged procedure referenced by it -Full Syntax checking of the JCL is done at this time -During conversion the JCL for a job is converted to its internal form, known as Internal text. All of the jobs that were marked awaiting conversion in the job Queue are converted
  • During Conversion: JES gives job to idle initiator. Initiator attaches the interpreter to build control blocks. Interpreter examines job stream and creates a series of control blocks which describe all data sets required. Initiator: A program that runs in system region of address space eligible for batch jobs. Examines JES spool, selects job, executes job in address space & returns to spool for next job. Each initiator has one or more job classes associated with it. Can control number of jobs of each class & combinations there-of. Within a class initiators select a job for execution based on priority ( 0 - 15 ). Initiator selects a job for execution and invokes the interpreter. Each initiator can run only one program at a time, so the number of initiators running on a system reflects the number of programs being multi programmed.
  • In the processing phase, JES2 responds to requests for jobs from the initiators. JES2 selects jobs that are waiting to run from a job queue and sends them to initiators. An initiator is a system program belonging to z/OS, but controlled by JES or by the workload management (WLM) component of z/OS, which starts a job allocating the required resources to allow it to compete with other jobs that are already running. JES2 initiators are initiators that are started by the operator or by JES2 automatically when the system initializes. They are defined to JES2 through JES2 initialization statements. The installation associates each initiator with one or more job classes in order to obtain an efficient use of available system resources. Initiators select jobs whose classes match the initiator-assigned class, obeying the priority of the queued jobs. WLM initiators are started by the system automatically based on performance goals, relative importance of the batch workload, and the capacity of the system to do more work. The initiators select jobs based on their service class and the order they were made available for execution. Jobs are routed to WLM initiators through a JOBCLASS JES2 initialization statement. An example of how job classes are assigned to initiators. Initiator Eligible job classes 1 A 2 B,C,D,H,L 3 B,C 4 C
  • Job execution – (2 of 2) - Notes This diagram explains the execution phase of job processing. The initiator and several other operating system programs run in the system region. It is explained with four stages as follows: Stage1: After initiator selects a job for execution, it invokes the interpreter , which builds the required control blocks in the address space’s SWA. Stage2: For each job step, the initiator invokes allocation routines to allocate the units, volumes and data sets required by the job step. Stage 3: After the job step’s resources have been allocated, the initiator creates a user region, loads the user program into it, and transfers control to the user program. Stage4: When the user program completes, the initiator invokes unallocation routines to de allocate the resources used by the job step. Then, if the job has more steps, the initiator repeats the allocation-execution-unallocation process. P.S : SWA – Scheduler Work Area, a part of the address space’s private area.
  • During the program execution phase, The in-stream data needed for execution is got from the in-stream dataset given in JCL (SYSIN) and any execution output and messages are sent to the output dataset of the Spool (SYSOUT). Finally after execution of all the Steps, the Job is terminated and purged from the address space.
  • OUTPUT: JES2 controls all SYSOUT processing. SYSOUT is system-produced output; that is, all output produced by, or for, a job. This output includes system messages that must be printed, as well as data sets requested by the user that must be printed or punched. After a job finishes, JES2 analyzes the characteristics of the job's output in terms of its output class and device setup requirements; then JES2 groups data sets with similar characteristics. JES2 queues the output for print or punch processing. HARDCOPY: JES2 selects output for processing from the output queues by output class, route code, priority, and other criteria. The output queue can have output that is to be processed locally or at a remote location. After processing all the output for a particular job, JES2 puts the job on the purge queue. PURGE: When all processing for a job completes, JES2 releases the spool space assigned to the job, making the space available for allocation to subsequent jobs. JES2 then issues a message to the operator indicating that the job has been purged from the system.

Slides jcl day1 Slides jcl day1 Presentation Transcript

  • JCL Day 1
  • Course Objectives
    • Introduce the participants to the basic concepts of Job Control Language(JCL).
    • To illustrate the syntax of JCL statements.
    • To demonstrate the use of IBM Utilities and Procedures.
    • To introduce the participants to Generation Data Group (GDG).
    • To allocate VSAM and non VSAM datasets using JCL.
  • Expectations
    • By the end of this Module you will know:
    • Significance of JCL in Batch Processing.
    • How to run an Application program in Mainframes?
    • How to create a PS, PDS, VSAM, GDG,.. Using JCL?
    • Pre-requisite for the coming modules COBOL, CICS and DB2.
  • Course Agenda
    • Day 1 : Introduction to JCL, JOB & EXEC statements.
    • Day 2 : DD statements, IBM Dataset Utilities.
    • Day 3 : IBM Utilities, Introduction to GDG, VSAM and Alternate Index.
    • Day 4 : JCL Procedures, Symbolic Parameters and Overriding Parameters.
  • Pre-requisites for JCL
    • MVS Operating system and its subsystem TSO
    • Navigating through ISPF
  • Session Plan - Day 1
    • Introduction to JCL.
    • JOB Statement.
      • Syntax
      • Positional and Keyword parameters
    • EXEC Statement.
      • Syntax
      • Positional and Keyword parameters
  • References
    • Raul Menendez, OS/390 and z/OS JCL , Murach
    • Doug Lowe, MVS JCL, Mike Murach & Associates, Inc.
    • Gary D Brown & S.A.M. Smith, MVS/VSAM, SPD
    • KSHOP
    • The basics of JCL
    • http://kshop/kshop/showdoc.asp?DocNo=91861
    • JCL Tips:
    • http://kshop/kshop/showdoc.asp?DocNo=7850
  • What is JCL?
    • Job:
      • Is the execution of one or more related programs in sequence.
      • Each program to be executed by a job is called a job step.
    • Job Control Language:
      • It is a set of control statements.
      • It provides information about resources required by the job to the OS.
    • Interface between Programs & MVS OS.
    • Not a Procedural or OO Language.
  • Format of JCL Statements (1 of 4)
    • JCLs are coded in 80 byte records.
    • JCL statements has the following fields
      • Identifier
      • Name
      • Operation
      • Parameters
      • Comments
  • Format of JCL Statements (2 of 4)
    • //P123 JOB 1234,MSNBC,CLASS=E JOBSTATEMENT
    • Name Parameters Comments
    • Identifier Operation
  • Format of JCL Statements (3 of 4)
    • Identifier
      • Two slashes ( // ) starting in col 1.
        • Exceptions
          • For a delimiter statement, /* starting in col 1.
          • For a comment statement , //* starting at col 1.
    • Name
      • 1 to 8 characters long.
      • Starts from col 3 with a letter char.
      • Valid chars are A-Z, 0-9 and national characters (#, @, $)
  • Format of JCL Statements (4 of 4)
    • Operation
      • A valid operation code, such as JOB, EXEC or DD. Must be preceded and followed by a space.
    • Parameters
      • There can be one or more parameters depending on the operation.
      • Individual parameters are separated from one another by commas with no intervening spaces.
      • Classified into two types - Positional and Keyword.
    • Comments
      • Comments may follow parameters, preceded by one space and not extending beyond col 71.
  • Coding Parameters for JCL Statements
    • Parameter begin at least one position after operation field.
    • There are two types of Parameters in JCL
      • Positional Parameters*
      • Keyword Parameters*
    • Positional parameters are coded first before any Keyword parameter.
    • Parameters are separated by ‘Commas’ only.
    • Blanks and Special Characters are enclosed in apostrophes.
  • Various stages of JOB Processing (1/2)
      • Input
      • Conversion
      • Execution
      • Output
      • Hard copy
      • Purge
  • Various stages of JOB Processing (2/2) Determine the need and characteristics of the job Create the JCL Submit the JCL JES interprets the text and passes it to the Z/OS initiator Z/OS manages each step of execution JES collects the output and information about the JOB JES prints the output User views and interprets output User Actions System Actions System Messages
    • JCL Statements
  • JCL statements
    • JOB - Job Identification
    • EXEC - Instruction for Execution
    • DD - Source of data to operate
  • Sample JCL Code : 1
    • //TXXXXXXJ JOB ,,NOTIFY=&SYSUID,CLASS=D,
    • // MSGLEVEL=(1,1),MSGCLASS=X
    • //*COMMENTS IN A JCL
    • //STEP1 EXEC PGM=<Program Name>
    • //STEPLIB DD DSN=‘OPERN.COBOL.LOADLIB’,DISP=SHR
    • //
    NULL STATEMENT
  • JOB statement
    • The very first statement in a JCL.
    • Identifies the beginning of a job to the OS.
    • The syntax of JOB statement is:
    • Example:
      • //TXXXXXXJ JOB ,,NOTIFY=&SYSUID,CLASS=D,
      • // MSGLEVEL=(1,1),MSGCLASS=X
    //JOBName JOB [ accounting information ] [ ,programmer name ] // [,CLASS=jobclass], // [ ,PASSWORD=password], // [ ,NOTIFY=user-id], // [ ,MSGCLASS=class ], // [ ,MSGLEVEL=(stmt,msg) ]
    • This slide is intentionally left blank
  • Parameters on the JOB statement Positional Parameters : Job accounting information Programmer’s name Keyword Parameters: CLASS MSGCLASS MSGLEVEL NOTIFY COND REGION PRTY RESTART TYPRUN TIME
  • Job accounting information Identifies the account number for billing purpose based on CPU time Utilized. The syntax of this parameter is: (account-number,additional-accounting-information1,..........) Both of these together should not exceed 142 characters in total. Example : //TXXXXXJ JOB (ACCT12,ER) where TXXXXX is the Mainframe ID
  • Programmer's name Used to specify the programmer's name and other information related to the job being submitted. Example : //TXXXXXJ JOB ACCT12,SHIBU //TXXXXXJ JOB ACCT12,'SHIBU KUMAR’ //TXXXXXJ JOB ACCT12,(SHIBU KUMAR)
  • CLASS Used to assign a job-class to a job which specifies the nature of the job. The syntax of this parameter is: CLASS=job-class where, job-class is any character between (A-Z) or number between 0 to 9 example: //TXXXXXJ JOB ,,CLASS=A //TXXXXXJ JOB ,,CLASS=9
  • PRTY
    • This is used along with the CLASS parameter
    • This assigns priority to jobs which belong to the same class
    • The syntax of this parameter is:
    • PRTY=number (0 to 14 or 15 depending on the installation)
    • example:
    • //TXXXXXJ JOB ,,CLASS=A,PRTY=2
    • //TXXXXXJ JOB ,,CLASS=A,PRTY=10
  • MSGCLASS Used to specify the output device to which the system messages and JCL messages are written. The syntax of this parameter is: MSGCLASS=output-class-name where, output-class-name is any character between (A-Z) or b/w 0 to 9. example: //TXXXXXJ JOB ,,MSGCLASS=A //TXXXXXJ JOB ,,MSGCLASS=5
  • MSGLEVEL Used to specify the type of JCL and allocation messages which will be recorded on the output device specified in the MSGCLASS. The syntax of this parameter is: MSGLEVEL=(statements, messages) where statements may be a number from 0 to 2 and messages is a value 0 or 1. example: //TXXXXXJ JOB ,,MSGLEVEL=(1,1) all messages are printed. //TXXXXXJ JOB ,,MSGLEVEL=0 only the JOB statement will be printed.
  • NOTIFY
    • Used to notify the user about completion of the job .
    • The syntax of the parameter is :
    • NOTIFY= userid or &SYSUID
    • example:
    • //TXXXXXJ JOB ,,NOTIFY=TXXXXXX
    • //TXXXXXJ JOB ,,NOTIFY=&SYSUID
  • TYPRUN Used to specify a special type of job processing, such as whether a job is to be held until it is released, or whether its execution is to be suppressed altogether. The syntax of this statement is: TYPRUN= HOLD or SCAN or JCLHOLD or COPY
  • RESTART Used to restart or resubmit a job from a specified step. The syntax for the RESTART parameter is : RESTART=* or STEPNAME or STEPNAME.PROCSTEPNAME examples: //TXXXXXJ JOB ,,RESTART=STEP3 //TXXXXXJ JOB ,,RESTART=STEP3.STEP4
  • EXEC statement
    • It Indicates a step within a job .
    • It specifies the program or procedure to be executed.
    • The general syntax of EXEC statement is:
    • //stepname EXEC parameters comments
    • A maximum of 255 exec statements can be coded within a single job
    • Atleast one EXEC statement should be there for a single job
  • Parameters on the EXEC statement Positional Parameters : PGM PROC Keyword Parameters: ACCT ADDRSPC COND PARM REGION TIME
  • PGM Used to specify the program or utility to be executed as part of the step. The syntax of this parameter is: //stepname EXEC PGM=program-name example: //STEP1 EXEC PGM=COBOLPRG (Executing a COBOL program) //STEP1 EXEC PGM=IEFBR14 (Executing a utility program)
  • PROC Used to call a cataloged procedure or an in-stream procedure to be executed The syntax of this parameter is: //stepname EXEC PROC=procedure-name or //stepname EXEC procedure-name example: //STEP1 EXEC PROC=MYPROC OR //STEP1 EXEC MYPROC
  • ACCT Used to supply accounting information for the job step. The syntax of this statement is: ACCT=(accounting information1,accounting information2,...) or ACCT=accounting information example: //STEP1 EXEC PGM=PROG1,ACCT=(SHIBU,ER)
  • PARM Used to pass any information to a program as it executes The syntax of the PARM parameter is: PARM=information string Where , information string is 1 to 100 characters in length example: //STEP1 EXEC PGM=PRIME,PARM='1,2,3' //STEP1 EXEC PGM=PALEND,PARM=‘WELCOME TO MAINFRAME'
  • Parameters common to JOB and EXEC There are some parameters that can be coded on JOB or EXEC or both. Examples: TIME REGION COND ADDRSPC ACCT
  • TIME (1 of 4)
    • Time parameter override the default execution time limit imposed during installation.
    • The Syntax of Time Parameter
    TIME={([minutes][,seconds])} {1440} {NOLIMIT} {MAXIMUM} {0} (EXEC statement only)
  • TIME cont. (2 of 4)
    • Examples
    • //TXXXXXXJ JOB ,, TIME=(10,3)
    • //TXXXXXXJ JOB ,, TIME=10
    • //TXXXXXXJ JOB (115710),’SMYTH’, TIME=MAXIMUM
    • //STEP1 EXEC PGM=IEFBR14, TIME=(,30)
    • //STEP1 EXEC PGM=COBOL1, TIME=NOLIMIT
    • //STEP2 EXEC PGM=COBOL2, TIME=1440
  • TIME cont. (3 of 4)
    • What is the Output?
    //TXXXXXXJ JOB (115710),’SMYTH’, TIME=3 //STEP1 EXEC PGM=COBOLPR1, TIME=3 … //STEP2 EXEC PGM=COBOLPR2, TIME=0 Execution: If STEP1 takes 2.25 minutes for execution, then What happens to STEP2 ? STEP2 will have only 0.75 minutes for execution. If it exceeds that time limit the step will abend
  • TIME cont. (4 of 4)
    • What is the Output?
    //TXXXXXXJ JOB (115710),’SMYTH’, TIME=5 //STEP1 EXEC PGM=COBOLPR1, TIME=3 … //STEP2 EXEC PGM=COBOLPR2, TIME=3 Execution: If STEP1 takes 2.25 minutes for execution, then What happens to STEP2 ? STEP2 will have only 2.75 minutes for execution. If it exceeds that time limit the step will abend
  • ADDRSPC Used to indicate the system that the job or job step is to use either Virtual(pageable) or real(non-pageable) storage The syntax of the ADDRSPC is : example: //TXXXXXJ JOB ,,ADDRSPC=REAL //STEP1 EXEC PGM=IEFBR14,,ADDRSPC=VIRT ADDRSPC={VIRT} {REAL}
  • REGION Used to override the default amount of memory allocated to a job or job step. The syntax of REGION is: REGION=value1K REGION=value2M example: //TXXXXXJ JOB ,,REGION=128K //STEP1 EXEC PGM=IEFBR14,REGION=91M
  • COND on JOB statement (1/2) Used for the conditional execution of job or job steps based on the return code from the previous step or steps. The syntax of COND parameter on JOB statement : COND=(code, operator) or COND=( (code, operator) [ , (code, operator) ] …) example: //TXXXXXJ JOB (115710),’SMYTH’,COND=(8,EQ) //TXXXXXJ JOB (115710),’SMYTH’,COND=((0,NE),(4,GE))
  • COND on JOB statement (2/2) Examples: //TXXXXXJ JOB ,,COND=(4,LT) //JOBLIB DD DSN=OPERN.COBOL.LOADLIB,DISP=SHR //STEP1 EXEC PGM=PROG1 //STEP2 EXEC PGM=PROG2 (Doesn’t exist) //STEP3 EXEC PGM=PROG3
    • STEP1 executes with RC = 0
    • STEP2 executes with
    • S806 abend which is greater than 4
    • Job terminates
  • COND on EXEC statement (1/5) Used for the conditional execution of job steps based on the return code from the previous step or steps Syntax: COND=( 0 to 4095 , GT/GE/LT/LE/EQ/NE , step name , EVEN/ONLY ) RC Comparison Condition code EVEN : Step will be executed even if any of (0 – 4095) the previous step abnormally terminates ONLY : Step will be executed only if any of the previous step abnormally terminates
  • COND on EXEC statement (2/5)
    • Examples:
    • //STEP1 EXEC PGM=PROG1
    • //STEP2 EXEC PGM=PROG2, COND=(8,LT,STEP1)
    • The Condition “ COND=(8,LT,STEP1) ” is read as
    • “ Is 8 less than the RC of STEP1 ? “
          • If YES, then bypass STEP2
          • If NO, then execute STEP2
  • COND on EXEC statement (3/5) Example: //TXXXXXJ JOB ,,CLASS=A //STEP1 EXEC PGM=PROG1 //STEP2 EXEC PGM=PROG2, COND=(0,EQ,STEP1)
    • STEP1 executes with RC = 0
    • STEP2 does not execute
  • COND on EXEC statement (4/5) //TXXXXXJ JOB ,,CLASS=A //STEP1 EXEC PGM=PROG1 //STEP2 EXEC PGM=PROG2, COND=ONLY
    • STEP1 executes with RC = 0
    • STEP2 does not execute
    //TXXXXXJ JOB ,,CLASS=A //STEP1 EXEC PGM=PROG1 ( Doesn’t exist ) //STEP2 EXEC PGM=PROG2 //STEP3 EXEC PGM=PROG3, COND=ONLY
    • STEP1 abends with RC = *S806
    • STEP2 does not execute ( if a single step abends all other steps
    • are bypassed if no COND =EVEN or COND=ONLY statements are there )
    • STEP3 executes with RC = 0
  • COND on EXEC statement (5/5) Ex. 1 //TXXXXXJ JOB ,,CLASS=A //STEP1 EXEC PGM=PROG1 //STEP2 EXEC PGM=PROG2, COND=EVEN
    • STEP1 abends with RC = *S806
    • STEP2 executes with RC = 0
    Ex.2 //TXXXXXJ JOB ,,CLASS=A //STEP1 EXEC PGM=PROG1 ( Doesn’t exist ) //STEP2 EXEC PGM=PROG2 //STEP3 EXEC PGM=PROG3, COND=EVEN
    • STEP1 abends with RC = *S806
    • STEP2 does not execute (if a single step abends all other steps
    • are bypassed if no COND =EVEN or COND=ONLY statements are there )
    • STEP3 executes with RC = 0
  • COND on JOB & EXEC statement //TXXXXXXJ JOB (115710),’SMYTH’,COND=(7,LE) //STEP1 EXEC PGM=PROG1 //STEP2 EXEC PGM=PROG2,COND=(12,EQ,STEP1)
    • STEP1 executes with RC = 8
    • STEP2 will not Execute
  • IF statement Used for the conditional execution of JCL statements The syntax of the IF statement is: //name IF (Relational Expression) THEN JCL statements-executed if true //name ELSE JCL statements-executed-if-not-true //name ENDIF
  • IF statement Example //TXXXXXA JOB 2933100P,ABC,MSGCLASS=A,CLASS=A //STEP1 EXEC PGM=IEFBR14 // IF STEP1.RC GT 0 THEN //STEP3 EXEC PGM=IEFBR14 //DD1 DD DSN=TXXXXX.TRUE.PS,DISP=(NEW,CATLG), // VOL=SER=INUSR2, // SPACE=(TRK,(1,1)), // DCB=(LRECL=80,BLKSIZE=800,RECFM=FB) // ELSE //STEP4 EXEC PGM=IEFBR14 //DD2 DD DSN=TXXXXX.FALSE.PS,DISP=(NEW,CATLG), // VOL=SER=INUSR2, // SPACE=(TRK,(1,1)), // DCB=(LRECL=80,BLKSIZE=800,RECFM=FB) // ENDIF /* STEPNAME RC STEP1 00 STEP3 FLUSH STEP4 00
  • Errors
      • JCL syntax errors
          • JOB will not be submitted
    • JCL allocation errors
          • JES2-subsequent steps will not get executed
          • JES3-detects errors in the beginning
  • Review Questions
      • What are the various stages of JCL execution ?
      • INPUT,CONVERSION,EXECUTION,OUTPUT,HARDCOPY,PURGE
      • Which parameter is used to check the syntax of a JCL?
      • TYPRUN=SCAN
      • Which parameter is used to pass information from JCL to a COBOL program?
      • PARM
  • Summary
    • Introduction to JCL
    • JOB Statement
      • Syntax
      • Positional and Keyword parameters
    • EXEC Statement
      • Syntax
      • Positional and Keyword parameters
  • Thank You “ The contents of this document are proprietary and confidential to Infosys Technologies Ltd. and may not be disclosed in whole or in part at any time, to any third party without the prior written consent of Infosys Technologies Ltd.” “ © 2008 Infosys Technologies Ltd. All rights reserved. Copyright in the whole and any part of this document belongs to Infosys Technologies Ltd. This work may not be used, sold, transferred, adapted, abridged, copied or reproduced in whole or in part, in any manner or form, or in any media, without the prior written consent of Infosys Technologies Ltd.”
  • Appendix
  • Sample JCL Code : 3
    • //TXXXXXXJ JOB ,,NOTIFY=&SYSUID,CLASS=D,
    • // MSGLEVEL=(1,1),MSGCLASS=X
    • //*COMMENTS IN A JCL
    • //STEP1 EXEC PGM=<Program Name>
    • //STEPLIB DD DSN=‘OPERN.COBOL.LOADLIB’,DISP=SHR
    • //STEP2 EXEC PGM=<Program Name>
    • //STEPLIB DD DSN=‘OPERN.COBOL.LOADLIB’,DISP=SHR
    • //
  • Sample JCL Code : 4
    • //TXXXXXXJ JOB ,,NOTIFY=&SYSUID,CLASS=D,
    • // MSGLEVEL=(1,1),MSGCLASS=X
    • //*COMMENTS IN A JCL
    • //STEP1 EXEC PGM=<Program Name>
    • //STEPLIB DD DSN=‘OPERN.COBOL.LOADLIB’,DISP=SHR
    • //INFILE DD DSN=TXXXXXX.JCL.DAY1.FILE1,DISP=SHR
    • //OUTFILE DD DSN=TXXXXXX.JCL.DAY1.FILE2,
    • // DISP=(NEW,CATLG,DELETE),
    • // UNIT=SYSDA,SPACE=(TRK,(1,2),RLSE),
    • // DCB=(LRECL=80,BLKSIZE=800,RECFM=FB)
    • //
  • JES Subsystem
    • Functions
    • Enter job into system
    • Decide when job is to be processed
    • Pass job to Z/OS for processing
    • Deliver job’s output to correct destination
    • Types of JES Subsystems
    • JES2
    • JES3
  • Various stages of JCL execution
      • Input
      • Conversion
      • Execution
      • Output
      • Hard copy
      • Purge
  • INPUT
    • Job is placed in a series and entered through one input device form an Input Stream which is read by OS
    Input Stream Z/OS JES Card Reader Magnetic Tape Device Terminal DASD JCL Program I/O Device Input Stream
  • CONVERSION Z/OS JES The composite JCL is converted into internal text. Next, JES stores the internal text on the JES spool data set JCL Procedure PROCLIB JCL In Stream Data SPOOL
  • CONVERSION JOB INTERPRETER - JES JES ADDRESS SPACE INITIATOR ADDRESS SPACE PAY JCL INTERPRETER Interpreter reads the internal text and creates the control blocks required to allocate resources PAY CONTROL BLOCKS
  • JCL PROCESSING JCL SYSIN SYSOUT INITIATOR1 INITIATOR2 INITIATOR3 SPOOL JES2 / JES3 JES2 / JES3 PRINTER INPUT STREAM In the processing phase, JES responds to requests for jobs from the initiators. JES selects jobs that are waiting to run from a job queue and sends them to initiators
  • JCL Execution (1 of 2)
  • JCL Execution (2 of 2) JCL INITIATION STEP INITIATION ALLOCATION PROGRAM EXECUTION STEP TERMINATION JOB TERMINATION JCL SYSIN SYSOUT
  • Various stages of JCL execution (contd.)
    • OUTPUT
    • JES controls all SYSOUT processing
    • SYSOUT is system-produced output; that is, all output produced by, or for, a job
    HARDCOPY
    • JES selects output for processing from the output queues by output class, route
    • code, priority, and other criteria
    • When all processing for a job completes, JES releases the spool space
    • assigned to the job, making the space available for allocation to subsequent
    • jobs
    PURGE OUTPUT
  • Abend Failures
    • An ABEND failure occurs under the following conditions:
    • A program while executing, attempts to perform an instruction or operation which the system recognizes as being impossible or unacceptable.
    • Causes of Abend Failures:
    • Logic error
    • Resource unavailability
    • Exceeding limits (Time or Space on DASD)
    • Hardware Malfunction
    • User ABENDS
    • Operator intervention
    • Operating System failure