- Introduction
- Sorting
- Examples
Introduction:
To get acquainted with Job Control Language
JES manages: Job Entry to Queue Job Scheduling Job Processing Output from Job.
3 main types JCL statements are:
JOB Statements
[//jobname JOB (accountinginfo) Paramenters]
Jobname: Jobname is defined by the user or by installation at the site, has to be 8 or less than 8 character in length
JOB: Keyword that needs to be mentioned, to state that it’s a JOB statement.
Parameters: CLASS, MSGLEVEL,MSGCLASS,NOTIFY etc.
EXEC Statements
[//stepname EXEC PGM=job/proc parameters]
Stepname: User defined name given to the step. Should be 8 or less characters in length.
EXEC: Keyword that needs to be mentioned, to state that it is an execution statement.
Parameters: Parameters can be Time, class for execution etc. This will override the parameters set at job level for this step alone.
DD Statements
[//ddname DD parameters]
DDname: user defined/system defined name given.
DD: Keyword that needs to be mentioned, to state that it is a DD statement.
Parameters: DSN, DISP etc.
A proc starts with a proc name and proc keyword and followed by optional parameters.
[proc1 proc parameters]
IEFBR14: It is a dummy utility which does not do anything. It can be used to create or delete a dataset.
IEBGENER: It is used to copy non vsam dataset. It can copy to another non VSAM dataset on DASD or TAPE or to SYSOUT class. it copies SYSUT1 dd to SYSUT2.
SORT: Sorts records from one or more input dataset to one more output datasets. The instructions are given in SYSIN DD statement.
To get acquainted with Job Control Language
- Overview
- Structure and Statements
- Procedures
- Utilities
Overview:
Mainframe OS supports Online and Batch programing thru various services. In Mainframes a unit of work in is considers as job and most batch programs are written with intention to accomplish a work. JCL is used to execute batch programs and thus called Job Control Language. JCL is not an actual language rather instructions having instructions and details for running particular program. A simple JCL will contain details like, Job name , Job class, User account details, Program name, details about the resources required by the program etc. Job is managed by Job Entry Subsystem (JES).JES manages: Job Entry to Queue Job Scheduling Job Processing Output from Job.
Structure and Statements
Structure: A JCl always starts with the JOB Statement having Job Name, JOB keyword, accounting information and other job execution related parameters, followed by executions steps.3 main types JCL statements are:
JOB Statements
[//jobname JOB (accountinginfo) Paramenters]
Jobname: Jobname is defined by the user or by installation at the site, has to be 8 or less than 8 character in length
JOB: Keyword that needs to be mentioned, to state that it’s a JOB statement.
Parameters: CLASS, MSGLEVEL,MSGCLASS,NOTIFY etc.
EXEC Statements
[//stepname EXEC PGM=job/proc parameters]
Stepname: User defined name given to the step. Should be 8 or less characters in length.
EXEC: Keyword that needs to be mentioned, to state that it is an execution statement.
Parameters: Parameters can be Time, class for execution etc. This will override the parameters set at job level for this step alone.
DD Statements
[//ddname DD parameters]
DDname: user defined/system defined name given.
DD: Keyword that needs to be mentioned, to state that it is a DD statement.
Parameters: DSN, DISP etc.
Procedures
Procedure (also mentioned as proc) is similar to JOB, having only exec and dd statements with out JOB statement. Since this does not have job statement procs cant be submitted directly. Instead should be defined inside a job or called from a JOB. Proc which is defined inside a job is called inline proc and procs which defined separately and called from a job are called external procs.A proc starts with a proc name and proc keyword and followed by optional parameters.
[proc1 proc parameters]
Utilities
IBM provides lot of utilities (programs) for easy use. We will look into :IEFBR14: It is a dummy utility which does not do anything. It can be used to create or delete a dataset.
IEBGENER: It is used to copy non vsam dataset. It can copy to another non VSAM dataset on DASD or TAPE or to SYSOUT class. it copies SYSUT1 dd to SYSUT2.
SORT: Sorts records from one or more input dataset to one more output datasets. The instructions are given in SYSIN DD statement.
2 Sort Utilities are widely used in Mainframes they are 1.DFSORT 2. MFX (Syncsort)
Examples
To Migrate and Recall using TMPs.//HRECALL EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
HRECALL 'dsname1'
HMIG 'dsname2'
//*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//*
To Run a DB2 Program with Plan using TMPs.
//STEP01 EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(dsid)
RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) -
LIB('program load library')
END
//SYSIN DD *
REFRESH TABLE tablename;
No comments:
Post a Comment