Mainframe material

17
JCL (JOB CONTROL LANGUAGE) JCL (JOB CONTROL LANGUAGE) MVS CONCEPTS (Multiple Virtual Storage) In IBM Mainframe environment to create and edit files using ISPF (Interactive System Productive Facility). JES2 (Job Entry Schedular2). It is an MVS subsystem, installation is mandatory in order to implement input, output, spooling and printing. It is a Decentralized Environment (JES2) JES3(Job Entry Schedular3). It is an Installation is mandatory and it is a centralized environment there is a global process which controls all the other processors and assigns the jobs to them. MVS/XA (Multiple virtual storage / Extended Architecture). Stands for multiple virtual storage/Extended Architecture. It is an IBM operating subsystem that supports 2 Gigabytes (GB) of address space. MVS/ESA (Multiple Virtual storage / Enterprise System Architecture) It is an IBM operating subsystem that supports additional address space for data. It is an extension of mvs/xa. Ω 24 GB. ABEND It is an abnormal situation that occurs during the execution of a program AMS (Access Method Services) It is an IBM Services utility program used in creation and multiplication of Vsam and non-Vsam datasets. Allocations

Transcript of Mainframe material

Page 1: Mainframe material

JCL (JOB CONTROL LANGUAGE)

JCL (JOB CONTROL LANGUAGE)

MVS CONCEPTS (Multiple Virtual Storage)

In IBM Mainframe environment to create and edit files using ISPF (Interactive System Productive Facility).

JES2 (Job Entry Schedular2).It is an MVS subsystem, installation is mandatory in order to implement input, output, spooling and printing. It is a Decentralized Environment (JES2)

JES3(Job Entry Schedular3).It is an Installation is mandatory and it is a centralized environment there is a global process which controls all the other processors and assigns the jobs to them.

MVS/XA (Multiple virtual storage / Extended Architecture).Stands for multiple virtual storage/Extended Architecture. It is an IBM operating subsystem that supports 2 Gigabytes (GB) of address space.

MVS/ESA (Multiple Virtual storage / Enterprise System Architecture)It is an IBM operating subsystem that supports additional address space for data.It is an extension of mvs/xa. Ω 24 GB.

ABENDIt is an abnormal situation that occurs during the execution of a program

AMS (Access Method Services)It is an IBM Services utility program used in creation and multiplication of Vsam and non-Vsam datasets.

AllocationsIt requests for space on DASD (Direct Access System Device) it is a magnetic storage Device.

DiskIt is device that contains read, write and heads and some electronic devices (components)

TrackIt is a predefine path on DASDDatasetIt is a unit of storage information that can be read from (or) written to.

Primary SpaceIt is a space used when dataset first created on DASD

Page 2: Mainframe material

Secondary SpaceThis is a spaced defined on DASD that is allocated space allocated is used up.I.e. when primary space is used up then we allocate secondary space.

VTOC (Volume Table of Content)It is a group of records that contains dataset names, attributes of each datasets on DASD.

JCLJob Control Language is used to define and control job to the o.s

Define: Definition Involves the programs need to be executed, the data for the program and the sequence of program.

Control: Control Involves the execution (or) bypassing of a program in the sequence based on the results of the prior program execution.

(Or)

Def JCL: - It is an Interface between Operating System and Batch Jobs. Def CICS: - It is an Interface between Operating System and Online process.

JCL Coding Sheet

123 11 16 72 80// Name Field Operations Operands Comments

JCL statement should start with Two Forward Slashes (//) in Column 1 and 2.

* In the third column indicates the line is to commented its Optional one when ever we need we use that for commenting other wise we use column 3 for Job Name purpose

Name FieldIt is an optional field if coded it should start from column 3 and can have maximum 8 characters (including characters alpha-numeric and national characters are allowed in this name field e.g. LVS003A, XVNXS, etc)

NOTE: First Character must be Alphabetic (or) National Symbol but not a numeric Number.

3 to 8 character is used for Job Name

Page 3: Mainframe material

E.g.

//Lvs003A //#abc/o //@abc05 //@1234abcd wrong exceeds more than 8 characters long.

Operations:-An operation follows the name field and there should be at least one space between name field and operation. If name field is not coded then operations starts with the fourth column

Operation fields can be Job, Exec, DD statements.

Operands: -Operands are the parameters for the operations operands follow operation and their should be at least one space between them a comma separates parameters and their should not any space between parameters if the operands are more than they can be continued in the next line to continue current line. End the current line before 72 withA comma and start the next line any where between the columns 4 to 16.

e.g.

//3 TO 8 11 TO 14 16 71 72 80//NAME OPERATIONS OPERANDS COMMENTS//Lvs003A JOB <POSITION/KEYWORD PARMETERS>

Basic JCL Statements

1. Job Statement.2. Exec Statement.3. DD Statement. (Data Definition Statement).

1. Job Statement

JOB:- It is a unit of work it has to be executed and it contains several JCL statements that instruct the operating system so it defines the job parameters.

Syntax: -

Page 4: Mainframe material

//Job name Job <positional/keyword parameters>

This is very first statement in any JCL segment it identifies the beginning of a job to the operating system.

If the statement is missing the O.S will be unable to execute the Job.

Job Name: -

It must start from column no: 3 and immediately following the double slashes.

Rules for coding: -

Valid names can be 1 to 8 alpha-numeric character in length and special symbols can also be included in the name.

The first character of the name must be Alphabetic (or) National.It cannot be a numeric.

1. Valid names can be//@A1234//A123452. Invalid Names//123ABC//ABC123456 (exacting more than 8 char).

Operands: -

Operands can be divided into 2 types.1. Positional Parameter (mandatory Parameter)2. Keyword Parameter ( optional Parameter)

1. Positional Parameters ( Mandatory Parameter).The following 2 positional parameters will be Describe as.

a. Job Accounting Information parameter ( account no, additional account information)

b. Programmer Name parametera. Job Accounting Information ParameterSyntax: - Job Accounting Information (account number, additional Account information)

ACCNT=(X, Y)

X = ABC123 i.e. Account numberY = save A/c (or) current A/c i.e. Additional accounting information.

Page 5: Mainframe material

b. Programmer Name Parameter (or) Program Functionality.A Group can be mentioned also it is used for Documentation.A maximum 20 characters allowed. I.e. a programmer name can not exceed more than 20 characters.

2. Keyword Parameter(Optional parameter)It must follow positional parameters these are

1. Class2. Priority 3. Condition4. Region5. Time6. Restart

1. Class Parameter:- Class Parameter assigns what is known as job class.A job class it identifies the nature of a job that is to be submitted.Syntax: - Class = Job Class (A-Z (or) numbers b/w 0 to 9)

Nature of the job in the sense month, year, week daily etc information.

2. Priority Parameter: - It is related to the class parameter it assigns priority to the jobs which belongs to the same class name.Syntax: - Prty= 0-15

If the job is coded with 0 it is lowest priorityIf the job is coded with 15 it is assigned a highest priority.

E.g. //Lvs003A job1 accnt= (A123, Savings), pgm name=’srinivas’, Class=6, prty=8

//Lvs003A job2 accnt= (B345, Current), pgm name=’meghansh’, Class=6, prty=14

Note: - Job2 has to be executed before job1 both has to be same class parameter First job2 will execute because it has higher priority than job1.

3. Message Class: - It determines the o/p devices to which the system messages and JCL messages are written.Syntax: - MSGCLASS = Output Devices name

Range from A-Z (or) 0-9.4. Message Level: -

This Parameter is used to specify the JCL and allocation messages which will be recorded on the o/p devices specified a message class parameter.

Page 6: Mainframe material

MSGLEVEL = Statements, Messages

MSGLEVEL= stmts (or)MSGLEVEL= (, stmt) Where stmts may be 0, 1, 2 and messages is values which can be 0 are 1.

STMTS MESSAGES0 01 1

2

Coding ‘0’ in stmt will results in the messages related to the Job Statement only be outputted.

Coding ‘1’ will result in all JCL in the Job being output in addition to it if any cataloged procedures are invoked (called) then the JCL also be output.

Coding ‘2’ will result in only the output JCL statements are printed.

Message field ‘0’ will result in only in allocation and termination of messages being o/p if the job terminates abnormally. Coding ‘1’ will result in all allocation and termination messages being o/p regardless of whether the job terminates normally (or) abnormally. If this parameter is not coded then all messages will be o/p if it is coded specific o/p will be requested.Default message level = (1, 1), msglevel= (1, 1)

5. Type Run

It is used to specify the type of a job processing such as whether its execution is suppressed all together.

Syntax: - Type run = Hold Type run = Scan

Type run =Hold Results in the job being held until further notice has been received from the terminal.

This parameter is useful when jobs which utilize a lot of resources to be held until a time when the system is relatively unused.

Type run = Scan

Page 7: Mainframe material

This specifying the scan parameters results in the JCL being scanned for syntax Errors and reports them for requested o/p media.

Def Type run = scanScan is a keyword parameter which can be used to check syntax errors of the jcl program.

e.g. Type run = scan/run.

Other wise there is a command with out running a job we can check the syntax error of a jcl by using the following command.

Command JCK! / JSCAN / JEMAre system defined commands which are used to check the

syntax error of JCL with out running a job.

In TSO/ISPF Command Prompt Panel type: JCK! JEM (or) JSCAN

2. EXEC (Execute Statement)

Syntax: - step name Exec Pgm= COBOL program name

e.g.

//Lvs003A JOB Notify=&sysuid, class=8, prty=6, msgclass=A, Msglevel= (1, 1) //step1 EXEC Pgm=COBOL program name//3 to8 11 to 14 16 to 71 72 to 80 //name field Operations Operands Comments //Job name Job <position/keyword>parameters

//Step name EXEC <position/Keyword>parameters

Keyword Parameters:-

It defines the step and step level information to the system a max of 255 execute steps(Or) statements can be specified with in a single Job.

In 1 JOB no more than 255 job steps (or) Exec statements can be coded.

Step name: - (step1 (or) any thing can be coded).

Page 8: Mainframe material

It is an optional field it is needed if we want to restart a job from, this step and for the same reason it should be unique with in the job.Step name must consist of 1-8 alphanumeric 0-9 national characters.

Where as Step name first character must be Alphabetic (or) national character.It must be coded in column 3 immediately after 2 slashes.

Positional Parameters of an Exec Statement PGM is an positional keyword parameters of an exec statement. It codes the pgm name (or) proc name to be invoked.

The program name specified in the program parameter. Must exist either in the system.

Libraries are of 2 types 1. Temporary library 2. Private library.

1st Priority given to private library2nd priority given to temporary library3rd priority given to system library

The program must be a member of a partitioned data set.

Position Parameter of EXEC Statement:Pgm = indicates the name of the COBOL program / utility of IBM.

a. Accounting informationUsed to supply the account information for job statement it is an optional parameter. The max no of characters that can include in accnt information including command is 142.b.ParmIt is used to supply the information to our program as it is executes.

PARM = Value

Value = is a string from 1 to 100 characters long.

If a string contains special characters it must be enclosed with in single codes ‘ ‘Parameters.

If the String is consists of several substrings then separated by comma (,).

And entire string must enclose with in a parenthesis (or) codes.

c. Address Space

Page 9: Mainframe material

It is used to indicates to the system that the job step is used either Virtual (or) Real Storage.

Syntax: - Addrspc = Virt (or) Real

d. D-priority

Used to assign a dispatching priority to a job step it is used by the system to determine the order in which tasks are to be executed.

Syntax: - D-Priority = Value n * 16 + Value 2.

Dprty = value n * 16 + value 2.

Value 1 range from 0-16.Value 2 ranges from 0-16.

e. PerformIt is used to specify the perform group for the Job step.

Syntax: - Perform = N (where N from 1 – 999)

f. RD (Restart Definition)It is used to specify the automatic restart of a job level if it is Abends.

Syntax: - RD = RRD = RNCRD = NRRD = NC

The advantage of check point is if a job is abended it can be restarted from the last check point rather than from beginning of the Run (or) point. Beginning of the job itself.

Where R stands for restart RNC = Automatic Restart but no check point is suppressed.NR = Automatic Restart is suppressed but the check point macro is not.NC = No Check points.

Common Abends

1. SB37Its an ABEND occurs when there is no space in primary and secondary available Block end.

2. SD 37No secondary space available (or) no free space in directory block.

Page 10: Mainframe material

3. SE 37No more volumes available (or) no free space in allocated dataset again to reallocate the dataset.

Common Parameters for JOB Statements and EXEC Statement are: -

1. Cond Parameter(condition)2. Region Parameter3. Time Parameter

1. Cond Parameter (condition) Is to specify the condition for Job and execute statement whether to terminate or execute a job or job step.

If the cond parameter is coded on the job statement as well as in the exec statement Then the specification on the job statement nullifies the specification on the execute statement.

The cond parameter is used to control the execution of subsequence job steps depending on the condition code that is returned for a prior step.

Syntax: - For Job Statement

COND = (value, Operator) (or)

(Comparison code, condition)

Syntax: - For Exec Statement

(Comparison code, Condition, Step name)

Here comparison code Ranges from 0 – 4095Operators (or) condition include GT (Greater than)GE (Greater then or Equal to)EQ (Equal to)NE (not equal to)LE(less than or equal to)LT(less than)

GT (Greater than):-

By pass the current step is comparison code is Greater then that of Return Code.

Page 11: Mainframe material

Cond = ONLY

Only is used to specify a particular step is to execute only if prior step terminates abnormally.

Cond = EVEN

It is a keyword used to specify a particular step is to execute even if any one of the previous steps terminated abnormally.

We cannot code both ONLY and EVEN COND for a same Job Step

2. Region Parameter

It’s an optional keyword parameter at the time a job is run a default amount of workspace is automatically assigned to it; this can be overwriting by the region parameter.

Syntax: - Region = NK (kilo bytes) 1K where N = 1.Region= NM (Mega bytes) 1M

Region = Value 1KRegion = Value 2M

If region is specified in K format it should be specified as an Even no (K = even)

If we specified in M format even and odd no can be specified (M =Even & odd Number)

If Region is coded on both Job Statement and Exec Statement the region specification on Job statement will over write the exec statement.

SOC1It means operational exceptional cases (or) miss spelled DD names (or) trying to readA File which was not opened

SCO2Period is missing at the end of a paragraph

SOC3Logical error

SOC4Protection error. (Or) trying to read a file which was not opened.

Page 12: Mainframe material

JOB LIBJob Lib is a system defined library / Data set which can be used to locate the all object programs which are specified the Job.

The Job lib statement immediately follows the Job statement.It is a DD statement and it specifies where the program that is specified by the Execute statement resides.The same job lib statement can apply to all sub sequent execute statement.

It Must precede the Exec i.e. Execute Statement.It cannot be used in Catalog Procedure.____________________________________________________________________//Job name Operations Operands comments

//LVS003A JOB Notify = & sysuid//JOB LIB DD DSN = Lvs003A.srinivas.load1, Disp= shr//Step1 EXEC Pgm = COBOL pgm1//Sysprint DD Sys out = *//Sysout DD Sysout = *//Step2 EXEC Pgm = COBOL pgm 2//Sysprint DD Sys out = *//Sysout DD Sysout = *//Step3 EXEC Pgm = COBOL pgm3//Sysprint DD Sys out = *//Sysout DD Sysout = *

Joblib must be coded after Job statement Note: - No more then 255 Job steps (or) Exec statements can be coded in 1 Joblib.

Joblib searches for the system library i.e. it first search for private library and next temporary library and then system library.