What’s new at MAINFRAMES 360
(Updates May '11)...
- We are a cosmopolitan community of 400 members, from around the globe.
- Working on writing and publishing articles on CICS.
- Special article on "How do I learn Mainframe Programming"

Tuesday, April 7, 2009

JOB Statement

Q. What is the purpose of JOB Statement?
Every JOB/JCL begins with a JOB Statement. The JOB Statement establishes the identity of your JOB. It conveys a lot of extra-information about the JOB. When you write a new JCL, you must first code the JOB Statement.

//name JOB parameters ...

The name that you assign to the JOB Statement, is called Job-name. In real-time projects, usually Production Region Jobs are named, based on the team or system to which they belong. For example, if a JOB belongs to ABC Team, it would be named as,

//ABCXXXXX JOB parameters...

Generally, in Test/Integration Environment, you write your own personal toy-jobs, that belong only to you individually. To signify this, you generally name your personal jobs after your TSO-Userid.

//AGY0157A JOB parameters ...
Q. What is the accounting-information parameter?
Accounting information in an IBM-Mainframe system is used to bill/charge any job that is run on a Mainframe computer. You must tell the MVS OS, the account number to which to bill the CPU time utilized. In the olden days, programmers were billed(charged) for computer-time that they used on a Mainframe, to do their work.

//AGY0157A  JOB  A123

Here A123 is the account number to  which the CPU time utilized on the Mainframe will be billed.

//AGY0157A JOB (,QUASAR)
 
Here QUASAR is the additional accounting information. The leading comma indicates the absence of the positional parameter Account no.

//AGY0157A JOB  (A123,'QUASAR S')

Given below is a simple JOB, that shows the use of Accounting-information parameter. You can try and submit this job, and see the output.

Image118[1]
Q. What is labelling and/or routing information?
As a job runs, MVS Operating System prints messages about the status of the job, what the job is doing. You can code labelling field on the Job Statement, so that when the Job Output is printed, each of the "separator-pages" will be labelled. This will allow the help personnel to physically separate the output from the output of other jobs at the printer.

Image121[1]

For example, in my project, they provide 100 "bins" for the print output. By putting 'BIN 7' as the label, I am telling MVS to print the label 'BIN 7' on each of the separator pages. The personnel operating the Mainframe printer, will know to put my output in Bin 7.
Q. What are keyword parameters?
Keyword parameters are those, which can appear in any order. They are identified by writing the keyword. The following keyword parameters are important for the JOB statement.
- CLASS, PRTY, MSGCLASS, MSGLEVEL, TYPRUN, TIME, NOTIFY
Q. What is the CLASS parameter?
The CLASS parameter is used to categorize the job. Generally, in most sites/projects, System Programmers setup these categories, during the installation of the MVS Operating System. It is customary to follow these default settings. For example, in my project, they follow these standards -CLASS=A to be used for small jobs, CLASS=G for medium-jobs, and CLASS=R for long-running jobs. Categorizing the jobs this way, helps the MVS operating system to easily pick up a job for execution.

Given below is a simple JOB, that shows the use of CLASS Parameter. You can try and submit this job, and see the output.

Image119[1]

Here, the job is categorized as Class=A.
Q. What are Input and Output Queues?
Back in the 1970’s era, input devices were different. The friendly keyboard was not available at the time. So, the input data that you want to feed to the IBM Mainframe, had to punched in the form of holes in a Punch Card. Usually, a JOB would be a set/deck of cards. Submitting a Job, or giving a JOB for processing to the Mainframe Computer, meant placing the deck of punch cards on a hopper and pressing the Start Button, to start feeding them through a Card Reader. The computer received a stream(series) of Electronic signals, representing the holes in the punched cards.

This whole process was much slower than the computer system itself, so what transcended is, that the entire JOB would first be saved in a Disk File(a staging area). The Mainframe Computer would then pick up the Job from the Disk staging area and process it in one go(in a single shot).

Now-a-days, people type the Job(JCL). When you submit the Job(give the JOB to the Mainframe computer for processing), the Job(JCL) first gets stored in a Disk Dataset(a staging area). This disk dataset is called the Input Queue. In fact, everyone’s jobs are first stored in the Input Queue. The MVS Operating system quickly scans the Job(JCL) for any syntax errors. The JCL that is syntactically correct gets to remain in the Input Queue. The one’s which have faulty syntax are brought another staging area called the Output Queue. The Input and the Output Queues are managed by a software called the JES(JOB Entry System). JES comes in two flavours JES2 and JES3.

You might wonder, could I see the Jobs that are there in the Input Queue and the Output Queue? On a Mainframe, you can see the Input Queue and the Output Queue by typing START SDSF or in short START S on the Command line in TSO/ISPF.

Image122[1] 

Upon invoking the SDSF utility, the SDSF screen shall be displayed. SDSF menu provides options to view several queues, like Input Queue(I), Output Queue(O), Status Queue(ST). As you know, the print output of completed jobs can be seen in Status Queue(ST).

Image123[1]
Q. How does MVS pick jobs for execution?
Let me figure this out.. After the job enters the Input Queue, how does the MVS pick your job for execution? Well, first your job has to await its turn on the Processor, if there other jobs in the Queue. When the Job has finally reached at the front of queue, and is all set to enter the CPU, it is assigned an Initiator. This marks the beginning of Job Execution. At this point in time, we would say, "The job is initiated".

The Initiator is like a Personal Assistant. It guides the job, advises the job, and assists it all along its journey, right from picking up the job from the Input Queue, throughout execution, till the job reaches the Output Queue. Once an initiator becomes free, it goes back to Input Queue to seek another job.
Q. So, you are saying, "MVS uses helper programs called Initiators to pick jobs from Input Queue.., right?"
Absolutely, you got that registered in your mind! To give you some more insight, every Initiator has its own class list. For example, Initiator-1 may have a class list 'EQPAS'. Then, whenever the Initiator is free, what it does is, to go the Input Queue, and look for a class E Job. If it finds, there are no Class E jobs waiting, then it looks for class Q Jobs and so on..

Its pretty simple, depending on the CLASS parameter is coded on your JOB Statement, your job is likely to get the assistance of any one of free initiators, who have this Class on their Class list.

What if, suppose you have coded CLASS=C on your JOB Statement, but the installation does not define Job class C. It means, no initiators have class C on their Class list. So, your job will simply sit waiting forever in the Input Queue, without getting initiated.

Image129[1]
Q. What is the MSGCLASS Parameter?
The Log-report of your Job is brought to the Output Queue area. There’s not just one Output Queue, but there are several classes of Output Queues. MSGCLASS parameter tells in which Output Queue, do you want your Log reports? If you want to send the Log-Report of the Job for printing to the Mainframe Printer, you code MSGCLASS=P. If you want to send the Log-Reports for Punching, you code MSGCLASS=X. If you want the Log-Report, to be held on the Output Queue itself, you code MSGCLASS=Y. You may use SDSF Software the view the contents of the Output Queue; the log-reports held in the Output Queue(Spool). Your Installation guys(project) define different print class codes(A,B,C,D,...X,..) for different output queues.  
 
Image130[1] 
Q.What is the MSGLEVEL Parameter?
The MSGLEVEL parameter is coded on the JOB Statement. It tells, how much
level-of-detail information should be printed in the Log-report? 2 pages, 3 pages, 5 pages. In other words, you can control the level of detail on the Log Report by coding MSGLEVEL Parameter on the JOB Statement.

A MSGLEVEL(0,1) prints only the JOB Statement. Look at the picture below, and see how I’ve coded MSGLEVEL(0,1).

Image222[1]

When you look at the JCL Listing(JESJCL) in the Spool, only the JOB Statement is displayed, all the detailed information is suppressed. A MSGLEVEL=(0,1) produces the least amount of detail in the Log-report.

Image221[1] 

A MSGLEVEL=(1,1) results in the maximum level-of-detail information to be spitted out in the Log-Report. If you don’t code a MSGLEVEL on the JOB Statement, by default it assumes a MSGLEVEL=(1,1). When the MSGLEVEL is set to (1,1), the complete Original JCL that you’ve typed is printed to the Log-Report. Not just this, even PROCs(ready-made jobs) expansions are printed. More on PROCs later.

The picture below contrasts how the level-of-detail of information in the Log report differs on coding a (1,1) – complete original JCL + PROCS, compared to (0,1) – just the Job Statement(Header).

Image223[1]

Monday, April 6, 2009

JCL Pseudo-code - How to write output to Disk/Tape

Q. How do we write Output to disk/tape in JCL?
A. Unlike writing output to a dataset, disk/tape are direct Access(DASD) devices. Let us study the JCL that will write the output to the disk.



//JOB1JOB(A123),'QUASAR S',
//CLASS=A,PRTY=6
//STEP1EXECPGM=PROGRAM1
//INPUT1DDDSN=INFILE,DISP=SHR
//DISK1DDDSN=DISK.OUTPUT,
//DISP=(NEW,CATLG,DELETE),
//UNIT=DISK,
//SPACE=(TRK,(1,1),RLSE),
//DCB=(RECFM=FB,LRECL=40,BLKSIZE=400)
//TAPE1DDDSN=TAPE.OUTPUT,
//DISP=(NEW,CATLG,DELETE),
//UNIT=TAPE,
//DCB=(RECFM=FB,LRECL=40,BLKSIZE=400)

Let us recollect that all JCL statements basically have 3 broad divisions
//NAME OPERATION OPERANDS

1) All JCL statements begin with two forward slashes //.
2) NAME gives a name to the job, step or ddname.
3) OPERANDS can be positional parameters or keyword parameters.

Let us now see what the DSN(Dataset Name) is written, if you want to write the output of your program(in the JOB) to the Disk. Here the output will be written to a dataset called DISK.OUTPUT.

DISP(Disposition of the Dataset) -
Disposition of the dataset is used to tell the MVS OS, what is the current statusof the data set, what to do with the dataset if the JOB is successful, and what action to take if the JOB is unsuccessful.
DISP(current-status,normal-disposition,abnormal-disposition)

Current-status: The current-status specifies, whether the data-set pre-exists, or it has to be created newly, whether the jobs have exclusive access to it,or multiple jobs can share it.

Normal-disposition : It tells what to do, upon normal execution of the job. The data-set can be saved or deleted.

Abnormal-disposition : It tells what to do, if the JOB terminates with errors(Abnormally Ends - ABENDS). Either the dataset can be saved or deleted.
DISP(NEW,CATLG,DELETE)
NEW, CATLG and DELETE are positional sub-parameters. They must appear in the same order.

NEW : This tells the MVS OS, the status of the dataset at the start of the JOB. It indicates that the dataset DISK.OUTPUT has to be creatednewly.

CATLG : Upon successful execution of the JOB, the dataset must be added to the System Catalog.

DELETE : Upon unsuccessful execution of the JOB, the dataset must be deleted.

UNIT Parameter :
This is used to identify the physical device on which output data-set is to be placed. During OS(MVS) installation(a process called SYSGEN), the system programmers will have assigned a symbolic name to each physical device.

SPACE
Parameter :

To create the output dataset, we need to first tell the MVS OS. The OS is a memory guagrd. It acts as a watchdog, guarding, protecting the memory. If you want to store the output dataset in computer memory, you must first ask the MVS OS for it. Only when the OS grants your request, then you can go ahead and store data.

The OS is a miser. Even if you want a single byte of memory, you must first ask the MVS OS for it. It does not give any bytes for free.

You must tell the MVS OS, how many bytes of memory space you need to store your data. You do this by writing the SPACE parameter.
SPACE(unit-of-space,(primary,secondary),release)

SPACE(TRK,(1,1),RLSE)

TRK indicates that the space being requested is in Tracks. Since Primary = 1, the MVS OS will initially allocate(reserve) 1 track of disk space, to store the output Dataset. If the size of output dataset exceeds 1 track, (and you run out of space), the MVS OS will allocate 1 additional track of memory space. If your program finds this space also insufficient, it will ABEND.

After successful execution of the job, any space not utilized by the job must be successfully released.

DCB Parameter :
DCB stands for Data Control Block. DCB will tell the MVS OS, the organisation of the dataset. A data-set may have all fixed length records, or the records may be of varying length. You must tell the MVS OS, the length of each record. This should match the record length as specified in the program. Also, a set of records form a block. MVS allocates memory in Blocks. You must specify the Block Size.

Input --> COBOL Program--> Output
Dataset Dataset
LRECL=50 INPUT-REC PICTURE X(50) LRECL=40
DISK-REC PICTURE X(40)

DCB=(RECFM=FB,LRECL=40,BLKSIZE=400)

RECFM = FB
It tells the MVS OS, that each record in the output data set, will be of fixed length. If the records are going to be of variable length, we must write RECFM=VB

LRECL=40
It tells the MVS OS, that each record is of length 40 bytes. Since, records are fixed length, all records have the same length = 40 Bytes. If RECFM=VB, then it tells the MVS OS, that the average length of the records is 40 bytes.

BLKSIZE=400
It tells the OS, that on the disk(direct access device), the size of the block will be 400 bytes. Thus, 1 block will at most store 10 records. If RECFM=FB, then BLKSIZE must be multiple of LCRECL. e.g. Block Size 4000 = 10 times x Record Length LRECL (40)

Sunday, April 5, 2009

Basic Concepts of JCL - Tutorial 02

What is the Input/Output FILE Identification section?
//INPUT1 DD DSN=INFILE,DISP=SHR
//OUTPUT DD SYSOUT=A

The fields INPUT1 and OUTPUT1 must correspond to the name following the ASSIGN TO statement in the FILE-CONTROL section of the COBOL Program.

FILE-CONTROL.
SELECT INPUT-FILE ASSIGN TO INPUT1.
SELECT OUTPUT-FILE ASSIGN TO OUTPUT1.

DD Field stands for Data Definition. Its main task is to tell the MVS OS, the input files from which data is read, and output file, to which OUTPUT information is written.

//INPUT1 DD DSN=INFILE,DISP=SHR

...DSN : A file containing records in IBM Mainframes is called Dataset. Every dataset has a name ; DataSetName(DSN).
DSN = INFILE indicates that the input data will be read from the Dataset INFILE.

SYSOUT=A indicates that the output will be written to the default printer(Job Spool).

DISP=SHR says that Disposition is Shareable. This means, that the dataset INFILE is not reserved for exclusive use. Other Jobs /Users can use this dataset simultaneously.

IBM's Anti-trust Suit

Is IBM trying to kill competition?
Its been a long-standing debate, if Internation Business Machines(IBM) has survived, simply because of the lack of competition. High cost of Mainframe computers, geeky unfriendly and old to work with, are deterrent factors for the bigblue.

In the 90's IBM failed to ride the new wave of the home desktop PC, and Microsoft took the competitive advantage. The battle between Microsoft and IBM still wages on.

A mushroom company Platform Solutions, developed software that mimicked IBM Mainframes on standard servers, Big Blue tried to fight back, but in vain. Finally, they simply tried to acquire the company for $150 million in July this year. After that, Platform Solutions is nowhere to be seen, vanished in thin air.

IBM still faces stiff competition from Biggies like Microsoft and Google. T3 Technologies, a reseller of Platform's products, has filed a complaint against them to the regulators in European Commission.

IBM is now negotiating to buy Sun Microsystems for $7 billion. We can only keep our fingers crossed. IBM has always charged astronomical prices for its so-called 'innovative' products. Its surprising, that amount of Mainframe processing power sold every year is declining.

Wednesday, April 1, 2009

COBOL Tutorials

Tutorial Links
Introduction to COBOL Programming  
DATA DIVISION  
Tutorial 04 – DATA DIVISION(Part – II)
- WORKING-STORAGE SECTION
- Simple COBOL Program to declare and use WORKING-STORAGE Areas
PDF
Word
Tutorial 05 – DATA DIVISION(Part – III)
- How the MOVE Verb works 
- Rules to be applied while MOVEing 
- MOVEing to an Alphanumeric Data-Item 
- Simple Program that shows an alpha-numeric MOVE 
- MOVEing to a Numeric Data-item
- Simple Program to show a Numeric MOVE 
- Editing Symbols 
- Rules of how EDITING symbols work
- Simple Program to show working of various EDITING Symbols
PDF
Word
Tutorial 06 – DATA DIVISION(Part – IV)
- REDEFINES Clause
- Sample Program to understand REDEFINES Clause
- RENAMES Clause
- Sample Program to understand RENAMES Clause
PDF
Word
Tutorial 07 – Arithmetic Operators and Expressions in COBOL
- How the ADD Verb works 
- More about SUBTRACT Verb
- MULTIPLY Verb to multiply two things
- DIVIDE Verb to Divide and find remainders
- COMPUTE Verb for writing complex arithmetic expressions
PDF
Word
Tutorial 08 – USAGE Clause
- What is USAGE Clause
- USAGE is DISPLAY
- USAGE IS COMP/BINARY
- USAGE IS COMP-1/COMP-2
- USAGE IS COMP-3
PDF
Word
Tutorial 09 – Decision Making in COBOL 
- Basic IF Statement
- IF ELSE Construct
- Nested Conditionals
- Types of Conditions – Class, Relational, Sign
- Complex Conditions – Boolean AND, OR, NOT
- 88-level Special conditionals
PDF
Word
Tutorial 10 – Program Flow Control 
- Basic PERFORM Statement
- PERFORM multi-paragraph Procedure
- PERFORM a SECTION
- PERFORM loops
PDF
Word
Tutorial 11 – EVALUATE Statement – I
- EVALUATE and WHEN Clause 
- Multiple Subjects and corresponding objects
PDF
Word
Tutorial 12 – EVALUATE Statement – II
- Agreement of the subjects with the objects
- Values that subject and object can take
- Concrete example of EVALUATE Clause
PDF
Word
Tutorial 13 – Table Handling
- Creating a table in COBOL
- Storing data and retrieving the contents of table
- Working with two-dimensional tables
PDF
Word

Test JavaScript


Test

Articles and Writings


IBM’s Antitrust Suit
IBM Mainframes turns 45
Storage Management System – SMS
MVS System Catalog - Finding Information about Datasets
Building your very own private (Baby) Mainframe on your Laptop/Desktop PC

CA-7 Tutorials

Tutorials Download Link
CA-7 Commands PPT

IBM Utility Software


Tutorial Name Links
IEBGENER for Sequential Files  PDF, Word
IEBCOPY for Partitioned Datasets PDF, Word
IEBCOMPR and SuperCE to compare Datasets PDF, Word
Search Utility to search through Libraries  
IEFBR14 for Side-effects  
IEBPTPCH – Print and Punch Utility  
IEHPROGM  

JCL Tutorials


Tutorial Web Page and Outline Download Links
Tutorial 01 – JOB Statement Fundamentals
|| JOB Statement – Purpose || Accounting-information parameter ||
Programmer-name parameter || Keyword Parameters || CLASS Parameter || PRTY Parameter ||
Message Class MSGCLASS || MSGLEVEL Parameter ||
PDF, Word
Tutorial 02 – EXEC Statement Part I
|| EXEC Statement || Job-Step || Program || Input Dataset || Output Dataset || Program Load || ACCT Parameter || PARM Parameter || JOBLIB, STEPLIB Parameter ||
Default System defined Library – SYS1.PROCLIB || User defined private library ||
PDF, Word
Tutorial 03 – EXEC Statement Part II
|| DPRTY Parameter || PERFORM Parameter || Restarting and Checkpointing – RD Parameter ||
||Common Parameters of JOB and EXEC Statement || REGION Parameter || COND Parameter ||
PDF, Word
Tutorial 04 – DD Statement Part I
|| DD Statement : Purpose || DSN Parameter || Qualifier levels in a DATASET Name ||
DISP Disposition Parameter || Status of Dataset || Normal Disposition || Abnormal Disposition || Meaning of NEW,OLD,SHR,MOD,KEEP,DELETE,CATLG,UNCATLG,PASS ||
 
PDF, Word
Tutorial 05 – DD Statement Part II
|| UNIT Parameter – referring to device by its make/model || AFF Subparameter ||
VOL Parameter – referring to a particular volume of device || SER – Serial Number ||
REF – Referback to previous VOL Statement || PRIVATE subparameter || RETAIN subparameter || SEQ subparameter || LABEL parameter for Tape Datasets ||
SPACE Parameter – for storage space allocation || Max. space allocated to a PS ||
|| RLSE,CONTIG,MXIG,ROUND Subparameters || Organisation of records in Dataset ||
DCB Parameter – Data Control Block || RECFM – Record Format ||
LRECL – Logical Record Length || BLKSIZE – Block Size || DSORG – Dataset Organisation ||
Sample JCL Showing how to use DCB Parameter ||
PDF, Word
Tutorial 06 – DD Statement Part III(Instream and Cataloged Procedures)
|| What is a JCL PROC ? || Cataloged PROCEDURE || Default SYSTEM LIBRARY ||
|| Private Library || Analogy with respect to conventional Programming Languages ||
Instream PROCEDURE || Calling a PROC – Example ||
PDF, Word
Tutorial 07 - More on COND Statement(Lots of Examples)
|| COND Statement – Basic Example || EVEN Parameter || ONLY Parameter ||
COND Coded on many job-steps ||
PDF, Word
Tutorial 08 - Cataloged and Instream PROCs(Overriding Parameters)
|| Modifying contents of a JCL PROC || Modifying a parameter on EXEC Statement ||
Adding a parameter to EXEC Statement || Deleting(Nullifying) parameter on EXEC Statement ||
Adding or modifying DD Statements || Example – MODIFYING DD Statament ||
PDF, Word
Tutorial 09 - JOB Log (How to understand it and Interprete it)
|| JOB Log means... || What is JES2 JOB Log || Start and End CPU Times || User assigned to the JOB || Number of Input Cards read || COND Code || Allocation and Termination Messages ||
PDF, Word

Introduction to IBM Mainframes – Part I : Video Tutorial


Compuware File–aid How to

Q. What is File-Aid?
At home, we maintain our Bills, Receipts, Credit-Card Statements systematically in a File. Likewise, a Computer-File is systematic means of storing Data. To browse the data stored inside a Computer File, to make any additions or deletions, the software Program used is called a File Editor.

File-Aid is an advanced File Editor Program, developed by Compuware, that aids you and assists you storing and retrieving Data from Mainframe Files. File Aid can not only handle Line-Sequential Files, but also VSAM Files.
Q. How to Browse or Edit a File in File-aid?
The File-Aid Main-Menu Screen shows various options. The Browse Menu Option 1, the Edit menu 2, the Utilities Menu Option 3 and the View Menu Option 8 are needed frequently, when working with Files.

image

The Browse Screen or Edit Screen are used to Open and read Mainframe Files. Browse happens to be Read-Only Mode, whereas Edit allows you to modify or update the contents.

On the Browse Screen, you must enter the Mainframe File-Name. I have entered the Dataset Name VS90626.GINP10SD.DUMP2. You must also specify the Browse Mode. The Character(C) Browse Mode is used to display the Textual-Data in the File as EBCDIC Characters.

image

Hit Enter, and the Dataset will be opened for Browsing. The below picture shows my Dataset VS90626.GINP0SD.DUMP2. You may scroll left using the PF10 AID Key, and scrolling right is possible using the PF11 AID Key.

image
Q. How to use Copy-books in File-aid?
While looking at records stored in a Mainframe File, it is very difficult to interprete and understand their meaning, make out what are the Fields or columns. In the snapshot below, its hard to make out, what the text ABG means, what RQ00049R25 stands for and so on. It would be cool, if it had some headings.

Just as on an Excel Spreadsheet, Column-Headings add meaning to the data stored in the File, File-Aid allows you to browse Data, with the Column Headings turned on.

The Data-records stored in a Mainframe File have a Format, a Structure or Layout. This Data-Format or Structure is generally maintained in a Separate Copy-book File, independent from the Data. You can specify a COBOL Copy-book File, while attempting to browse the Data.

Enter the Copy-book Library and the Member name on the Browse Screen. My copy-book member is GINP10SD under the Library CP81000.PSEGMENT.COBOL. You specify either Vertical Format(VFMT) or Horizontal Format(FMT) Browse Modes.

image

When you press Enter, to open the File, it shows up like this.

image

Here, the columns are arranged one besides the other vertically. To switch over to the Horizontal Format(FMT) Mode, enter the line command FMT. The columns are now stacked horizontally.

image

The SHOW Line-Command comes in quite handy, when browsing files. Take a look below.

SHOW OFFSET – Displays the offset(displacement) in Bytes for each column.

image

SHOW NUMBER – Displays the Column Number.

image

DISPLAY Command – When you want to display only selected columns and hide others, you can use the DISPLAY Command. For example, if I type display 3 4 10 11 13 14 28 57 58 ONLY, it will exclusively display only these columns.

image
Q. How to create a new Mainframe Dataset in File-Aid?
On the Mainframe, you use ISPF Menu Option 3.2, to allocate new datasets. Likewise in File-AID, you can used File-AID Menu 3.2, to create new Files. Enter the Dataset name for example, VS90626.TEST.FILE enclosed in single quotes. Enter the Command A to Allocate the Dataset.

image

On the next screen, enter the Memory Space Requirements. I want my Dataset to be Sequential PS Dataset, 10 Tracks large, with a Fixed Record Length of 80 Bytes. I want them to be grouped in bunches of 10 each, so the
Block-Size = 80 Bytes x 10 = 800 Bytes.

image

After keying in all the necessary Parameters, hit Enter to create the new Dataset.

COND Statement – How does it work?


Q. How does the COND statement work?
The COND statement is used to bypass Job-step. 

Example 1

Consider the statement

//STEP02  EXEC  PGM=IEFBR14,COND=(4,GT,STEP01)
r
In this example, if condition-code of STEP1 is between 0 to 3, the COND condition is satisfied. Thus, STEP02 is bypassed.

Example 2

Consider the statement,

//STEP02  EXEC  PGM=IEFBR14,COND=((16,GE),(90,LE,STEP1),ONLY)

In the above example, the system executes this step if all of the three conditions are met,
1. Return codes of Any of the previous job-steps is 17 or greater.
2. Return code of STEP1 is 89 or less.
3. Any of the previous step abnormally terminates.

Example 3

Consider the series of statements :

//STEP01 EXEC PGM=IEFBR14
//STEP02 EXEC PGM=IEFBR14,COND=(0,EQ,STEP01)
//STEP03 EXEC PGM=IEFBR14,COND=((8,LT,STEP01),(8,GT,STEP02))

In the above scenario, assume the system successfully executes STEP01 with Return Code=0. The system finds that 0 is equal to return code of STEP01 i.e. 0. So, STEP02 is bypassed. When the system evaluates condition on STEP03, it finds that  8 is greater than return code of STEP01(we don’t consider the other part of the condition, since STEP02 was bypassed). Since, 8 > 0, the system executes STEP03.
Rule : Bypassing a job-step because of a return code test, is not the same as abnormally terminating the job-step.

You can now try and predict in this JCL, which job-steps the system executes, and which job-steps are bypassed...



Answer :
System executes STEP01. Return Code = 0.
(4,LT,0) false. System executes STEP02. Return Code = 0.
(16,GE,return code of any preceding step) true. System bypasses STEP03.  

Compile JCL's

Compile Job Instructions on how to customize and use
COBOL Compile-Link Job 


1. Change the //JOB Card.
2. Set the PROGRAM, SRCLIB, COPYLIB and LOADLIB parameters to your personal Program-name, Source-Library, Copy-Library and Load-Library.
3. Find out the COBOL Compiler-Library prefix. COBOL Compiler libraries end with *.SIGYCOMP. Set COBPRFX(Cobol prefix)=prefix of the Compiler-Library.
COBOL Run Job


1. Change the //JOB Card.
2. Set the PGMNAME and LOADLIB parameters to your personal Program-name and Load-Library respectively.
COBOL-DB2 Pre-compile, Compile and Link Job


1. Change the //JOB Card.
2. Set the PROGRAM, DBRMLIB, SRCLIB, COPYLIB, DCLGEN and LOADLIB parameters to your personal Program-name, DBRM Library, Source-Library, Copy-Library, Declarations Library and Load-Library respectively.
3. Find out the COBOL Compiler-Library prefix.
COBOL Compile Libraries end with *.SIGYCOMP. SET COBPRFX=prefix of the COBOL Compiler-Library.
4. Find out the Linker-Library Prefix. Linker Libraries generally end with *.SCEELKED. SET LNKPRFX=prefix of the Linker-Library.
5. Find out the DB2-Library prefix. DB2 Library-names follow the convention DSN*.SDSNLOAD. The prefix maybe DSN710, DSN810 or DSN910 depending on the DB2 Version at your shop. SET DB2PRFX=prefix of DB2-Library.
DB2 Bind Job


1. Change the //JOB Card.
2. Set the PROGRAM, DBRMLIB and BINDLIB Parameters to you own Personal Program-name, DBRM Library and Bind-Cards Library.
3. Ensure that your BIND-card is stored in the correct
BIND-Library. //SYSTSIN File points to the BIND-Card.
COBOL-DB2 Run Job

1. Change the //JOB Card.
2. Set the LOADLIB and DBRMLIB Parameters to you own Load Library. and DBRM Library. 
3. Ensure that your  SYSTSIN card is correct.
IMS DBDGEN Job

1. Change the //JOB Card.
2. Set the LOADLIB and DBRMLIB Parameters to you own Load Library. and DBRM Library. 
3. Ensure that your  SYSTSIN card is correct.

LINES parameter - Indicating maximum amount of output to be printed to SYSOUT


Question

//HERC04A  JOB  A123,QUASAR,NOTIFY=&SYSUID

Suppose you have the above job-card, that has several job-steps with a large output. You would like to issue a message to the operator, when the job output exceeds 500,000 lines. Which parameter should you add to the job-card to achieve this?

a) NOTIFY=(500,LINES)
b) MESSAGE=(LINELIMIT,500K)
c) WARNING=(500000,LINECOUNT)
d) SIGNAL=(LINES,500K)
e) LINES=(500,WARNING)
A. When we want to indicate the maximum amount of output to be printed to SYSOUT dataset, we can use LINES parameter on the JOB card. The syntax of the LINES parameter is :

LINES=nnnn or LINES=(nnn,action-to-be-taken)

The maximum amount of output can be specified in thousands of lines. So, if you want to indicate that maximum amount of output from the Job is 500k lines, nnn should be 500. You can also specify, what action must be taken – whether you want to continue the job, cancel the Job(CANCEL), DUMP, or notify the operator(WARNING).

Correct answer – LINES(500,WARNING)

On the same lines, you can also indicate the maximum amount of output in terms of BYTES,CARDS or PAGES.

NOT CATLGD 2 JCL Error – How to avoid it?


Question



When attempting to run the above Batch JOB/JCL, NOT CATLGD 2 JCL error occurs for the ddname OUTFILE. What is a NOT CATLGD 2 JCL Error? How to eliminate NOT CATLGD 2 JCL Error for a particular dataset?

The NOT CATLGD 2 JCL Error mostly occurs, when the dataset in question already exists. Here, OUTFILE is trying to create a new dataset OUTFILE.TEST.DATA. So, probably this dataset already pre-exists and is cataloged. To ensure such errors don’t occurs, we must purge/delete datasets using IEFBR14.

OUTPUT Statement – Changing default SYSOUT output to a remote location


Question

What is the OUTPUT JCL Statement? How do change the default destination of the SYSOUT output messages to a remote location?
A. When we would like to do some formatting/processing, on SYSOUT output datasets, we use a JCL Statement called OUTPUT. To specify the destination of the SYSOUT output dataset, as a remote location, we must code DEST parameter on the OUTPUT JCL Statement.

//OUT1  OUTPUT  DEFAULT=YES,DEST=RMT

In the above example, the SYSOUT dataset output will be sent to the remote location RMT. Also, this will stand as the default. 

Apart from this, we can specify various options, we can print multiple copies of the output dataset, using COPIES parameter. Moreover, we can write OUTPUT statement at the job-level or step-level. To refer back to previous OUTPUT statement, we can use refer-back.

Refer-back  
*.OUT1          - *.outname
*.STEP01.OUT1   - *.stepname.outname

Related Posts Plugin for WordPress, Blogger...

Note :

Protected by Copyscape Online Copyright Protection
© Copyright – Quasar Chunawalla, 2010.
Note : The copyrights of all the material, text and pictures posted in this website belong to the author. Any instance of lifting the material from this website, shall be considered as an act of plagiarism. For any clarifications, please drop me a line at
 
back to top