Mainframe Forum: A comprehensive repository for programming tutorials and technology news. Got a minute? Click upon those blue words to start learning in Cobol, DB2, CICS, JCL, CA7, APIs, DevOps, Agile, JAVA, SORT, Excel macro, python, and mainframe tools.
As you might be aware, JES2 and JES3 can be used to manage a multiprocessor network that consists of more than one system.
In a multiprocessor network, each system operates under the control of its own copy of OS/390 or ZOS.
However, the JES components of each processor’s operating system are connected in various ways to the JES components of the other processors, and a common spool is used to service all the processors in the network.
IBM Mainframe Architecture
As a result, JES2 and JES3 can control how jobs are processed by the systems within the multiprocessor network.
The term system affinity can be used to describe the relationship between a job and the system on which it executes.
Under JES2, you use the SYSAFF parameter of the /*JOBPARM statement to specify system affinity.
Under JES3, you use the SYSTEM parameter of the //*MAIN statement.
The global processor is the processor that’s in charge of the entire network. A local processor is one that’s controlled by the global processor.
The syntax for the SYSAFF parameter of the JES2 /*JOBPARM statement
SYSAFF= {*} {(system-name,…)} {ANY}
Explanation
*
The job will run on the system that reads it (the default).
system-name
A one- to four-character system-id defined in the multiprocessor network that identifies which processor will run the job. If more than one system-name is specified, the job can run on any one of the processors listed.
ANY
The job can run on any available processor.
The syntax for the SYSTEM parameter of the JES3 //*MAIN statement
A system-id defined in the multiprocessor network that identifies which processor will be used to run the job. If more than one main-name is specified, the job can run on any one of the processors listed.
/
The job can run on any processor except the one(s) listed.
Welcome back to another interesting JCL Tutorial on "IEHLIST" in JCL. In this session, you'll learn the basics of the IEHLIST utility. You'll also go through the IEHLIST examples to understand how the IEHLIST utility is used to list entries?
The term JCL stands for Job Control Language. Job Control Languageis the command language of the IBM z/OS. JCL defines a job by furnishing information that distinguishes the programs to be executed and the data to be processed. JCL tells the operating system what to do.
What is IEHLIST Utility?
JCL IEHLIST Utility
Utility programs are pre-written applications, generally used in IBM Mainframes by system programmers and application developers to perform day-to-day maintenance tasks.
IEHLIST utility in JCL is another important system utility popularly used in Mainframe. It is generally used to list entries in the directory of one or more partitioned data sets or PDSEs, or entries in an indexed or non-indexed volume table of contents.
Any number of listings can be requested in a single execution of the program.
Let's focus on JCL IEHLIST Utility in JCL Examples.
Example 1: List Partitioned Directories Using DUMP and FORMAT.
In this IEHLIST utility example, the directory of a PDSE is listed. In addition, the directories of two partitioned data sets that reside on the system residence volume are listed.
DD1 DD statement defines the system residence device.
DD2 DD statement defines a device on which a disk volume (333222)
is mounted.
SYSIN DD statement defines the control data-set, which follows in the input stream. The first IEHLIST LISTPDS statement indicates that the PDSE
directory belonging to data set RC42.PDSE1.FLE is to be listed. The listing is in unedited (dump) format. This data set resides on volume 222222.
The second LISTPDS statement indicates that partitioned data set directories belonging to data sets RC55.PART1 and D55.PART2 are to be listed. The listing is in an edited format. These data sets exist on the system residence volume.
Example 2: List
Non-indexed Volume Table of Contents [IEHLIST listvtoc]
In this example, a
non-indexed volume table of contents is listed in the first edited format. The
edited listing is supplemented by an unedited listing of selected data set
control blocks.
Finally, this marks the end of today's IEHLIST in JCL Tutorial. JCL IEHLIST is an IBM-supplied utility that is used for list entries. You can also include IEHLIST from Rexx. Do check out our mainframe blog for more tutorials on REXX. JCL, COBOL, etc.
►Subscribe to Topictrick & Don't forget to press THE BELL ICON to never miss any updates. Also, Please visit mention the link below to stay connected with Topictrick and the Mainframe forum on -
IEBGENER Utility in JCL is an easy way to copy, print, and create non-VSAM datasets. The IEBGENER utility is used to copy multiple files or copy a single file. In this session, you'll learn the basics of the IEBGENER utility, followed by IEBGENER DD control statements and the IEBGENER SYSIN control statements. To reinforce your understanding, I will walk you through the IEBGENER examples. Let's get started with an introduction to the IEBGENER utility.
IEBGENER Utility Tutorial - Agenda.
Introduction.
IEBGENER DD Statements/IEBGENER SYSIN Statements.
IEBGENER Vs IEBCOPY utility.
IEBGENER Examples.
IEBGENER in JCL - YouTube video.
Conclusion.
Introduction.
Let's try to answer or let's try to understand what is JCL utility or what do you understand by the term utility. In layman terms, mainframe utility programs or just utilities are the programs that can be used for common data processing functions like copying or printing a data set these utilities are supplied with IBM z/OS and they're widely used in batch jobs now let's talk about IEBGENER utility.
What is the IEBGENER Utility in JCL?
IBM IEBGENER Utility.
IEBGENER utility in JCL, it is a popular mainframe utility. IEBGENER utility is a copy program that has been a part of the operating system since the first release of OS/360 and one of its many uses is to copy a sequential data set a member of partition data set (i.e. PDS) or PDSE or probably z/OS Unix system services files such as HFS files.
As a result, the IEBGENER utility is used can be used to backup or restore sequential data sets you can also use this utility to print a non-VSAM sequential data set by copying it to an SYSOUT data set. Finally, the common use of IEBGENER utility is to create, reformat, and backup non-VSAM sequential data sets
You can use IEBGENER to perform the following daily tasks:
IEBGENER utility in the JCL is used to create a backup of the sequential data set.
IEBGENER utility can be used to print a non-VSAM sequential data set.
IEBGENER utility can be used to rearrange fields and convert their data formats.
IEBGENER utility can amplify an existing partitioned data set (PDS).
IEBGENER utility can change or re-block the data set record logical length. Copy user labels on sequential output data sets.
The following figure, explains the process of creating partitioned data set from sequential data et. The sequential dataset is represented by the left section of the figure.
The IEBGENER utility statement is used to split a sequential dataset into logical record groups. Finally, the right section of the fig represents a partitioned data set.
IEBGENER Utility Creating PDS sequential data set.
IEBGENER DD Statements and IEBGENER SYSIN control statements.
Now, let's try to understand what are the different DD statements that are required by an IEBGENER utility. There are four different DD statements that are required by an IEBGENER utility.
JCL IEBGENER Utility DD Statement.
SYSUT1 - it's used to specify the input file.
SYSUT2 - it's used to specify the output file.
SYSPRINT - it's an output message file.
SYSIN - it's used to specify the control parameters.
Important point - If you do not want to use a control statement the SYSIN DD statement is still required. You must code it as a dummy data set.
What is the difference between IEBGENER utility and IEBCOPY utility (iebgener vs iebcopy)?
Well, the correct answer is that both utilities are used for data processing. However, the IEBGENER utility is used for the non-VSAM sequential data sets. It's used to copy, create print or reformat data set as you copy.
IEBCOPY utility in the JCL is primarily used to perform the operation on a personal data set (PDS) or PSDE. It's used to copy, merge, compress, or archive a PDS into a sequential file.
IEBGENER Example - Sample JCL to invoke the IEBGENER utility (iebgener syntax).
The following IEBGENER JCL example illustrates the use of the IEBGENER utility to copy multiple files or to copy PDS members. Let's discuss each step one by one.
//TPRCK99AJOB'TOPICTRICK',MSGCLASS=A,CLASS=C,
//MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*
//* PROJECT DESC:: SAMPLE JCL TO INVOKE IEBGENER UTILITY.
//* STEP04 - IEBGENER example to Reformat data while copying the data.
//* - How to use IEBGENER Generate and Record field.
//*
//STEP04EXECPGM=IEBGENER
//SYSUT1DDDSN=Z03130.INPUT.FILE,DISP=SHR
//SYSUT2DDDSN=Z03130.INPUT.FILE.BKP,DISP=OLD
//SYSPRINTDDSYSOUT=*
//SYSINDD *
GENERATE MAXFLDS=11,MAXLITS=10
RECORD FIELD=(23,1,,1),FIELD=(8,'EMP SAL-',,24), X
FIELD=(4,24,,32)
/*
//
Created with Artisteer
IEBGENER utility in JCL - YouTube Video.
Conclusion.
Finally, this marks an end to the JCL IEBGENER Utility tutorial (JCL Utility). In this tutorial, you learn the basics of IEBGENER utility and the use of IEBGENER utility. Also, you learned how to use the IEBGENER utility in JCL. Do check out COBOL LEVEL 88 Condition.
►Subscribe to Topictrick & Don't forget to press THE BELL ICON to never miss any updates. Also, Please visit mention the link below to stay connected with Topictrick and the Mainframe forum on -
The IF/THEN/ELSE/ENDIF statement construct provides a simple meaning of selectively executing jobs steps and eliminates the need to struggle with the COND parameter.
The IF statement is always followed by a relational-expression and a THEN clause. Optionally, an ELSE clause can follow the THEN clause. An ENDIF statement always follows the ELSE clause, if present, or the THEN clause.
The THEN clause specifies the job steps that the system processes when the evaluation of the relational-expression for the IF statement is a true condition. The system evaluates the relational-expression at execution time.
The ELSE clause specifies the job steps that the system processes when the evaluation of the relational-expression for the IF statement is a false condition.
The ENDIF statement indicates the end of the IF/THEN/ELSE/ENDIF statement construct and must be coded for each construct.
You can nest IF/THEN/ELSE/ENDIF statement constructs up to a maximum of 15 levels. The steps that execute in a THEN clause and an ELSE clause can be another IF/THEN/ELSE/ENDIF statement construct.
You code the construct as follows:
//[name] IF [(]relational-expression[)] THEN [comments]
. . action when relational-expression is true
//[name] ELSE [comments]
. . action when relational-expression is false
//[name] ENDIF [comments]
The IF statement consists of the characters // in columns 1 and 2 and the five fields: name, operation (IF), the relational-expression, the characters THEN, and comments.
The relational-expression can be enclosed in parentheses.
The ELSE statement consists of the characters // in columns 1 and 2 and the three fields: name, operation (ELSE), and comments.
The ENDIF statement consists of the characters // in columns 1 and 2 and the three fields: name, operation (ENDIF), and comments.
Exmple : 1
// IF RC > 4 THEN
You can continue relational-expressions on the next JCL statement. Break the relational-expression where a blank is valid on the current statement, and continue the expression beginning in column 4 through 16 of the next statement. Do not put comments on the statement that you are continuing. You can code comments after you have completed the statement.
Example : 2
//TESTCON IF (RC = 8 | RC = 10 | RC = 12 |
// RC = 14) THEN COMMENTS OK HERE
.
.
A relational-expression consists of:
Comparison operators
Logical operators
NOT (¬) operators
Relational-expression keywords.
Example : 3
// IF (STEPA.RC GE 1 AND STEPA.RC LT 4) THEN
//STEP010 EXEC PGM=EMP001 {system execute this step for RC 0 to 4}
// ELSE
//STEP020 EXEC PGM=EMP002 {system execute this step for RC > than 4}
Job Control Language (JCL) is used to tell the system what program to execute, followed by a description of program inputs and outputs. It is possible to submit JCL for batch processing or start a JCL procedure (PROC), which is considered a started task.
The details of JCL can be complicated but the general concepts are quite simple. Also, a small subset of JCL accounts for at least 90% of what is actually used.
Job control language (JCL) is a set of statements that you code to tell the z/OS® operating system about the work you want it to perform.
Although this set of statements is quite large, most jobs can be run using a very small subset. Below is list of important command.
Welcome to today's JCL tutorial on "JCL Procedure". In this session, you'll learn the basics of the JCL procedure, and how to code procedures in JCL. You'll also learn the type of JCL procedure i.e. Instream Procedure or Catalog procedures. Also, you will learn various IBM-supplied complex catalog procedures that let you interface easily with software products like compilers, CICS, and DB2, and you’ll use them all the time. So, let's start with the JCL Procedure tutorial agenda.
Procedures in JCL - Agenda.
What is the JCL procedure?
Advantage of JCL procedure.
Catalog procedure in JCL.
Instream procedure in JCL
What is JCL Procedure?
A JCL procedure (or just procedure in JCL) is a pre-written segment of code. JCL procedure consists of one or more job steps that you can include in a job stream (i.e. JCL). JCL procedures is divided into the following type:
Catalog Procedure in JCL.
Instream Procedure in JCL.
Now, let's discuss the advantage of procedure mainframe JCL's.
Advantage of procedure in JCLs.
The major advantage of procedure in JCL's is code reusability and code maintainability. By using procedures, the amount of JCL coding you have to do is reduced, resulting in fewer coding errors and greater productivity. Although you can code a JCL procedure directly in a single job stream, you’re more likely to invoke cataloged procedures that are available throughout an installation.
The syntax for invoking a JCL procedure
EXEC [PROC=]procedure-name
Note: The procedure name Identifies the procedure to be called and executed. For cataloged procedures, it’s the member name of the procedure. For instream procedures, it’s the name on the PROC statement that begins the procedure.
For example: In the middle of the below code, you can see the JCL statements that make up a cataloged procedure named XMP3000. This procedure consists of two job steps that execute the programs XMP3000 and allocate seven different data sets.
//RC01TN JOB (99992),'MAINFRAME',NOTIFY=MMTX01
//STEP01 EXEC XMP3000
//
Let's discuss the different JCL procedure categories i.e. CATALOG PROCEDURE and INSTREAM PROCEDURE.
What is CATALOG Procedure?
A cataloged procedure in JCL is a series of JCL statements that are stored in a partitioned data set and may be invoked by any job on the system (i.e. z/OS system). Whenever you invoke a cataloged procedure, the system looks for it in the system procedure library, SYS1.PROCLIB, unless you specify the library.
Although the PROC statement can be coded as the first statement in a cataloged procedure, it’s not required.
Example: CATALOGED PROCEDURE in JCL.
The cataloged JCL procedure named EMP3000 is invoked
A mainframe job (i.e. JCL) that invokes a cataloged procedure in JCL.
//RC01TN JOB (99992),'MAINFRAME',NOTIFY=MMTX01
//STEP01 EXEC EMP3000
//
What is INSTREAM PROCEDURE?
An instream procedure consists of a PROC statement, any number of procedure steps, and a PEND statement. Then, you place the instream procedure near the beginning of your job stream, before any EXEC statement that refers to it. In contrast to a cataloged procedure, an instream procedure is available only to the job that contains it.
A name is always required on the PROC statement for an instream procedure. You can also specify a name on the PEND statement, but it’s optional.
JCL statements falling between the PROC and PEND statements are not executed when first encountered. Instead, they’re scanned for errors and retained as a temporary procedure.
Any JCL statements after the PEND statement are recognized as normal statements and are executed.
An instream procedure should be placed near the beginning of a job stream, before any EXEC statement that refers to it. The maximum number of instream procedures you can code in any job is 15.
Important Point: Before cataloging a procedure in a procedure library, it’s usually a good idea to test the JCL code it contains, and the easiest way to do that is with an instream procedure.
Youtube: Catalog procedure in JCL and Instream procedure in JCL.
The JCL Procedure tutorial is associated with a youtube video for good understanding. Please do watch this video and consider subscribing to our channel for more such tutorial video!
SYMBOLIC PARAMETER in INSTREAM DATA.
To code a symbolic parameter in a procedure, you use a name that starts with an ampersand (&). The name can be any meaningful name you want as long as it isn’t a keyword parameter on an EXEC statement. For example, &TIME or ®ION would not be valid names because both are keyword parameters on an EXEC statement. But &SPACE and &CLASS are acceptable names.
You can use the same symbolic parameter in a procedure as many times as you like. For example, you can use a symbolic parameter called &CLASS as the value for the SYSOUT parameter in all of the SYSOUT DD statements in a procedure. That way, you can be sure that all SYSOUT data sets are processed using the same output class. If you need to assign different classes to the SYSOUT data sets, however, you have to use more than one symbolic parameter.
The syntax for assigning values to symbolic parameters in a procedure
Rules for coding symbolic parameters in JCL statements
You can use the same symbolic parameter in a procedure as many times as you wish.
Symbolic parameters can be mixed with text to form a final parameter value.
If you want text to appear immediately after a symbolic parameter, you must code a period (.) as a delimiter between the symbolic parameter name and the text that follows it.
If you want a period to appear immediately after a symbolic parameter, you have to code two periods in a row. The first one acts as a delimiter marking the end of the symbolic parameter and the second one becomes part of the JCL statement.
To nullify the value of a symbolic parameter, you code the symbolic parameter’s name followed by an equals sign without a value.
SET Parameter in JCL with example.
The SET statement is another way to assign values to symbolic parameters. In contrast to a PROC statement that assigns default values or a procedure-invoking EXEC statement that provides runtime values, the SET statement lets you set the values of symbolic parameters at any point or time within your JCL. Be aware, however, that SET values are overridden by any values that are assigned in subsequent PROC or EXEC statements in the job.
The syntax for the SET statement
//[name] SET symbolic-parameter=value[,symbolic-parameter=value]…
Note - The name of a symbolic parameter you want to assign a value to.
The JCL Symbolic Parameter tutorial is associated with a youtube video for good understanding. Please do watch this video and consider subscribing to our channel for more such tutorial video!
Summary.
As you code JCL, you’ll discover that there are many job steps…and series of job steps…that are used over and over in an installation, often by different programmers. That’s why OS/390 provides for procedures that can be stored in libraries and made available to any programmer on the system. With this facility, you can usually code just a few JCL statements to execute procedures that contain dozens or even hundreds of JCL statements. In fact, IBM supplies complex procedures that let you interface easily with software products like compilers, CICS, and DB2, and you’ll use them all the time. In addition, in most shops, you’ll create and use procedures that are specific to your installation.
►Subscribe to Topictrick & Don't forget to press THE BELL ICON to never miss any updates. Also, Please visit mention the link below to stay connected with Topictrick and the Mainframe forum on -