Sie sind auf Seite 1von 12

The JOB Statement - Tutorial 04 ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS

Bulletin Board
Whats new at MAINFRAMES 360

(Updates)...

- Working on Cosmetic enhancements to navigation menu on the Sidebar, so that it will


dynamically expand..
- Resolved some Display issues and filling in the gaps(missing tutorials like VSAM)
- Posting several Video tutorials

Mainframes360 Search
Search
powered by

Quick Links

http://www.mainframes360.com/2009/04/job-statement-tutorial-04.html (1 of 12)12/23/2009 3:58:09 AM

The JOB Statement - Tutorial 04 ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS

Jump to :
<== Previous Tutorial

-------

Tuesday, April 7, 2009

The JOB Statement - Tutorial 04


Q. What is the purpose of JOB Statement?
A. The JOB statement is used to supply extra-infomation about the JOB to the MVS
operating system.
- It tells the MVS OS about the start of a new job.
- It informs the MVS OS, the accounting information, so that the user can be billed
for the computing time.
- It tells the MVS OS, who has written this JOB.
- It specifies the JOB's class(category) to the MVS OS, thus giving indication
whether the Job requires more CPU time or less CPU time.
- More precisely, it also tells the MVS OS, what is the priority of the Job. So that
the scheduler of the MVS OS - JES(Job Entry Subsystem) will enter the JOB in the
system, before other jobs with lower priority.
- It tells the MVS OS, what is the output to be printed - whether to print JCL
corresponding to the JOB statement only, or all the JCL statements. In addition,
does it need to print allocation/termination messages.
- Moreover, it will announce to the MVS OS, which output device to print these
output messages on.
- Sometimes, by writing a JCL parameter, you can instruct the MVS OS, to hold the
job for later execution. You can also ask the MVS OS, to look for syntax errors in
your JCL, before actually running the JOB.
//jobname
//
//
//

JOB

accounting-info,programmer-name,
class,priority,
message-class,message-level,
hold|scan

Q. What is a valid jobname?


A job has to be given a name, by which the MVS OS will refer to it. The jobname can
be 1-8 characters in length. The first character must alphabetic or national
character. Subsequent letters can be alphabets, digits or national characters.
Valid jobnames
//MYJOB
//JOB@123
//$$JOB01
Invalid jobnames
//1JOB
//JOB A
//PROGRAMMINGJOB

http://www.mainframes360.com/2009/04/job-statement-tutorial-04.html (2 of 12)12/23/2009 3:58:09 AM

Next Tutorial ==>

The JOB Statement - Tutorial 04 ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS

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.
//JOB1

JOB

A123

Here A123 is the account number to


will be billed.

which the CPU time utilized on the Mainframe

//JOB1 JOB (,QUASAR)


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

(A123,'QUASAR S')

Q. What is the programmer-name parameter?


The programmer name parameter is used to identify the programmer is written the
COBOL Program in the JOB being executed.
//JOB1

JOB

A123,QUASAR

In the case that, the programmer name contains special characters, we must enclose
it in single quotes.
//JOB1

JOB

A123,'QUASAR S'

//JOB1

JOB

A123,'MC''DONALDS'

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. For example, a CLASS=K might mean
that all the jobs which use a lot of CPU time. Another CLASS=X might mean jobs with
a lower priority.
//JOB1
//

JOB

A123,'QUASAR S',
CLASS=A

Here, the job is categorized as Class=A. When installing the MVS OS, various
defaults are established. Different letters and numbers are assigned to classes that
tell the MVS the nature of the Job.
Q. What is the PRTY parameter?

http://www.mainframes360.com/2009/04/job-statement-tutorial-04.html (3 of 12)12/23/2009 3:58:09 AM

The JOB Statement - Tutorial 04 ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS

The PRTY parameter is used to assign priority to Jobs. A job with priority 6 will
always be run before a job with priority 3.
//JOB1
//
//JOB2
//

JOB
JOB

A123,'QUASAR S',
CLASS=A,PRTY=6
B123,'REENA S',
CLASS=A,PRTY=9

Here, JOB2 will be run before JOB1.


Q. What is the MSGCLASS Parameter?
Messages can be of two types 1. Messages related to the System and JCL
2. Output of the program or procedure being executed.
As the job runs, the MVS OS generates several system messages about the events that
take place along the way. This includes messages related to the system, and those
that have to do with JCL that is being executed. To add to this, the program or
procedure being executed, takes some input -> performs processing on input data ->
generates some output(Report).
The MSGCLASS parameter tells the MVS OS, which class of output devices should these
output messages be stored. The output-devices are categorized into different classes
while generating the system.
//JOB1
//
//

JOB

A123,'QUASAR S',
CLASS=A,PRTY=6,
MSGCLASS=A

Here, all the output messages will be routed to the output device of class A;
usually the system default printer/job spool.
Q.What is the MSGLEVEL Parameter?
As we discussed above, messages are broadly of 2 types. Let us discuss further at
length, what are the messages that the system produces as a job runs.
- Log messages indicating JOB Name, Username, Password, are routed to the output
device.
- Next, the JCL statements that make up the Job.
- Also, output of the program being executed.
- Messages related to the successful execution/termination(ABEND Code) will be
output.
- At the start of the job and end of job, allocation/termination messages are
produced.
MSGLEVEL(statements,messages)
<statements>=0|1|2
0 : Only the JOB statement is output
1 : All JCL statements, including any cataloged procedures or symbolic parameters,
2 : Only Input JCL Statements
http://www.mainframes360.com/2009/04/job-statement-tutorial-04.html (4 of 12)12/23/2009 3:58:09 AM

The JOB Statement - Tutorial 04 ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS

<messages>=0|1
0 : The output messages are printed only if the job terminates abnormally.
1 : The output messages are always printed.
//JOB1
//
//

JOB

A123,'QUASAR S',
CLASS=A,PRTY=1,
MSGCLASS=A,MSGLEVEL=(1,1)

Q. What are MVS Input and Output Queues?


Back in the 1970s 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 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, everyones
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 ones 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.
Q. How does the MVS pick JOBs for execution?
In a typical Mainframe Shop(any computer software firm, that builds applications on
Mainframes), there will be several hundreds and thousands of Jobs that are submitted
throughout day by different people.
Now, how does the MVS pick from the thousands of Jobs that are available in the
Input Queue. Coding the JOBs CLASS Parameter helps the MVS to categorize and pick
the jobs. This categorization generally varies from one shop to another(shopspecific). However, for the sake of example, a particular shop might say 1. All Jobs that take longer time to complete Class A
2. All Jobs that take shorter time to complete Class B
Once the MVS has categorized the JOBs, it takes the help of another auxiliary
program called the Initiator. The Initiator is like a personal assistant. The
Initiator picks a Job from the Input Queue, guides and assists the Job through its
http://www.mainframes360.com/2009/04/job-statement-tutorial-04.html (5 of 12)12/23/2009 3:58:09 AM

The JOB Statement - Tutorial 04 ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS

execution, till the Job reaches the Output Queue. From the time the Job enters the
Input Queue, throughout its journey, the initiator holds hands with the Job and
advises it, guides it, upto the Output Queue. Once, the Job executes successfully,
the initiator goes back to the Input Queue.
Posted by Quasar at Tuesday, April 07, 2009
Labels: accounting-info, Allocation, CLASS, JCL, JES, JOB, jobname, keyword, message-class, message-level, MSGCLASS, MSGLEVEL, MVS, NOTIFY, position, programmer-name, PRTY, Termination, TIME,
TYPRUN
Reactions:

0 comments:

Post a Comment

Links to this post


Create a Link

Newer Post Older Post Home


Subscribe to: Post Comments (Atom)

Quick Links
Jump to :
<== Previous Tutorial

-------

Note :

http://www.mainframes360.com/2009/04/job-statement-tutorial-04.html (6 of 12)12/23/2009 3:58:09 AM

Next Tutorial ==>

The JOB Statement - Tutorial 04 ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS

Copyright Quasar Chunawalla, Tata Consultancy Services,2009.


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 mail at quasar.
chunawala@tcs.com

Globe-trotting
http://www.mainframes360.com/2009/04/job-statement-tutorial-04.html (7 of 12)12/23/2009 3:58:09 AM

The JOB Statement - Tutorial 04 ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS

Some Excerpts from Mainframes360


Q. What are the two broad types of Applications/Systems?
All application/systems are of 2 types
(i) Online Systems(Transaction Processing Systems)
(ii)Batch Processing Systems. Read more ...

Q. What is the DATA DIVSION? What are the different sections in the DATA DIVISION?
DATA DIVISION is used to describe the Input Output Storage areas and temporary storage areas. In other words, itll describe the
structure of the data being stored in Input Output Files, as well as in any temporary storage. Read more ...

Q. What are data-types? What are the basic data-types in COBOL?


Data-type is used to announce/declare to the MVS O/S, about the type of data youre gonna store in a Storage Location, so that it
can estimate the storage space to be allocated and reserved for you data excusively. Read more ...

Q. What are group and Elementary Data Items?


In COBOL, one or more elementary data-items can be grouped together. For example, we can group EMP-NAME, EMP-SALARY and EMP-JDATE
as EMPLOYEE-RECORD. In COBOL, we say that a group item is a data item, which has several low-level(elementary) data-items. Read
more ...

Q. Can you elaborate on how to write the File Descriptor FD Paragraph?


As mentioned before, we must describe the input file record format and output file record format in the File Descriptor FD
paragraph under the FILE SECTION. Remember, that FD paragraph is always coded in AREA A. Read more ...

Q. What is JOB Log? Why do we need a JOB Log? What purpose does it serve?
When you submit a Batch JOB/JCL to the MVS System, the MVS executes the Job Stream, makes the necessary resources available to the
the EXEC PGM (Program), and finally tells you the result of the Job. Read more ...

Q. In the previous tutorial, youve stated what is compiling, linking and running.. Can you show me a Compiler and
Linking JCL/Job Stream that does this?
Sure, as you know, the Compiler takes a SYSIN DD Input Dataset, which is the Source COBOL Program. The COBOL Compiler IGYWC(or
IGYCRCTL) produces SYSOUT DD Dataset containing the JOB Log and Status messages, and more importantly, SYSLIN DD which is Object
Module and Input for the Linker. Read more ...

Q. Show me a simple JCL/JOB Stream to run my COBOL Program(LOAD MODULE).


On Windows, to run a program, we simply click on the Executable File. In the same way, to run our COBOL Program on Mainframes, we
are going to use the LOAD MODULE(Executable). To run a program on the MVS, you write JCL. You specify the name of the Program(LOAD
MODULE) Read more ...

Q. What is the ENVIRONMENT DIVISION? What purpose does it serve in the COBOL Program?
The ENVIRONMENT DIVISION provides information about the computer equipment/configuration upon which the COBOL program will run. It
http://www.mainframes360.com/2009/04/job-statement-tutorial-04.html (8 of 12)12/23/2009 3:58:09 AM

The JOB Statement - Tutorial 04 ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS

also gives the name of the input and output files used in the program. It assigns the file-names to ddnames(DD Statements in the
Run JCL). Read more ...

Q. What is a Mainframe Computer?


A Mainframe computer is used by large organisations for processing huge volumes of data e.g. census, consumer statistics, ERP and
financial transaction processing. Read more ...

Q. How did IBM Mainframe machines evolve?


Well, IBM first launched the System/360, then System/370, System 370/XA, Enterprise System Architecture(ESA)/370, System 390 and
the latest machines in the Mainframe series is zSeries(pronounce Zee). Read more ...

Q. What does a Mainframe Computer look like? How do you operate it?
Lets just try to see whats life like, if you are Mainframe machines operator. A Desktop computer can fit into a trolley or a
cabinet. A Mainframe Machine is generally big monster-size, would fill up a room. On a Desktop PC, you would sit near the physical
computer and operate it using the keyboard and the mouse, and see the result on the monitor. Read more ...

Q. Hey, Windows is the most popular Operating System on a Desktop-PC. On the same lines, the popular Mainframes
Operating System is MVS...
Bulls-eye! In fact, MVS is said to be the Operating System that makes the world move. Read more ...

Q. What about Super-computers? Are mainframes faster than super-computers?


Dont equate the word Mainframes to Speed. Mainframes have tremendous processing power or computational power, but of a different
kind. Think of task, where we have 1,00,000 records of Input data, and we want to perform 3 calculations on each record, and then
put the Output Records in a separate file. Read more ...

Q. Whats that name again.. Multiple Virtual Storage? What crap?


Virtual Storage is a simple idea. Virtual storage simulates a large amount of main storage(Primary or main memory) by treating the
auxiliary storage as an extension of the real storage. Thus, a program gets the feel, Wow, I have an infinite amount of computer
memory at my disposal. Read more ...

Q. What is a Batch Job?


If you are a college student, you would have probably written a computer application in C, and executed it on your desktop PC. You
run the program interactively, you type in some input data, wait for the response(output), and then you type some more input, and
this cycle continues. Such programs or systems are called as Online Systems or Transaction Processing Systems. Read more ...

Q. Look, on Windows PC, you interact with the computer using the Windows GUI the Desktop Icons, the Menus,
Buttons etc. How do you interact with an MVS Mainframe System?
MVS offers several ways to interact with it. The 3 main ways of interacting with MVS are TSO, ISPF and CICS. Read more ...

Q. What does COBOL stand for? What are the application areas where COBOL Programs written?
COBOL stands for Common Business Oriented Language. COBOL Programs are used for commercial data processing. COBOL is an Englishhttp://www.mainframes360.com/2009/04/job-statement-tutorial-04.html (9 of 12)12/23/2009 3:58:09 AM

The JOB Statement - Tutorial 04 ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS

like language. Writing a COBOL program is just like writing a passage in English. Read more ...

Q. You said COBOL Programming language bears resemblance with English. Do COBOL Programs have paragraphs like in
English?
A COBOL Program consists of 4 main divisions : IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION and PROCEDURE DIVISION.
IDENTIFICATION DIVISION is used to identify the COBOL Program to the system. It tells the... Read more ...

Q. Show me the basic skeleton of a COBOL Program then..


The basic skeleton of a COBOL Program is as follows : IDENTIFICATION DIVISION. ENVIRONMENT DIVISION. Read more ...

Q. Paragraphs in the English language are indented. Do you have indentation/alignment rules in COBOL?
Just like paragraphs in English, COBOL Divisions and Paragraphs must follow strict alignment rules. The way we indent paragraphs in
English, you must indent different Divisions, sections and paragraphs in a COBOL Program. When you write .. Read more ...

Q. What is the IDENTIFICATION DIVISION used for?


The IDENTIFICATION DIVISION is used to identify the COBOL Program to the system. It has the following paragraphs :
PROGRAM-ID.
AUTHOR.
Read more ...

Q. What does the PROCEDURE DIVISION look like? Whats the format/syntax. Can you elaborate..
The PROCEDURE DIVISION indicates the entry-point or starting point of the COBOL Program. This is where the computer system begins
to run(execute the COBOL instructions). Hence, all your instructions/programming logic must be written inside this PROCEDURE
DIVISION. Read more ...

Q. How do you compile a COBOL Program? What is meant by Linking a COBOL Program? Finally, how do you run the
Program on a Mainframe System?
Compiling a COBOL Program : COBOL is a high-level language. The Mainframe Computer System only understands binary Machine Language
0 and 1. Thus, your COBOL Program has to be translated from COBOL Language to Binary Machine Language. So, you give the Program in
COBOL Language as Input to the Translator(Compiler), and you get the Output Program in Binary Machine Language. Read more ...

Q. Could you throw some light on the WORKING-STORAGE SECTION of a COBOL Program?
The WORKING-STORAGE SECTION is used to declare any fields or records that are not going to be used in input files, or output files,
but they are used to store the intermediate results of processing in a temporary storage area. Read more ...

Navigation
Navigation
http://www.mainframes360.com/2009/04/job-statement-tutorial-04.html (10 of 12)12/23/2009 3:58:09 AM

The JOB Statement - Tutorial 04 ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS

- Main Page
- Questions Archive
- Articles and Writing
Tutorials

+ JCL Tutorials(12)
- Introduction to IBM Mainframes
- Basics of JCL
- How to read/write data from
Datasets
- JOB Statement Fundamentals
- EXEC Statement I
- EXEC Statement II
- DD Statement Part I
- DD Statement Part II
- DD Statement Part III
- More on COND Statement
- More on Cataloged and
Instream procedures
- More on JES2 Job Log
+
+
+
-

IBM Utilities Tutorials(08)


COBOL Tutorials(08)
DB2 Tutorials
VSAM Tutorials
CICS Tutorials
REXX Tutorials
ISPF Panel Programming

FAQs
- How do I learn Mainframes?
- Coaching and Institutes
- Mail me
- JOB Prospects
- Idea behind Mainframes 360

Follow the Buzz..

Technorati
Add this blog to your favourites..
http://www.mainframes360.com/2009/04/job-statement-tutorial-04.html (11 of 12)12/23/2009 3:58:09 AM

The JOB Statement - Tutorial 04 ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS

Subscribe To
Posts
Comments

About Me
Quasar Chunawalla
Chennai, Tamil Nadu, India

Working at Tata Consultancy Services, Chennai


View my complete profile

http://www.mainframes360.com/2009/04/job-statement-tutorial-04.html (12 of 12)12/23/2009 3:58:09 AM

Das könnte Ihnen auch gefallen