1 / 55

JCL (Job Control Language)

JCL (Job Control Language). JCL or Job Control Language is used to communicate with the computer’s operating system. A JOB is a unit of work the computer is to perform.

Leo
Download Presentation

JCL (Job Control Language)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. JCL (Job Control Language)

  2. JCL or Job Control Language is used to communicate with the computer’s operating system. • A JOB is a unit of work the computer is to perform. • A JOB STREAM consists of JCL statements, programs that are to be executed, and data that are to be processed. The data included in the job stream are called INPUT STREAM DATA.

  3. JCL statements :- • JOB statement :- The first statement in a job stream must be a job statement whose function is to identify the job to the system. • EXEC statement :- The job statement is usually followed by an exec statement. The exec statement names the program or the procedure that is to be executed. • DD statement :- Following the exec statement are the DD statements (data definition) statements. The DD statements describe the data used by the program.

  4. The other JCL statements are delimiter, null, comment, proc & pend. • An EXEC statement and its DD statements make up a job step. • A job may consist of any no. of job steps. • The job, exec & DD statements have a common format which is :- //name operation operand comments

  5. JCL conventions on a Live Project • Job executes procedures, procedures have various steps to execute various programs, which use parameters and parameter files.

  6. Example JCL :-

  7. Naming conventions :-

  8. Jobs will be held in datasets with .cntl or .jcl extension e.g. ORSDEVP.REL#15.JCL Procedures will be held in datasets with .proclib or .proc extension e.g. ORSTEST.REL#15.PROCLIB Parameters used will be held in datasets with .parm or .parmlib extensions e.g ORSLIVE.REL#1.PARMS

  9. Parameters :-

  10. There are two kinds of parameters in the operand field :- positional and keyword parameters. • The operating system recognizes positional parameters by their position in the operand field. • Keyword parameters can be coded in any order. • positional parameters must be coded in a specific order before any keyword parameter.

  11. Positional parameters :- - e.g.. accounting information & programmers name. - accounting information must precede the programmers name. - if a positional parameter /sub parameter is omitted a comma must be coded in its place. Keyword parameters :- - e.g.. class & msglevel. - MSGLEVEL=(1,1) indicates print all the input JCL & the JCL from catalogued procedures & print all allocation messages. - TYPRUN=SCAN causes the job’s JCL to be checked for syntax errors & prevents the job from executing. Consider the job statement :-

  12. Controlling step execution - the COND parameter. • The COND parameter offers a method of testing the return codes issued by the previous steps to determine whether a step will be executed. • The format of a simplified version of the COND parameter is COND =(value,operator). • Value is a no. between 0 and 4095 and operator could be gt,ge,eq,ne,lt,le. • The COND parameter causes the value entered to be tested against the return codes from the previous steps, using the operator provided. • If the test condition is true,the step is skipped.If the test condition is false,the step is executed.

  13. Symbolic parameters :- • Symbolic parameters offer a convenient way of changing a procedure to fit your requirement. • Consider the example procedure-proglod, sysctl, sym,etc. are all symbolic parameters. • Symbolic parameter names may consist of from one to seven alphanumeric or national characters preceded by an ampersand. The first character however must be alphabetic / national. • Exec statement keyword parameters may not be used as names of symbolic parameters.For e.g.. &REGION. This restriction does not extend to DD statement keyword parameters.For e.g. &DSN can be used as symbolic parameter.

  14. Example procedure :-

  15. Linkage parameter :- • Linkage parameters are used in COBOL programs. • Linkage parameters are passed on to the COBOL programs through JCL by coding ‘parm=‘ parameter in the exec statement. • Whenever linkage parameters have to be used, Linkage section has to be coded in the COBOL program after the data division and the procedure division should specify the use of linkage section. • //DD400S01 EXEC PGM=DD400900,PARM='&PROCTYPE&DBNME&DICTNME'

  16. Generation Data Groups(GDG) :- • A generation data group is a collection,or group,of cataloged data sets having the same name and related to one another chronologically. Each of these datasets is called a generation data set or,simply, a generation. • Each generation data set is distinguished by others by the generation number. • The main advantage of using a GDG is that the same JCL can be reused without change. • Generation group index contains information on how many generations are to be retained and what to do when the index gets full.

  17. Defining a generation group index using IDCAMS :- • IDCAMS is the name of the access method services utility program that performs functions vital to the virtual storage access method(VSAM). • IDCAMS requires a region of 300K, a SYSPRINT DD statement for messages and a SYSIN DD statement for control statements. • The command format :-DEFINE GDG (PARMS).

  18. Define GDG parameters :-

  19. Creating and accessing a generation :- • The generation number may be relative or absolute. • If the DS name in the group is DDSNUS.DEVTDV.DD460302, then to access the current generation,you code DSN=DDSNUS.DEVTDV.DD460302(0). To access the previous generation, you code DSN= DDSNUS.DEVTDV.DD460302(-1) the generation before would be DSN= DDSNUS.DEVTDV.DD460302(-2). • If you want to create a new generation, you code DSN= DDSNUS.DEVTDV.DD460302(+1).

  20. The absolute no. used by the system is in the form GXXXXVYY,where xxxx is a generation no. from 0000 to 9999 and yy is a version no. from 00 to 99. • Thus the generation specified as DSN= DDSNUS.DEVTDV.DD460302(0) might appear to the system, for e.g.. ,as DDSNUS.DEVTDV.DD460302.G0006V00. Then the data set with a relative no. of (-1) would be DDSNUS.DEVTDV.DD460302.G0005V00, (+1) would be DSNUS.DEVTDV.DD460302.G0007V00.

  21. Deleting a generation group index using IDCAMS...

  22. Libraries :- • Another name for a library is a partitioned data set(PDS). • Libraries can be created,accessed & modified using utility programs like IEFBR14,IEBGENER,IEBPTPCH,IEBUPDTE, IEBCOPY,etc. • IEFBR14,IEBGENER & IEBCOPY are the most frequently used utilities on any project.

  23. IEFBR14 :- • Strictly speaking it is not a utility program because it does nothing. It clears register 15 and BR(branch) 14. • It is used to create or delete a library based on the DD statement parameters. • The following slide consists of an example of IEFBR14.

  24. IEBGENER :- • IEBGENER uses four data sets described by SYSPRINT, SYSIN, SYSUT1 & SYSUT2. • SYSPRINT is the DDNAME of the data set that IEBGENER uses to write messages. • SYSIN is the DDNAME of the data set that contains the control statements to tell IEBGENER how the input data set should be modified while it is being copied. • SYSUT1 is the DDNAME of the input data set that IEBGENER is to copy. • SYSUT2 is the DDNAME of the output data set that is to be created.

  25. Example of IEBGENER :-

  26. Note :- • The SYSOUT parameter :- sysout is a keyword parameter that assigns a data set to an output class. • The DUMMY parameter :- The sysin DD statement in the example contains the parameter dummy. Dummy is a positional parameter that indicates that the data set is not to be processed. • The * parameter :- The * is a positional parameter that indicates that input stream data follow immediately after the DD statement (if coded after sysut1 DD statement.). The delimiter statement, which has /* in column 1 & 2, indicates the end of input stream data.

  27. Note :- • Specifying ddnames in a program :- In a COBOL program the DDNAME is specified in the ASSIGN clause: ‘SELECT SALEFILE ASSIGN TO SALES’. The DD name would then be //sales DD .... • Temporary data set :- A temporary data set name consists of two ampersands(&&) followed by an unqualified data set name.

  28. IEBCOPY :- • IEBCOPY is a utility program that may be used to copy one or more members from an existing PDS to a new or existing PDS, to make a backup copy of a PDS, and to reorganize a PDS in order to reclaim the unused space

  29. DFSORT using JCL :- • Sorting means putting records in a data set into a specified order. • Merging is closely related to sorting;it means combining records from two or more sorted datasets into one data set that is in the same order. • The sort program requires three pieces of information:where to find the input data,which fields in the records to do the sorting on, and where to put the sorted output data set.

  30. Example of DFSORT :-

  31. The sort program expects its input to be supplied under the DDNAME SORTIN and writes its output under the DDNAME SORTOUT. • The DD statements SORTWK01 through SORTWK06 provide work areas for the sort program. • Sort program uses SYSOUT DD statement for messages. • SYSIN DD statement defines the control statement data set.

  32. Sort control statements :- The most commonly used sort control statements are SORT and MERGE. • A typical control statement would look like : SORT FIELDS=(1,10,CH,A). • The syntax for the fields parameter is FIELDS=(position,length,format,sequence...) or FIELDS=(position,length,sequence...), FORMAT=format. • Position is the starting byte of the control field in the record. Length is the length in bytes of the control field. Format is the format of the data in the control field.

  33. Commonly used values for format are ZD for zoned decimal, PD for packed decimal, BI for binary, AC for ASCII character, CH for EBCDIC character, AQ for EBCDIC character using alternative collating sequence. • Sequence is either A for ascending or D for descending. • The include & omit statements : The include & omit statements are used to select the records to be included in the sort. By selecting records for the sort, you can decrease the amount of time the sort requires.

  34. Only one include or omit statement is permitted in a sort. The syntax is include cond=(test) & omit cond=(test) • The only difference between include & omit is in the result. If test coded with include is true for a particular record,that record is included in the sort;whereas if test coded with omit is true,that record is omitted from the sort. • In either case test is coded as follows : test=(position,length,format,operator,value) • The position,length & format sub parameters specify a field in the record,just as in sort fields parameter.

  35. The operator sub parameter may be GT,GE,EQ,NE,LT & LE. • The last sub parameter, value, may be either a field in the record-specified by its own position, length & format, or a constant. • Numeric constants are coded as simple values, such as 15 or -20. Character constants are enclosed in apostrophes and preceded by a c,as in c’dec’. Hexadecimal constants are enclosed in apostrophes and preceded by an x,as in x’f1f2c3’. • If more than one test is coded, the tests are joined by the boolean operator AND or OR..

  36. A typical include statement would look like : INCLUDE COND=(29,1,CH,EQ,C’L’) The INREC & OUTREC statements : These statements are used to reformat the records. • The INREC statement is used before sort to shorten the records by eliminating unwanted fields. This results in faster sorting. • The OUTREC statement is used after the sort to improve readability. • INREC & OUTREC have identical formats: INREC FIELDS=(nX,position,length,align,...) OUTREC FIELDS=(nX,position,length,align,...)

  37. The first sub parameter,nX,is optional; it specifies the no. of spaces to be inserted in the reformatted record. • The next two parameters, position & length, specify the field in the input record. • The third sub parameter, align, is optional; the possible values being H, F, and D specify alignment on a half-word, full-word, and double-word boundary respectively.

  38. Merging :- • When you merge, you start with two or more sorted data sets and create a new data set that is in the same sorted order. • While merging you must specify more than one input data set. These data sets have the DD names SORTINnn, where nn may range from 01 to 16. • SKIPREC & EQUALS / NOEQUALS options are not used on the merge statement. • The sort control statements are normally coded in a parameter file.

  39. Example of sort control statements :-

More Related