Sunday, May 17, 2009

Mainframe Application programming Development Solutions

Mainframe Application & programming

JCL :
For your program to execute on the computer and perform the work you designed it to do, your program must be processed by your operating system. Your operating system consists of a base control program (BCP) with a job entry subsystem (JES2 or JES3) and DFSMSdfp installed with it.

For the operating system to process a program, programmers must perform certain job control tasks. These tasks are performed through the job control statements, which are listed in the first chapter. The job control tasks and introductory information about JCL are introduced in the second chapter. The charts in the third chapter divide these tasks into detailed subtasks. The tasks are:

  • Entering jobs
  • Processing jobs
  • Requesting resources
JCL Essentials :
  • The programmer name parameter
  • The NOTIFY parameter
  • The MSGCLASS and MSGLEVEL parameters
  • How to code the EXEC statement
  • The PGM parameter
  • The PARM parameter
  • How to code the DD statement for DASD data sets
  • The syntax of the DD statement for DASD data
  • sets
  • The ddname and the DSNAME parameter
  • The DISP parameter
  • The UNIT and VOLUME parameters
  • The SPACE parameter
  • The DCB parameter
  • How to code the DD statement for instream and
  • SYSOUT data sets
  • The DD statement for instream data sers
  • The DD statements of SYSOUT data sets
  • Two complete job streams
  • The transaction-posting application
  • The job control requirements for a reportpreparation
  • application
  • The JCL for the report-preparation application
JCL Statements:
You use JCL to convey this information to MVS through a set of statements known as job control statements. JCL's set of job control statements is quite large, enabling you to provide a great deal of information to MVS.

Most jobs, however, can be run using a very small subset of these control statements. Once you become familiar with the characteristics of the jobs you typically run, you may find that you need to know the details of only some of the control statements.

Within each job, the control statements are grouped into job steps. A job step consists of all the control statements needed to run one program. If a job needs to run more than one program, the job would contain a different job step for each of those programs.

Table 1-1. MVS Job Control Language (JCL) Statements
Statement Name Purpose
// command





JCL command





Enters an MVS system operator
command through the input
stream. The command statement is
used primarily by the operator.
Use the COMMAND statement
instead of the JCL command
statement.
// COMMAND



command



Specifies an MVS or JES command
that the system issues when the
JCL is converted. Use the
COMMAND statement instead of the
JCL command statement.
//* comment


comment


Contains comments. The comment
statement is used primarily to
document a program and its
resource requirements.
// CNTL
control
Marks the beginning of one or
more program control statements.
// DD
data definition
Identifies and describes a data
set.
/*




delimiter




Indicates the end of data placed
in the input stream.

Note: A user can designate any
two characters to be the
delimiter.
// ENDCNTL
end control
Marks the end of one or more
program control statements.
// EXEC




execute




Marks the beginning of a job
step; assigns a name to the
step; identifies the program or
the cataloged or in-stream
procedure to be executed in this
step.
//
IF/THEN/ELSE/ENDIF
IF/THEN/ELSE/ENDI
statement
construct
Specifies conditional execution
of job steps within a job.
// INCLUDE




include




Identifies a member of a
partitioned data set (PDS) or
partitioned data set extended
(PDSE) that contains JCL
statements to be included in the
job stream.
// JCLLIB




JCL library




Identifies the libraries that
the system will search for:

° INCLUDE groups
° Procedures named in EXEC
statements.
// JOB
job
Marks the beginning of a job;
assigns a name to the job.
// null Marks the end of a job.
// OUTPUT


output JCL


Specifies the processing options
that the job entry subsystem is
to use for printing a sysout
data set.
// PEND
procedure end
Marks the end of an in-stream or
cataloged procedure.
// PROC




procedure




Marks the beginning of an
in-stream procedure and may mark
the beginning of a cataloged
procedure; assigns default
values to parameters defined in
the procedure.
// SET




set




Defines and assigns initial
values to symbolic parameters
used when processing JCL
statements. Changes or nullifies
the values assigned to symbolic
parameters.
// XMIT
transmit
Transmits input stream records
from one node to another.
Let us start with an example jcl, how it looks like, The following jcl is

used to run an cobol program. I will explain in this chapter each and every
line of this jcl. If you are already fimiliar with jcl, please skip first
6 chapters.

JCL , used to run a cobol program

//JOB1 JOB (034D),'SOUMYA PREMJI NAIR',CLASS='A',PRTY=6
//STEP01 EXEC PGM=COBPROG.
//INFILE DD DSN=SED.GLOB.DES.INFILE,DISP=SHR
//OUTIFLE DD DSN=SED.GLOB.DES.OUTFILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=DISK,
// SPACE=(CYL,(1,5),RLSE),
// DCB=(RECFM=FB,LERECL=70,BLKSIZE=700)

Now let us discuss JCL which we have seen.Before explaining, I will explain few basics about JCL.

All JCL statements can consists of up to five types of
fields

// The two forward slashes are required at the beginning of each
JCL statement in Columns 1 and 2.

Name field - This is an optional field. If coded, should start at
Column 3. It maximum length is 8.

Operation field - Which indicates the operation that is to be performed

Operand - This field must appear after Operation field. Must start at 16
column

Comments - Comments begin one space after the last operand. Our simple
example has no comments.

// Name Operation Operand

// JOB1 JOB (034D),
'SOUMYA',
CLASS='A',
PRTY=6

// STEP01 EXEC PGM=COBPROG

// INFILE DD DSN=SED.GLOB.DES.INFILE,
DISP=SHR
// OUTIFLE DD DSN=SED.GLOB.DES.OUTFILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=DISK,
// SPACE=(CYL,(1,5),RLSE),
// DCB=(RECFM=FB,
// LERECL=70,BLKSIZE=700)

The following image explain How our JCL will execute cobol program

//JOB1 JOB (034D),'SOUMYA PREMJI NAIR',CLASS='A',PRTY=6
//STEP01 EXEC PGM=COBPROG.
//INFILE DD DSN=SED.GLOB.DES.INFILE,DISP=SHR
//OUTFILE DD DSN=SED.GLOB.DES.OUTFILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=DISK,
// SPACE=(CYL,(1,5),RLSE),
// DCB=(RECFM=FB,LERECL=70,BLKSIZE=700)

//JOB1 JOB (034D),'SOUMYA PREMJI NAIR',CLASS='A',PRTY=6 - Starting of job

COBPROG - Cobol program name to be executed

OUTFILE - Output file name which is used in
SELECT OUTPUT-FILE ASSIGN TO OUTFILE.

INFILE - Input file name which is used in
SELECT INPUT-FILE ASSIGN TO INFILE.

EXPLANATION -


//JOB1 JOB (034D),'SOUMYA',CLASS='A',PRTY=6

job card is mainly used to identify job, and tell to MVS about type of job
it is, priority it has.

JOB1 is the job name
034D is accounting information
SOUMYA is name of the programmer
CLASS is category of job
PRTY is priority in the class

//STEP01 EXEC PGM=COBPROG

EXEC is used to specify the program to be executed.

STEP01 is the name of the step (you can give any name here)
COBPROG is the program name to be executed

//INFILE DD DSN=SED.GLOB.DES.INFILE,DISP=SHR

INFILE is the name of input file, which is used in cobol program

DSN=SED.GLOB.DES.INFILE - It is dataset contains actual information to be read.

DISP=SHR - means another program also can read this program while we
are reading this file.


//OUTFILE DD DSN=SED.GLOB.DES.OUTFILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=DISK,
// SPACE=(CYL,(1,5),RLSE),
// DCB=(RECFM=FB,LERECL=70,BLKSIZE=700)

OUTFILE is the name of outputfile, which is used in cobol program

DSN=SED.GLOB.DES.OUTFILE is the output file data will be written

DISP=(NEW,CATLG,DELETE) Disp specifies the disposition of dataset,

NEW - Dataset not exists, need to create
CATLG - If step executed successfully, dataset should be cataloged
DELETE - If any error occurred, Dataset should be deleted






No comments: