1 summary prev.pg. alberto romano schiesari – mvs jcl concepts

211
1 Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com MVS JCL concepts

Upload: paige-simpson

Post on 28-Mar-2015

235 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

1Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

MVS JCL concepts

Page 2: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

2Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Presentation

Thanks for using this presentation. You are free to use it.

I appreciate if you refer to the author when using it.

I’m sorry about the language errors; my english isn’t so good; I’ll appreciate if you send me any corrections and suggestions to optimize the comprehension to the reader.

The same is valid for any technical error; please help me to make this an error-free text.

Alberto Romano Schiesari – São Paulo - Brazil

www.profars.com

[email protected]

Page 3: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

3Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

SummaryIBM main operating systemsMVS lineExecuting services demandGeneral flowJES2Input spool and Output spoolInput spoolJob submission - RoscoeStacking jobs at input spoolContents of each job in the input spoolInitiatorsOutput spoolJCLJOBEXECDDLibrary searchPROCSApendix - CONTROL’s

Page 4: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

4Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Concepts

IBM main operating systems

see

http://publib.boulder.ibm.com/infocenter/zos/basics/index.jsp

Page 5: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

5Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Concepts – IBM main operating systems

IBM main operating systems

“DOS” or “VSE” line

DOS (1966)

DOS/VS (1972)

DOS/VSE (80’s)

VSE/ESA (1991)

z/VSE (2005)

Page 6: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

6Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

IBM main operating systems

“VM” line

VM/370 (1972)

VM/SP (1980)

VM/XA (1988)

VM/ESA (1990)

z/VM (2000)

Concepts – IBM main operating systems

Page 7: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

7Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Conceitos

IBM main operating systems

“Real-time” (transactional) line

ACP (1969)

TPF (1979)

z/TPF (2005)

Concepts – IBM main operating systems

Page 8: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

8Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Conceitos

IBM main operating systems

Unix-like line

UTS (1981)

AIX/370 (1990)

AIX/ESA (1991)

LINUX (1999)

Open Solaris (2008)

Concepts – IBM main operating systems

Page 9: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

9Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Conceitos

MVS line

MFT (1966) ; OS/VS1 (1972) (end)

MVT (1967)

Concepts – IBM main operating systems

OS/VS2 R1 (SVS) (1972) 24-bit addressing; Single Address Space

MVS (OSVS2 R2) (1974) 24-bit addressing; Multiple Address Spaces

MVS/370 (1981) .

MVS/XA (83) Extended Architecture

MVS/ESA (1988) Enterprise System Architeture; 31-bit addressing

OS/390 (1995) .

z/OS (2000) ; 24-,31- 64-bit addressing

z/OS 1.10 (Sep 2008)

IBM main operating systems

Page 10: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

10Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Conceitos

Each operating system has its own language to code

“scripts” and to be the formal tool to

(a) user ask operating system for service execution

(b) operating system return results and messages to the

user

This language, in MVS and derived operating systems, is

known as JCL (Job Control Language)

Concepts – IBM main operating systems

Page 11: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

11Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Conceitos

Curiosity: example of a DOS (PC’s) JCL (.bat files)

@echo off

cls

:a

ECHO Compiling %1

IF EXIST %1.OBJ DEL %1.OBJ

COBOL %1; ANIM COPYLIST > %1.LST

IF ERRORLEVEL 1 ECHO *** Error

LINK %1+%COBDIR%\ADIS+%COBDIR%\ADISKEY+%COBDIR%\ADISINIT; >> %1.LST

rem TYPE %1.LST

shift

if not "%1" == "" goto a

@ECHO

Concepts – IBM main operating systems

Page 12: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

12Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Conceitos

Curiosity: sample JCL for UNIX line (Shell Script)#!/bin/ksh#---------------------------------------------------------------------## Rotina: rsyil02.sh - Salva arquivo de retorno do Mainframe ##---------------------------------------------------------------------#BN=` basename $0 `DN=` dirname $0 `

. $DN/raet.functions

FILE=/comunnications/bi/received/rsybi02if [ -f $FILE.txt ] ; then if [ -f $FILE.txt ] ; then bkpcop $FILE.txt || exit $? scratf $FILE.txt 12 || exit $? else echo " Error. $FILE.txt does not exist" exit 1 fi \mv -f $FILE.txt $FILEelse echo " No transactions today." exit 0fi

Concepts – IBM main operating systems

Page 13: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

13Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Conceitos

Curiosity: example of JCL for the VSE line

>SUB,R,N >* BKPD047 - BACKUP D047 TO T047 * $$ JOB JNM=BKPD047,CLASS=8,USER='44-R.WALKO' * $$ PRT CLASS=B,DISP=H // JOB BKPD047 BACKUP D047 TO T047 // DLBL D047,'D047.ADPDCS.INPUT ',,VSAM,CAT=PRODCAT,BUFSP=40960 // TLBL FILEB,'T047,U' // EXEC EASYTREV INCLUDE EZBKVSES D047 VS VB 750 8352 UNLOAD /* /& * $$ EOJ

http://gsf-soft.com/Prism-CS/Samples/BKPD047.shtml

Concepts – IBM main operating systems

Page 14: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

14Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Conceitos

Curiosity: this is the equivament for the MVS line

//BKPD047 JOB (BKPD047),' ',CLASS=A,MSGCLASS=X, // MSGLEVEL=(1,1),REGION=6M //* //JOBLIB INCLUDE MEMBER=JOBLIB //STEP0010 EXEC PGM=SORT //* MODULE EASYTREV PROCESSED BY PLUG-IN LCPEZT //* VS VS I PRODCAT D047 'D047.ADPDCS.INPUT' //SORTIN DD DSN=MVS.D047.ADPDCS.INPUT,DISP=SHR //* MT O FILEB 'T047,U' //SORTOUT DD DSN=MVS.T047, // DISP=(NEW,CATLG,DELETE), // UNIT=TAPE //* PR O //SYSOUT DD SYSOUT=* //* CD I //SYSIN DD * *INCLUDE EZBKVSES D047 VS VB 750 8352 UNLOAD SORT FIELDS=COPY RECORD TYPE=V,LENGTH=750 /* //

http://gsf-soft.com/Prism-CS/Samples/BKPD047.shtml

Concepts – IBM main operating systems

Page 15: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

15Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

MVS line – executing services demand

Executing services demand

Page 16: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

16Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

MVS line – executing services demand

BE CAREFUL! ACHTUNG!

Everything you’re gonna see/read/listen

is OK for BACTH applications !

Page 17: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

17Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

MVS line – executing services demand

BE CAREFUL! ACHTUNG!

Everything you’re gonna see/read/listen

is OK for BACTH applications !

Page 18: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

18Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

MVS line – general flow

General flow

System

Service Input (execution order)

Result Outputbasically: print (paper or

“terminal”)

Page 19: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

19Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

MVS line – general flow

General flow

SYSTEM

Service Input (execution order)

?How do services get into

the system?

Page 20: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

20Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

MVS line – general flow

General flow

SYSTEM

Result Outputbasically: print (paper or

“terminal”)

?How do results get out of

the system?

Page 21: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

21Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

MVS line – general flow

General flow

There is a specific software to execute those functions (service input and result output).

It is JES2.

(Job Entry Subsystem)

Page 22: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

22Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

Therefore:

Service Input (execution order)

Result Output(basically: print on paper

or “terminal”)

JES2

JES2 components that

receive the inputs

JES2 components that send the results

out

Page 23: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

23Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

z/OS

Operating system

JES2

In other words:

Service Input (execution order)

Component 1 ...

Component 2 ...

JES2

Component n ...

Application 1

Application 2 ...

Apllication n (ex.:CICS) ...

Application x (ex.: DB2) ...

Application z ...

Result Output(basically: print on paper

or “terminal”)

Page 24: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

24Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

For example:

Services input via terminal (“sub”

command )

Results output browse via

terminal (job sysout browse)

z/OS

Operating system

Component 1 ...

Component 2 ...

JES2

Component n ...

Application 1

Application 2 ...

Apllication n (ex.:CICS) ...

Application x (ex.: DB2) ...

Application z ...

Page 25: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

25Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

But... We have to remember that:

Terminals for SUB

(they MUST be associated to an application program !!!)

z/OS

Operating system

Component 1 ...

Component 2 ...

JES2

Component n ...

Application 1

Application 2 ...

Apllication n (ex.:CICS) ...

Application x (ex.: DB2) ...

Application z ...

Terminals for BROWSE

(they MUST be associated to an application program !!!)

Page 26: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

26Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

What is (are) this (these) application program(s)?

What is the application program responsible for

this terminal?

z/OS

Operating system

Component 1 ...

Component 2 ...

JES2

Component n ...

Application 1

Application 2 ...

Apllication n (ex.:CICS) ...

Application x (ex.: DB2) ...

Application z ...

What is the application program responsible for

this terminal?

Page 27: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

27Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

JES2

It may be Roscoe...

Roscoe sends the services to the JES2

ROSCOE

Roscoe gets the results

from JES2

Page 28: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

28Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

JES2

Or TSO...

TSO

TSO sends the services to

the JES2TSO gets the results from

JES2

Page 29: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

29Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

JES2

But, even either Roscoe or TSO...

The terminal is just a visual interface

Roscoe or TSO

The terminal is just a

visual interface

Page 30: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

30Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

JES2

Where are, in fact, the data?

Where is the stream we built and submitted?

Roscoe or TSO

Where is the sysout being

accessed to browse?

Page 31: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

31Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

JES2

In disk ! In the spool areas !

Roscoe or TSO INPUT spool area

Output spool area

Page 32: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

32Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

JOB input

Let’s see some details about spool input process

Roscoe or TSOInput spool area

Page 33: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

33Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Roscoe LIB’s(proprietary data

organization)(SAVE or UPDATE)

JOB input – TSO/ROSCOENOTE : use of ROSCOE

(data manipulation via AWS)...

Roscoe

Roscoe work area (AWS)(create / FETCH/ATTACH)

Page 34: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

34Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Sequential dataset

JOB input – TSO/ROSCOENOTE : ... or TSO

(data manipulation directly in the “normal” datsets areas)

TSO

Partitioned dataset member

Page 35: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

35Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Edited data To be submitted

JOB input – TSO/ROSCOENOTE : we’ll refer to data manipulation using

Roscoe or TSO using this figure

TSO/Roscoe

Page 36: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

36Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input – TSO/ROSCOE

Step 1 = edit data to be submitted

TSO/Roscoe

Edited data

To be submitted

Page 37: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

37Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input – TSO/ROSCOE

Step 1 = edit data to be submitted

TSO/Roscoe

//PSTARS3T JOB (1234),'ALBERTO',CLASS=T,MSGCLASS=O //STEP1 EXEC ASMACLG //C.SYSIN DD * PROGRAMA START 0 ENTRAR BAL R14,ROTMAIN PROG PROPRIAMENTE DITO SAIR DC A(0) SAVEAREA DO ENDERECO VOLTA ROTMAIN ST R14,*-4 SALVA ENDERECO VOLTA OPEN (AGENCIAS,INPUT) ABRE ARQUIVO LEITURA BAL 14,LEREG LE REGISTRO CLI FLAGFIM,C'Y' END OF FILE? BE ACABAR SE SIM, TERMINAR O PROGRAMA AP LIDOS,=P'1' CONTA REGISTROS LIDOS B LEITURA VOLTA A LER ACABAR CLOSE (AGENCIAS) FECHA ARQUIVO L R14,ROTMAIN-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA DC A(0) SAVEAREA DO ENDERECO DE VOLTA LEREG ST R14,*-4 SALVA ENDERECO DE VOLTA B SAILER VAI PARA SAIDA FIMAG MVI FLAGFIM,C'Y' MARCA QUE ARQUIVO ACABOU SAILER L R14,LEREG-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA * DECLARACAO DE ARQUIVOS E AREAS RELAT DCB LRECL=133,DSORG=PS,RECFM=FA,DDNAME=SYSPRINT,MACRF=PM AGENCIAS DCB LRECL=80,DSORG=PS,DDNAME=AGENCIAS,MACRF=GM,EODAD=FIMAG FLAGFIM DC C'N' FLAG INDICA FIM ARQ ENTRADALAG DS CL80 AREA PARA LEITURA ARQUIVO END , ULTIMO STMT FONTE //G.SYSPRINT DD SYSOUT=* //G.SYSOUT DD SYSOUT=* //G.AGENCIAS DD * 0001NOME DA AGENCIA 0001---------*0002NOME DA AGENCIA 0002---------*0003NOME DA AGENCIA 0003---------*0004NOME DA AGENCIA 0004---------*

Page 38: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

38Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input – TSO/ROSCOE

Another sight...

Roscoe

JOB Statement

1st step components (assembly = execution of Assembler program)

2nd step components (linkedit = execution of linkeditor program)

3rd step components (my program)

Page 39: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

39Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input – TSO/ROSCOE

A c-a-r-e-f-u-l analysys of the data to be submitted...

TSO/Roscoe

//PSTARS3T JOB (1234),'ALBERTO',CLASS=T,MSGCLASS=O//STEP1 EXEC ASMACLG //C.SYSIN DD * PROGRAMA START 0 ENTRAR BAL R14,ROTMAIN PROG PROPRIAMENTE DITO SAIR DC A(0) SAVEAREA DO ENDERECO VOLTA ROTMAIN ST R14,*-4 SALVA ENDERECO VOLTA OPEN (AGENCIAS,INPUT) ABRE ARQUIVO LEITURA BAL 14,LEREG LE REGISTRO CLI FLAGFIM,C'Y' END OF FILE? BE ACABAR SE SIM, TERMINAR O PROGRAMA AP LIDOS,=P'1' CONTA REGISTROS LIDOS B LEITURA VOLTA A LER ACABAR CLOSE (AGENCIAS) FECHA ARQUIVO L R14,ROTMAIN-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA DC A(0) SAVEAREA DO ENDERECO DE VOLTA LEREG ST R14,*-4 SALVA ENDERECO DE VOLTA B SAILER VAI PARA SAIDA FIMAG MVI FLAGFIM,C'Y' MARCA QUE ARQUIVO ACABOU SAILER L R14,LEREG-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA * DECLARACAO DE ARQUIVOS E AREAS RELAT DCB LRECL=133,DSORG=PS,RECFM=FA,DDNAME=SYSPRINT,MACRF=PM AGENCIAS DCB LRECL=80,DSORG=PS,DDNAME=AGENCIAS,MACRF=GM,EODAD=FIMAG FLAGFIM DC C'N' FLAG INDICA FIM ARQ ENTRADALAG DS CL80 AREA PARA LEITURA ARQUIVO END , ULTIMO STMT FONTE //G.SYSPRINT DD SYSOUT=* //G.SYSOUT DD SYSOUT=* //G.AGENCIAS DD * 0001NOME DA AGENCIA 0001---------*0002NOME DA AGENCIA 0002---------*0003NOME DA AGENCIA 0003---------*0004NOME DA AGENCIA 0004---------*

Page 40: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

40Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input – TSO/ROSCOE

Another sight, the stream as a whole ...

TSO/Roscoe

//PSTARS3T JOB (1234),'ALBERTO', // CLASS=T,MSGCLASS=O //STEP1 EXEC ASMACLG //C.SYSIN DD * Step C, SYSIN dataset data //G.SYSPRINT DD SYSOUT=* //G.SYSOUT DD SYSOUT=* //G.AGENCIAS DD * Step G, AGENCIAS dataset data

Red = JCL

Blue = data

Page 41: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

41Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input – TSO/ROSCOE

Another way to view the data ...

TSO/Roscoe

//PSTARS3T JOB (1234),‘ALBERTO', // CLASS=T,MSGCLASS=O //STEP1 EXEC ASMACLG //C.SYSIN DD * //G.SYSPRINT DD SYSOUT=* //G.SYSOUT DD SYSOUT=* //G.AGENCIAS DD *

Red = JCL Blue = data

Step C, SYSIN dataset data

Step G, AGENCIAS dataset data

Page 42: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

42Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input – TSO/ROSCOE

Getting back to the relationship between Roscoe and JES...

TSO/Roscoe

//PSTARS3T JOB (9526),'ALBERTO',CLASS=T,MSGCLASS=O //STEP1 EXEC ASMACLG //C.SYSIN DD * PROGRAMA START 0 ENTRAR BAL R14,ROTMAIN PROG PROPRIAMENTE DITO SAIR DC A(0) SAVEAREA DO ENDERECO VOLTA ROTMAIN ST R14,*-4 SALVA ENDERECO VOLTA OPEN (AGENCIAS,INPUT) ABRE ARQUIVO LEITURA BAL 14,LEREG LE REGISTRO CLI FLAGFIM,C'Y' END OF FILE? BE ACABAR SE SIM, TERMINAR O PROGRAMA AP LIDOS,=P'1' CONTA REGISTROS LIDOS B LEITURA VOLTA A LER ACABAR CLOSE (AGENCIAS) FECHA ARQUIVO L R14,ROTMAIN-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA DC A(0) SAVEAREA DO ENDERECO DE VOLTA LEREG ST R14,*-4 SALVA ENDERECO DE VOLTA B SAILER VAI PARA SAIDA FIMAG MVI FLAGFIM,C'Y' MARCA QUE ARQUIVO ACABOU SAILER L R14,LEREG-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA * DECLARACAO DE ARQUIVOS E AREAS RELAT DCB LRECL=133,DSORG=PS,RECFM=FA,DDNAME=SYSPRINT,MACRF=PM AGENCIAS DCB LRECL=80,DSORG=PS,DDNAME=AGENCIAS,MACRF=GM,EODAD=FIMAG FLAGFIM DC C'N' FLAG INDICA FIM ARQ ENTRADAFLAG DS CL80 AREA PARA LEITURA ARQUIVO END , ULTIMO STMT FONTE //G.SYSPRINT DD SYSOUT=* //G.SYSOUT DD SYSOUT=* //G.AGENCIAS DD * 0001NOME DA AGENCIA 0001---------*0002NOME DA AGENCIA 0002---------*0003NOME DA AGENCIA 0003---------*0004NOME DA AGENCIA 0004---------*

Page 43: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

43Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

JOB input – TSO/ROSCOE

TSO/Roscoe

Input spool area

Edited data

Roscoe submits (delivers) the stream that came from AWS to JES...

SUB

Page 44: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

44Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

JOB input – TSO/ROSCOE

TSO/Roscoe

Input spool area

AWS

The JES component that reads the things somebody (Roscoe, TSO...)

submitted is (are) the READER(s) / INTERPRETER(s)

SUB

Reader

Page 45: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

45Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

AWS

JES2

JOB input – TSO/ROSCOE

Input spool area

There are several READER/INTERPRETER(s); they get the records from

the submitted JOBs; while reading, they validate some information before

send to the spool (that’s because the “interpreter”)

Readers

TSO Roscoe

SUBSUB“Normal” datasets

Page 46: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

46Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

AWS

JES2

JOB input

Input spool area

Let’s see better the input spool area

Readers

TSO Roscoe

SUBSUB“Normal” datasets

Page 47: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

47Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input

Input spool area : the archieving unit is the JOB

JOB0001 JOB0002 JOB0003 JOB0004 JOB0005

JOB0006 JOB0007 JOB0008 Etc...

Page 48: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

48Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input

The JOBS are queued based on the entry sequence; each Job receive an

Id #, that will follow it throughout its whole life.

JOB0001 JOB0002 JOB0003 JOB0004 JOB0005

JOB0006 JOB0007 JOB0008 Etc...

Page 49: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

49Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input

The JOBS remains in the queue awaiting execution.

JOB0001 JOB0002 JOB0003 JOB0004 JOB0005

JOB0006 JOB0007 JOB0008 Etc...

Page 50: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

50Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input

Let’s see some details about how the Jobs are stored.

Let’s detail one of them (JOB0001):

JOB0001ALL JCL records

(statements)

(one single dataset)For each in-stream dataset in the submitted stream, is

created a file identified with stepname + DDname

Page 51: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

51Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input

Example: if this stream (ref. JOB0001) is submitted

//PSTARS3T JOB (1234),'ALBERTO',CLASS=T,MSGCLASS=O //STEP1 EXEC PGM=PGTST01,PARM=‘TOT=YES' //STEP2 EXEC PGM=PGTST02

Page 52: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

52Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input

The input spool data related to JOB0001 is as follows:

JOB0001

//PSTARS3T JOB (123),'ALBERTO',CLASS=T,MSGCLASS=O //STEP1 EXEC PGM=PGTST01,PARM=‘TOT=YES‘//STEP2 EXEC PGM=PGTST02

There is no datasets related to in-stream data, because there is no in-stream data

//PSTARS3T JOB (1234),'ALBERTO',CLASS=T,MSGCLASS=O //STEP1 EXEC PGM=PGTST01,PARM=‘TOT=YES' //STEP2 EXEC PGM=PGTST02

Page 53: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

53Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input

Example: if this stream is submitted (ref. JOB0002)

//PSTARS3T JOB (1234),'ALBERTO',CLASS=T,MSGCLASS=O //STEP1 EXEC PGM=PGTST01,PARM=‘TOT=YES' //STEP2 EXEC PGM=PGTST02//STEP3 EXEC PGM=IDCAMS//SYSOUT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSIN DD * DELETE DES.ALB.A001 PURGE /* DELETE DATASET */

Page 54: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

54Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input

The input spool related to JOB0002 is as follows:

JOB0002

//PSTARS3T JOB (1234),'ALBERTO',CLASS=T,MSGCLASS=O //STEP1 EXEC PGM=PGTST01,PARM=‘TOT=YES' //STEP2 EXEC PGM=PGTST02//STEP3 EXEC PGM=IDCAMS//SYSOUT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSIN DD *

Step=STEP3 ; DD=SYSIN

DELETE DES.ALB.A001 PURGE /* DELETA DATASET */

//PSTARS3T JOB (1234),'ALBERTO',CLASS=T,MSGCLASS=O //STEP1 EXEC PGM=PGTST01,PARM=‘TOT=YES' //STEP2 EXEC PGM=PGTST02//STEP3 EXEC PGM=IDCAMS//SYSOUT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSIN DD * DELETE DES.ALB.A001 PURGE /* DELETA DATASET */

Page 55: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

55Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input

Getting back to the original JOB, that with the 3 steps (compile, link & go of an

assembler program); suppose that the id is JOB1234//PSTARS3T JOB (1234),'ALBERTO',CLASS=T,MSGCLASS=O //STEP1 EXEC ASMACLG //C.SYSIN DD * PROGRAMA START 0 ENTRAR BAL R14,ROTMAIN PROG PROPRIAMENTE DITO SAIR DC A(0) SAVEAREA DO ENDERECO VOLTA ROTMAIN ST R14,*-4 SALVA ENDERECO VOLTA OPEN (AGENCIAS,INPUT) ABRE ARQUIVO LEITURA BAL 14,LEREG LE REGISTRO CLI FLAGFIM,C'Y' END OF FILE? BE ACABAR SE SIM, TERMINAR O PROGRAMA AP LIDOS,=P'1' CONTA REGISTROS LIDOS B LEITURA VOLTA A LER ACABAR CLOSE (AGENCIAS) FECHA ARQUIVO L R14,ROTMAIN-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA DC A(0) SAVEAREA DO ENDERECO DE VOLTA LEREG ST R14,*-4 SALVA ENDERECO DE VOLTA B SAILER VAI PARA SAIDA FIMAG MVI FLAGFIM,C'Y' MARCA QUE ARQUIVO ACABOU SAILER L R14,LEREG-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA * DECLARACAO DE ARQUIVOS E AREAS RELAT DCB LRECL=133,DSORG=PS,RECFM=FA,DDNAME=SYSPRINT,MACRF=PM AGENCIAS DCB LRECL=80,DSORG=PS,DDNAME=AGENCIAS,MACRF=GM,EODAD=FIMAG FLAGFIM DC C'N' FLAG INDICA FIM ARQUIVO ENTRADALAG DS CL80 AREA PARA LEITURA ARQUIVO END , ULTIMO STMT FONTE //G.SYSPRINT DD SYSOUT=* //G.SYSOUT DD SYSOUT=* //G.AGENCIAS DD * 0001NOME DA AGENCIA 0001---------*0002NOME DA AGENCIA 0002---------*0003NOME DA AGENCIA 0003---------*0004NOME DA AGENCIA 0004---------*

Page 56: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

56Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input

It has JCL and in-stream data

//PSTARS3T JOB (1234),'ALBERTO',CLASS=T,MSGCLASS=O //STEP1 EXEC ASMACLG //C.SYSIN DD * PROGRAMA START 0 ENTRAR BAL R14,ROTMAIN PROG PROPRIAMENTE DITO SAIR DC A(0) SAVEAREA DO ENDERECO VOLTA ROTMAIN ST R14,*-4 SALVA ENDERECO VOLTA OPEN (AGENCIAS,INPUT) ABRE ARQUIVO LEITURA BAL 14,LEREG LE REGISTRO CLI FLAGFIM,C'Y' END OF FILE? BE ACABAR SE SIM, TERMINAR O PROGRAMA AP LIDOS,=P'1' CONTA REGISTROS LIDOS B LEITURA VOLTA A LER ACABAR CLOSE (AGENCIAS) FECHA ARQUIVO L R14,ROTMAIN-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA DC A(0) SAVEAREA DO ENDERECO DE VOLTA LEREG ST R14,*-4 SALVA ENDERECO DE VOLTA B SAILER VAI PARA SAIDA FIMAG MVI FLAGFIM,C'Y' MARCA QUE ARQUIVO ACABOU SAILER L R14,LEREG-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA * DECLARACAO DE ARQUIVOS E AREAS RELAT DCB LRECL=133,DSORG=PS,RECFM=FA,DDNAME=SYSPRINT,MACRF=PM AGENCIAS DCB LRECL=80,DSORG=PS,DDNAME=AGENCIAS,MACRF=GM,EODAD=FIMAG FLAGFIM DC C'N' FLAG INDICA FIM ARQUIVO ENTRADALAG DS CL80 AREA PARA LEITURA ARQUIVO END , ULTIMO STMT FONTE //G.SYSPRINT DD SYSOUT=* //G.SYSOUT DD SYSOUT=* //G.AGENCIAS DD * 0001NOME DA AGENCIA 0001---------*0002NOME DA AGENCIA 0002---------*0003NOME DA AGENCIA 0003---------*0004NOME DA AGENCIA 0004---------*

Page 57: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

57Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB inputThe input spool related to JOB1234 is (almost...) as follows:

JOB1234

//PSTARS3T JOB (1234),‘ALBERTO',CLASS=T,MSGCLASS=O //STEP1 EXEC ASMACLG //C.SYSIN DD * //G.SYSPRINT DD SYSOUT=* //G.SYSOUT DD SYSOUT=* //G.AGENCIAS DD *

Step=G ; DD=AGENCIAS0001NOME DA AGENCIA 0001---------*0002NOME DA AGENCIA 0002---------*0003NOME DA AGENCIA 0003---------*0004NOME DA AGENCIA 0004---------*

Step=C ; DD=SYSINPROGRAMA START 0 ENTRAR BAL R14,ROTMAIN PROG PROPRIAMENTE DITO SAIR DC A(0) SAVEAREA DO ENDERECO VOLTA ROTMAIN ST R14,*-4 SALVA ENDERECO VOLTA OPEN (AGENCIAS,INPUT) ABRE ARQUIVO LEITURA BAL 14,LEREG LE REGISTRO CLI FLAGFIM,C'Y' END OF FILE? BE ACABAR SE SIM, TERMINAR O PROGRAMA AP LIDOS,=P'1' CONTA REGISTROS LIDOS B LEITURA VOLTA A LER ACABAR CLOSE (AGENCIAS) FECHA ARQUIVO L R14,ROTMAIN-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA DC A(0) SAVEAREA DO ENDERECO DE VOLTA LEREG ST R14,*-4 SALVA ENDERECO DE VOLTA B SAILER VAI PARA SAIDA FIMAG MVI FLAGFIM,C'Y' MARCA QUE ARQUIVO ACABOU SAILER L R14,LEREG-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA * DECLARACAO DE ARQUIVOS E AREAS RELAT DCB LRECL=133,DSORG=PS,RECFM=FA,DDNAME=SYSPRINT,MACRF=PM AGENCIAS DCB LRECL=80,DSORG=PS,DDNAME=AGENCIAS,MACRF=GM,EODAD=FIMAG FLAGFIM DC C'N' FLAG INDICA FIM ARQUIVO ENTRADALAG DS CL80 AREA PARA LEITURA ARQUIVO

END , ULTIMO STMT FONTE

Page 58: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

58Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB inputIn fact, JCL is already EXPANDED (details when we’ll see PROCs)

JOB1234 1 //PSTARS3T JOB (1234),'ALBERTO',CLASS=T,MSGCLASS=O 2 //STEP1 EXEC ASMACLG 3 XXASMACLG PROC 4 XXC EXEC PGM=ASMA90 5 XXSYSLIB DD DSN=SYS1.MACLIB,DISP=SHR 6 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(4096,(120,120),,,ROUND), XX UNIT=SYSALLDA,DCB=BUFNO=1 7 XXSYSPRINT DD SYSOUT=* 8 XXSYSLIN DD DSN=&&OBJ,SPACE=(3040,(40,40),,,ROUND), XX UNIT=SYSALLDA,DISP=(MOD,PASS), XX DCB=(BLKSIZE=3040,LRECL=80,RECFM=FB,BUFNO=1) 9 //C.SYSIN DD * 10 XXL EXEC PGM=HEWL,PARM='MAP,LET,LIST',COND=(8,LT,C) 11 XXSYSLIN DD DSN=&&OBJ,DISP=(OLD,DELETE) 12 XX DD DDNAME=SYSIN 13 XXSYSLMOD DD DISP=(,PASS),UNIT=SYSALLDA,SPACE=(CYL,(1,1,1)), XX DSN=&&GOSET(GO) 14 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(1024,(120,120),,,ROUND), XX UNIT=SYSALLDA,DCB=BUFNO=1 15 XXSYSPRINT DD SYSOUT=* 16 XXG EXEC PGM=*.L.SYSLMOD,COND=((8,LT,C),(8,LT,L)) 17 //G.SYSPRINT DD SYSOUT=* 18 //G.SYSOUT DD SYSOUT=* 19 //G.AGENCIAS DD *

Page 59: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

59Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB inputFINALLY !!! JOB1234 “final” format is:

JOB1234 1 //PSTARS3T JOB (1234),'ALBERTO',CLASS=T,MSGCLASS=O 2 //STEP1 EXEC ASMACLG 3 XXASMACLG PROC 4 XXC EXEC PGM=ASMA90 5 XXSYSLIB DD DSN=SYS1.MACLIB,DISP=SHR 6 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(4096,(120,120),,,ROUND), XX UNIT=SYSALLDA,DCB=BUFNO=1 7 XXSYSPRINT DD SYSOUT=* 8 XXSYSLIN DD DSN=&&OBJ,SPACE=(3040,(40,40),,,ROUND), XX UNIT=SYSALLDA,DISP=(MOD,PASS), XX DCB=(BLKSIZE=3040,LRECL=80,RECFM=FB,BUFNO=1) 9 //C.SYSIN DD * 10 XXL EXEC PGM=HEWL,PARM='MAP,LET,LIST',COND=(8,LT,C) 11 XXSYSLIN DD DSN=&&OBJ,DISP=(OLD,DELETE) 12 XX DD DDNAME=SYSIN 13 XXSYSLMOD DD DISP=(,PASS),UNIT=SYSALLDA,SPACE=(CYL,(1,1,1)), XX DSN=&&GOSET(GO) 14 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(1024,(120,120),,,ROUND), XX UNIT=SYSALLDA,DCB=BUFNO=1 15 XXSYSPRINT DD SYSOUT=* 16 XXG EXEC PGM=*.L.SYSLMOD,COND=((8,LT,C),(8,LT,L)) 17 //G.SYSPRINT DD SYSOUT=* 18 //G.SYSOUT DD SYSOUT=* 19 //G.AGENCIAS DD *

Step=G ; DD=AGENCIAS0001NOME DA AGENCIA 0001---------*0002NOME DA AGENCIA 0002---------*0003NOME DA AGENCIA 0003---------*0004NOME DA AGENCIA 0004---------*

Step=C ; DD=SYSINPROGRAMA START 0 ENTRAR BAL R14,ROTMAIN PROG PROPRIAMENTE DITO SAIR DC A(0) SAVEAREA DO ENDERECO VOLTA ROTMAIN ST R14,*-4 SALVA ENDERECO VOLTA OPEN (AGENCIAS,INPUT) ABRE ARQUIVO LEITURA BAL 14,LEREG LE REGISTRO CLI FLAGFIM,C'Y' END OF FILE? BE ACABAR SE SIM, TERMINAR O PROGRAMA AP LIDOS,=P'1' CONTA REGISTROS LIDOS B LEITURA VOLTA A LER ACABAR CLOSE (AGENCIAS) FECHA ARQUIVO L R14,ROTMAIN-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA DC A(0) SAVEAREA DO ENDERECO DE VOLTA LEREG ST R14,*-4 SALVA ENDERECO DE VOLTA B SAILER VAI PARA SAIDA FIMAG MVI FLAGFIM,C'Y' MARCA QUE ARQUIVO ACABOU SAILER L R14,LEREG-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA * DECLARACAO DE ARQUIVOS E AREAS RELAT DCB LRECL=133,DSORG=PS,RECFM=FA,DDNAME=SYSPRINT,MACRF=PM AGENCIAS DCB LRECL=80,DSORG=PS,DDNAME=AGENCIAS,MACRF=GM,EODAD=FIMAG FLAGFIM DC C'N' FLAG INDICA FIM ARQUIVO ENTRADALAG DS CL80 AREA PARA LEITURA ARQUIVO

END , ULTIMO STMT FONTE

Page 60: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

60Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB inputOK? No doubts? We’ll talk about that again soon...

JOB1234

1 dataset with all JCL, already expanded

Step=ssssssss ; DD=dddddddd

1 dataset for each in-streamdataset

Page 61: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

61Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB input

Getting back to the matter, there was a queue of JOBs waiting for execution...

JOB0001 JOB0002 JOB0003 JOB0004 JOB0005

JOB0006 JOB0007 JOB0008 Etc...

Page 62: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

62Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

z/OS

Operating System

JOB input

For job execution, there are other system components: the

INITIATORs

Component 1 ...

Initiator’s

JES2

Component n ...

Application program 1

Application program o 2 ...

Application program n (ex.:CICS) ...

Application program x (ex.: DB2) ...

Application program z ...

Input spool area JOBS

Selection for execution

Page 63: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

63Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

They (the INITIATORs) do the selection (pick up 1 at a time) of

the “waiting-for-execution” job(s) and begin their execution.

Initiator’sInput spoolArea JOBS

Selection for execution

What is the criteria for the selection?

The JOB class.

Page 64: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

64Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

Each initiator deals with some pre-defined classes. Ex.

INIT 1 = jobs classes A, B and C

INIT 2 = jobs classes D, E and F

INIT 1 : server for jobs class A, B and C; in the example, this INIT will select the jobs 0001 e

0002.

Input spool: Job queue (jobs waiting for execution)

JOB0001 (class A)

JOB0002 (class B)

JOB0003 (class R)

JOB0004 (class D)

JOB0005 (class E)

JOB0006 (class T)

Etc...

INIT 2 : server for jobs class D, E and F; in the example, this INIT will select the jobs 0004 e

0005.

While there is no INIT serving classes R and/or T, the jobs 0003 and 0006 won’t be executed

(selected for execution)

Page 65: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

65Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

Example: see the list of INITs as shown by Roscoe’ DIS INIT command:

 > APPLID(EMPROSCD) USER(OB3,ARS243) > ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8INIT 1 ACTIVE JOB00716 ADP#6IA (1) PVAG1 0:17:13 C=12345 INIT 2 ACTIVE JOB01873 NDVJD000 (1) COPYDIR 0:05:04 C=21345 INIT 3 ACTIVE JOB00809 SCO#END (1) NDVRBAT 0:01:15 C=32154 INIT 4 INACTIVE C=0 INIT 5 INACTIVE C=85 INIT 6 ACTIVE JOB00789 OCC#SCL (9) NDVRBAT 0:05:05 C=9 INIT 7 INACTIVE C=QP INIT 8 ACTIVE JOB00812 FIN#T305 (S) STEP002 0:01:00 C=QS INIT 9 INACTIVE C=QR INIT 10 ACTIVE JOB00605 CPC#BUS (A) NDVRBAT 0:28:38 C=YA INIT 11 ACTIVE JOB00771 SCO#ALB (Y) NDVRBAT 0:08:08 C=YU INIT 12 ACTIVE JOB00819 NDVJPKPR (Z) BC1JPCKG 0:00:05 C=ZB INIT 13 INACTIVE C=CT INIT 14 INACTIVE C=ZN INIT 15 ACTIVE JOB00782 SCO#A005 (W) STEP1 0:06:13 C=W

 

Page 66: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

66Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

ExecutionEx.: INIT 1 = serves jobs with classes A, B and C.

The SELECTION PRIORITY is basically FIFO.

Then, JOB0001 is selected first, and JOB0002 is selected after

JOB0001

INIT 1 : serves jobs with classes A, B and C; in the example, INIT 1 will select jobs 0001 and

0002.

Selection priority: basically FIFO

(First In First Out)

Input spool: Job queue (jobs waiting for execution)

JOB0001 (class A)

JOB0002 (class B)

JOB0003 (class R)

JOB0004 (class D)

JOB0005 (class E)

JOB0006 (class T)

Etc...

Page 67: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

67Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

INIT 1 selected JOB0001

INIT 1 : selected JOB0001 for execution

Input spool: Job queue (jobs waiting for execution)

JOB0001 (class A)JOB0002 (class B)

JOB0003 (class R)

JOB0004 (class D)

JOB0005 (class E)

JOB0006 (class T)

Etc...

Page 68: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

68Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

INIT 1 pick up the information related to each step

(program execution order [EXEC] +

information about the datasets the program uses [DD] )

to do some things.

Process each STEP

Input spool: Job queue (jobs waiting for execution)

JOB0001 (class A)JOB0002 (class B)

JOB0003 (class R)

JOB0004 (class D)

JOB0005 (class E)

JOB0006 (class T)

Etc...

Page 69: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

69Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

1st. step :

- Identify which program must be executed (PGM=xxxxxxxx)

- Verify DISP of each DD:

-- IF DISP=OLD or DISP=SHR or DISP=MOD, verify whether the

dataset already exists, whether it is reserved / locked for another

user, etc...

- If DISP=NEW, create the dataset (does it exist? Is there enough

room? etc...)

- Ask LOADER to fetch program from the right library (is there

STEPLIB? Is there JOBLIB?)

Let everything set up so that OPEN can go smoothly... (*)

(*) unless the program uses DYNALLOC... As CICS does...

Page 70: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

70Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

( Starting parenthesis...

Page 71: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

71Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

Dataset allocation:

(a) outside program, before starting the execution

(by initiator); information is provided by DD statement

(b) by the program (dinamically); in this case:

- no DD needed

- allocation is done by a service ordered to the operating

system (via macro / SVC) called DYNALLOC

(dynamic allocation)

- program must process the “no allocation possible” condition

Page 72: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

72Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

) Ending parenthesis...

Page 73: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

73Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

1st. step :

Everything OK?

Then you can call the program for execution.

Order LOADER to fetch program and transfer control (remember

PSW? remember entry-point?) to the program’s 1st instruction.

In other words, (talking in assemblish...): INIT orders the

BALR 14,15 to transfer control to the program.

Page 74: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

74Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

1st. step :

Our program is executed.

What does it mean? It means that CPU executes its instructions.

But...

There are dozens of other programs that need to use the CPU time,

dreaming of CPU executing its instructions.

That’s when the dispatching priority comes.

It determines the privileges (or none) my program has in the

algorithm that determines how much time each cuncurrent

program get from CPU.

Page 75: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

75Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

1st. step :

What if a dataset is read, and the dataset is available via DD * ?

When OPEN is issued, the access method receives information (set

up by JES2) that the dataset is awaiting at the input job spool

(identified by its stepname and ddname).

Therefore our program is going to read data directly from input

spool area.

Page 76: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

76Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

JOB1234 1 //PSTARS3T JOB (1234),'ALBERTO',CLASS=T,MSGCLASS=O 2 //STEP1 EXEC ASMACLG 3 XXASMACLG PROC 4 XXC EXEC PGM=ASMA90 5 XXSYSLIB DD DSN=SYS1.MACLIB,DISP=SHR 6 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(4096,(120,120),,,ROUND), XX UNIT=SYSALLDA,DCB=BUFNO=1 7 XXSYSPRINT DD SYSOUT=* 8 XXSYSLIN DD DSN=&&OBJ,SPACE=(3040,(40,40),,,ROUND), XX UNIT=SYSALLDA,DISP=(MOD,PASS), XX DCB=(BLKSIZE=3040,LRECL=80,RECFM=FB,BUFNO=1) 9 //C.SYSIN DD * 10 XXL EXEC PGM=HEWL,PARM='MAP,LET,LIST',COND=(8,LT,C) 11 XXSYSLIN DD DSN=&&OBJ,DISP=(OLD,DELETE) 12 XX DD DDNAME=SYSIN 13 XXSYSLMOD DD DISP=(,PASS),UNIT=SYSALLDA,SPACE=(CYL,(1,1,1)), XX DSN=&&GOSET(GO) 14 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(1024,(120,120),,,ROUND), XX UNIT=SYSALLDA,DCB=BUFNO=1 15 XXSYSPRINT DD SYSOUT=* 16 XXG EXEC PGM=*.L.SYSLMOD,COND=((8,LT,C),(8,LT,L)) 17 //G.SYSPRINT DD SYSOUT=* 18 //G.SYSOUT DD SYSOUT=* 19 //G.AGENCIAS DD *

Step=G ; DD=AGENCIAS0001NOME DA AGENCIA 0001---------*0002NOME DA AGENCIA 0002---------*0003NOME DA AGENCIA 0003---------*0004NOME DA AGENCIA 0004---------*

Step=C ; DD=SYSINPROGRAMA START 0 ENTRAR BAL R14,ROTMAIN PROG PROPRIAMENTE DITO SAIR DC A(0) SAVEAREA DO ENDERECO VOLTA ROTMAIN ST R14,*-4 SALVA ENDERECO VOLTA OPEN (AGENCIAS,INPUT) ABRE ARQUIVO LEITURA BAL 14,LEREG LE REGISTRO CLI FLAGFIM,C'Y' END OF FILE? BE ACABAR SE SIM, TERMINAR O PROGRAMA AP LIDOS,=P'1' CONTA REGISTROS LIDOS B LEITURA VOLTA A LER ACABAR CLOSE (AGENCIAS) FECHA ARQUIVO L R14,ROTMAIN-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA DC A(0) SAVEAREA DO ENDERECO DE VOLTA LEREG ST R14,*-4 SALVA ENDERECO DE VOLTA B SAILER VAI PARA SAIDA FIMAG MVI FLAGFIM,C'Y' MARCA QUE ARQUIVO ACABOU SAILER L R14,LEREG-4 RESTAURA ENDERECO VOLTA BR R14 VOLTA * DECLARACAO DE ARQUIVOS E AREAS RELAT DCB LRECL=133,DSORG=PS,RECFM=FA,DDNAME=SYSPRINT,MACRF=PM AGENCIAS DCB LRECL=80,DSORG=PS,DDNAME=AGENCIAS,MACRF=GM,EODAD=FIMAG FLAGFIM DC C'N' FLAG INDICA FIM ARQUIVO ENTRADALAG DS CL80 AREA PARA LEITURA ARQUIVO

END , ULTIMO STMT FONTE

Program reads directly

from here

1st. step :

Page 77: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

77Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

1st. step :

Our program finishes.

Talking in “assemblish”, on the last BR 14, control is returned to

initiator; especifically to a little-sub-component called terminator:

it verifies the end-of-execution type (normal, abnormal), Return

Code, closes the non-closed datasets, etc.

Page 78: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

78Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

2nd. step and so on:

Process is repeated for all JOB steps, including the Return Code

test (COND...), to know whether or not the step must be executed,

flushed, etc...

Page 79: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

79Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

OK?Job input OK?

Page 80: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

80Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Execution

Time to start understanding output

spooling system

Page 81: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

81Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

Result output (reports)

A bunch of people access data from the output spool.

Roscoe (CA software) or

TSO (IBM software)

Output spool area

Control

(BMC softwares)

Page 82: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

82Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

Result output (reports)

Who “writes” on the output spool?

Application programs

Output spool area

Operating System and its components (including JES2)

Page 83: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

83Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

Result output (reports)Everybody “prints” something...

Application programs and operating system.

Application programs

Output spool area

Operating System and its components (including JES2)

Page 84: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

84Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

Result output (reports)But... In fact, only JES2 really writes.

Do you know why?

Application Programs

Output spool area

Operating System and its components (including JES2)

Page 85: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

85Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

Result output (reports)Because everybody “printing” is intercepted by JES, and JES redirects

those lines to the output spool area. JES is its administrator.

This is done naturally if output is specified as SYSOUT=xxx

Application programs

Output spool area

Operating System and its components (including JES2)

Page 86: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

86Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

Result output (reports)

What about the operating system outputs?

They are redirected to where especified at MSGCLASS=xxx

Output spool area

Operating system and its components (including JES2)

Page 87: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

87Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

Result output (reports)

What about the application programs’ output?

They are redirected to where especified at SYSOUT=xxx

Output spool area

Application programs

Page 88: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

88Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

Result output (reports)

But what is that xxx?

Application programs

?

Operating Systems and its components (including JES2)

Page 89: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

89Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JES2

Result output (reports)

It is the output class.

Application Programs

There is n datsets for each job,

Each one has an associated

class

Opertating System and its components (including JES2)

Page 90: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

90Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB

Result output (reports)Unless otherwise specified at MSGLEVEL, system generates 3 reports about the

JCL processing:

JES2.JESMSGLG = job events log (start, end, etc)

JES2.JESJCL = expanded JCL

JES2.JESYSMSG = initiator / terminator messages

JOB1234 , file JES2.JESJCL, class RLine 1 Relat1...Etc...

JOB1234 , file JES2.JESYSMSG, class RLine 1 Relat2...Etc...

JOB1234 , file JES2.JESMSGLG, class RLine 1 file 1...Etc...

Page 91: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

91Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Result output (reports)

JES2.JESMSGLG example ( truncated at right)

J E S 2 J O B L O G -- S Y S T E M D 1 T -- 15.42.13 JOB04227 ---- FRIDAY, 28 AUG 2009 ---- 15.42.13 JOB04227 IRR010I USERID D839471 IS ASSIGNED TO THIS JOB. 15.42.13 JOB04227 ******* PSTARS3T *--------------------------Sepro-41* 15.42.13 JOB04227 IEF196I ******* PSTARS3T *--------------------------Se15.42.13 JOB04227 ******* PSTARS3T * IEFUJV PROCESSING COMPLETE * 15.42.13 JOB04227 IEF196I ******* PSTARS3T * IEFUJV PROCESSING COMPLETE 15.42.13 JOB04227 ******* PSTARS3T *--------------------------Sepro-41* 15.42.13 JOB04227 IEF196I ******* PSTARS3T *--------------------------Se15.42.13 JOB04227 IEF677I WARNING MESSAGE(S) FOR JOB PSTARS3T ISSUED 15.42.13 JOB04227 ICH70001I D839471 LAST ACCESS AT 15:42:05 ON FRIDAY, 15.42.13 JOB04227 $HASP373 PSTARS3T STARTED - INIT 28 - CLASS T - SYS 15.42.13 JOB04227 IEF403I PSTARS3T - STARTED - TIME=15.42.13 15.42.14 JOB04227 IEF285I SYS1.MACLIB 15.42.14 JOB04227 IEF285I VOL SER NOS= D1T900. 15.42.14 JOB04227 - --TIMINGS (M15.42.14 JOB04227 -JOBNAME STEPNAME PROCSTEP RC EXCP CPU SRB15.42.14 JOB04227 -PSTARS3T STEP1 C 00 63 .00 .0015.42.14 JOB04227 -PSTARS3T STEP1 L 00 19 .00 .0015.42.14 JOB04227 IEF285I SYS09240.T154213.RA000.PSTARS3T.GOSET.H06 15.42.14 JOB04227 -PSTARS3T STEP1 G 00 9 .00 .0015.42.14 JOB04227 IEF404I PSTARS3T - ENDED - TIME=15.42.14 15.42.14 JOB04227 -PSTARS3T ENDED. NAME-JAGUA #4 ALBERTO TOTAL CPU 15.42.14 JOB04227 $HASP395 PSTARS3T ENDED ------ JES2 JOB STATISTICS ------ 28 AUG 2009 JOB EXECUTION DATE 116 CARDS READ 640 SYSOUT PRINT RECORDS 0 SYSOUT PUNCH RECORDS 44 SYSOUT SPOOL KBYTES 0.00 MINUTES EXECUTION TIME

Page 92: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

92Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Result output (reports)

JES2.JESJCL example (truncatd at right)

=============================== T O P ================================= 1 //PSTARS3T JOB (9526,,,20,,1090),'JAGUA #4 ALBERTO', // CLASS=T,TIME=3,MSGCLASS=O 2 //STEP1 EXEC ASMACLG,PARM.G='INFORMACOES VIA PARM' 3 XXASMACLG PROC XX* XX************************************************************* XX* ASMACLG XX* THIS PROCEDURE RUNS THE HIGH LEVEL ASSEMBLER, LINK-EDITS TH XX* NEWLY ASSEMBLED PROGRAM AND RUNS THE PROGRAM AFTER XX* THE LINK-EDIT IS ACCOMPLISHED. XX************************************************************* XX* 4 XXC EXEC PGM=ASMA90 5 XXSYSLIB DD DSN=SYS1.MACLIB,DISP=SHR 6 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(4096,(120,120),,,ROUND), XX UNIT=SYSALLDA,DCB=BUFNO=1 7 XXSYSPRINT DD SYSOUT=* 8 XXSYSLIN DD DSN=&&OBJ,SPACE=(3040,(40,40),,,ROUND), XX UNIT=SYSALLDA,DISP=(MOD,PASS), XX DCB=(BLKSIZE=3040,LRECL=80,RECFM=FB,BUFNO=1) 9 //C.SYSIN DD * 10 XXL EXEC PGM=HEWL,PARM='MAP,LET,LIST',COND=(8,LT,C) 11 XXSYSLIN DD DSN=&&OBJ,DISP=(OLD,DELETE) 12 XX DD DDNAME=SYSIN 13 XXSYSLMOD DD DISP=(,PASS),UNIT=SYSALLDA,SPACE=(CYL,(1,1,1)), XX DSN=&&GOSET(GO) 14 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(1024,(120,120),,,ROUND), XX UNIT=SYSALLDA,DCB=BUFNO=1 15 XXSYSPRINT DD SYSOUT=* 16 XXG EXEC PGM=*.L.SYSLMOD,COND=((8,LT,C),(8,LT,L)) 17 //G.SYSPRINT DD SYSOUT=*

Page 93: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

93Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Result output (reports)

JES2.JESYSMSG example (truncated at right)

STMT NO. MESSAGE 2 IEFC001I PROCEDURE ASMACLG WAS EXPANDED USING SYSTEM LIBRARY JE 16 IEF686I DDNAME REFERRED TO ON DDNAME KEYWORD IN PRIOR STEP WAS ICH70001I D839471 LAST ACCESS AT 15:42:05 ON FRIDAY, AUGUST 28, 2009 IEF236I ALLOC. FOR PSTARS3T C STEP1 IEF237I BE10 ALLOCATED TO SYSLIB IGD101I SMS ALLOCATED TO DDNAME (SYSUT1 ) DSN (SYS09240.T154213.RA000.PSTARS3T.SYSUT1.H06 ) STORCLAS (SCVIO) MGMTCLAS ( ) DATACLAS ( ) VOL SER NOS= VIO IEF237I JES2 ALLOCATED TO SYSPRINT IGD101I SMS ALLOCATED TO DDNAME (SYSLIN ) DSN (SYS09240.T154213.RA000.PSTARS3T.OBJ.H06 ) STORCLAS (SCVIO) MGMTCLAS ( ) DATACLAS ( ) VOL SER NOS= VIO IEF237I JES2 ALLOCATED TO SYSIN IEF142I PSTARS3T C STEP1 - STEP WAS EXECUTED - COND CODE 0000 IEF285I SYS1.MACLIB KEPT IEF285I VOL SER NOS= D1T900. IGD105I SYS09240.T154213.RA000.PSTARS3T.SYSUT1.H06 DELETED, DDNAME=SYIEF285I D839471.PSTARS3T.JOB04227.D0000102.? SYSOUT IGD106I SYS09240.T154213.RA000.PSTARS3T.OBJ.H06 PASSED, DDNAME=SYIEF285I D839471.PSTARS3T.JOB04227.D0000101.? SYSIN IEF373I STEP/C /START 2009240.1542 IEF374I STEP/C /STOP 2009240.1542 CPU 0MIN 00.01SEC SRB 0MINIEF236I ALLOC. FOR PSTARS3T L STEP1 IGD103I SMS ALLOCATED TO DDNAME SYSLIN IEF237I DMY ALLOCATED TO IGD101I SMS ALLOCATED TO DDNAME (SYSLMOD ) DSN (SYS09240.T154213.RA000.PSTARS3T.GOSET.H06 ) STORCLAS (SCVIO) MGMTCLAS ( ) DATACLAS ( ) VOL SER NOS= VIO

Continua na próxima página

Page 94: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

94Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Result output (reports)

IGD101I SMS ALLOCATED TO DDNAME (SYSUT1 ) DSN (SYS09240.T154213.RA000.PSTARS3T.SYSUT1.H06 ) STORCLAS (SCVIO) MGMTCLAS ( ) DATACLAS ( ) VOL SER NOS= VIO IEF237I JES2 ALLOCATED TO SYSPRINT IEF142I PSTARS3T L STEP1 - STEP WAS EXECUTED - COND CODE 0000 IGD105I SYS09240.T154213.RA000.PSTARS3T.OBJ.H06 DELETED, DDNAME=SYIGD106I SYS09240.T154213.RA000.PSTARS3T.GOSET.H06 PASSED, DDNAME=SYIGD105I SYS09240.T154213.RA000.PSTARS3T.SYSUT1.H06 DELETED, DDNAME=SYIEF285I D839471.PSTARS3T.JOB04227.D0000103.? SYSOUT IEF373I STEP/L /START 2009240.1542 IEF374I STEP/L /STOP 2009240.1542 CPU 0MIN 00.00SEC SRB 0MINIEF236I ALLOC. FOR PSTARS3T G STEP1 IEF237I VIO ALLOCATED TO PGM=*.DD IEF237I JES2 ALLOCATED TO SYSPRINT IEF142I PSTARS3T G STEP1 - STEP WAS EXECUTED - COND CODE 0000 IEF285I SYS09240.T154213.RA000.PSTARS3T.GOSET.H06 KEPT IEF285I D839471.PSTARS3T.JOB04227.D0000104.? SYSOUT IEF373I STEP/G /START 2009240.1542 IEF374I STEP/G /STOP 2009240.1542 CPU 0MIN 00.00SEC SRB 0MINIGD105I SYS09240.T154213.RA000.PSTARS3T.GOSET.H06 DELETED, DDNAME=SYIEF375I JOB/PSTARS3T/START 2009240.1542 IEF376I JOB/PSTARS3T/STOP 2009240.1542 CPU 0MIN 00.01SEC SRB 0MIN

Continuação

JES2.JESYSMSG example (truncated at right)

Page 95: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

95Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Application Program

(my program)

Result output (reports)Let’s see an example of an application program that writes 2 reports:

//REPORT1 DD SYSOUT=* , //REPORT2 DD SYSOUT=B

and it has MSGCLASS=R parameter in the JOB statement

JOB1234 , STEP 1, DD REPORT1, class RLine 1 Report1Line 2 Report1...Etc...

JOB1234 , STEP1, DD REPORT2, class BLine 1 Report2Line 2 Report2...Etc...

JOB1234, JES2.JESMSGLG, class R

JOB1234, JES2.JESJCL, class R

JOB1234, JES2.JESMSGLG, class R

Operating System

Page 96: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

96Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Writer serves B class datasets

Writer serves R class datasets

Result output (reports)Similarly as occur in the input process, there are system components to deal with the (real)

print demand generated by the queued datasets at output spool area.

These components are the WRITERS; they work based on SYSOUT class.

They read the spool datasets in the output spool area and “print” them at some device.

JOB1234 , STEP 1, DD REPORT1, class RLine 1 Report1Line 2 Report1...Etc...

JOB1234 , STEP1, DD REPORT2, class BLine 1 Report2Line 2 Report2...Etc...

JOB1234, JES2.JESMSGLG, class R

JOB1234, JES2.JESJCL, class R

JOB1234, JES2.JESMSGLG, class R

Page 97: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

97Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Writer serves B class datasets

Writer serves R class datasets

Result output (reports)Sometimes (mostly at development activities) the output is NOT to be directed to

a printer. User wants to browse it at a terminal.

That’s what happen when we access sysouts Roscoe, TSO or CONTROL-V.

JOB1234 , STEP 1, DD REPORT1, class RLine 1 Report1Line 2 Report1...Etc...

JOB1234 , STEP1, DD REPORT2, class BLine 1 Report2Line 2 Report2...Etc...

JOB1234, JES2.JESMSGLG, class R

JOB1234, JES2.JESJCL, class R

JOB1234, JES2.JESMSGLG, class R

Page 98: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

98Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL

It’s JCL time

Page 99: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

99Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL

JCL = Job Control Language = language

to ask operating system to execute

services/tasks

Page 100: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

100Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL

All languages must have its commands.

In JCL, there are 3 main commands:

JOB, EXEC and DD

Before starting with the details, let’s see

some basics

Page 101: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

101Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – Basic sintax

Basic syntax

Page 102: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

102Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – Basic sintax

Always: // at positions 1-2

Comments: //* at positions 1-3

Page 103: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

103Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – Basic sintax

statement to be continued : last character must be a comma, to

indicate there are more parameter(s)

 following statement : // at columns 1-2, as usual, and continuation

begins at any position from 4 through 16 (position 3 must be

blank)

Continuation statements

Page 104: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

104Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – Basic sintax

Example (first 2 lines are “rulers” to use as a reference to the

statement positions) :

Continuation statements

. 1 2 3 4 5 6 7..123456789012345678901234567890123456789012345678901234567890123456789012//ENTRADA DD DSN=SYS5.LINKLIB,// DISP=SHR BIBLIOTECA DE UTILITARIOS HOME MADE//ENTRADA DD DSN=SYS5.LINKLIB,// DISP=SHR COMENTARIO//ENTRADA DD DSN=SYS5.LINKLIB,// DISP=SHR COMENTARIO//ENTRADA DD DSN=SYS5.LINKLIB,// DISP=SHR

Page 105: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

105Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – Basic sintax

Most common problems

Continuation statements

. 1 2 3 4 5 6 7..123456789012345678901234567890123456789012345678901234567890123456789012 //ENTRADA DD DSN=SYS5.LINKLIB// DISP=SHR BIBLIOTECA DE UTILITARIOS HOME MADE

Here there is no comma after; therefore DISP=SHR wasn’t considered as part of DD statement, but a separated statement; note that bo JCL error is detected at //ENTRADA DD; system understands that dataset SYS5.LINKLIB must be created (there is no DISP parameter) and that following statement is wrong (DISP=SHR is na invalid operation).

Page 106: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

106Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – Basic sintax

Most common problems

Continuation statements

. 1 2 3 4 5 6 7..123456789012345678901234567890123456789012345678901234567890123456789012 //ENTRADA DD DSN=SYS5.LINKLIB,// DISP=SHR COMENTARIO

Continuation begins at position 17; it’s wrong (maximum allowed for the beginning is position 16)

Page 107: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

107Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – Basic sintax

. 1 2 3 4 5 6 7..123456789012345678901234567890123456789012345678901234567890123456789012 //ENTRADA DD DSN=SYS5.LINKLIB,//DISP=SHR COMENTARIO

Continuation at position 3 (wrong: minimum is position 4)

Most common problems

Continuation statements

Page 108: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

108Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – Basic sintax

. 1 2 3 4 5 6 7..123456789012345678901234567890123456789012345678901234567890123456789012 //ENTRADA DD DSN=SYS5.LINKLIB, DISP=SHR

“Continuation” statement (second statement) hasn’t // at positions 1-2: system understands that //ENTRADA DD DSN=SYS5.LINKLIB, will be resumed at the next line (its last character is a comma – it indicates there will be a continuation), but the next line is not a JCL line (it is recognized as the first – and only - data record of a dataset named SYSIN)

Most common problems

Continuation statements

Page 109: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

109Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – Basic sintax

Summary – statement syntax       Identification = // columns 1-2       Name = 1 to 8 positions, starting at posiition 3; it must have at least one blank after the name (and before the operation)       Operation = JOB or EXEC or DD (or PROC or PEND or IF or END-IF or other); it must have at least one blank after operation name       Parameter(s); it/they may be of two types:       posicional : depend on the position (sequence of specification) or       keyword : followed by “=“ sign      If there is only positional parameter(s), they must be specified in the correct sequence      If there is only keyword parameter(s), they may be specified in any sequence      If there is both positional and keyword operands, the positional (in the correct sequence) must be specified before the keyword ones (in any sequence)       Comments; it must have at least one blank after the operand(s) specification, before comments

Page 110: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

110Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

O JOB as a whole - overwiew

JOB as a whole – overview

Page 111: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

111Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

O JOB as a whole - overwiew

Overview

Page 112: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

112Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB – Overview

JOB

EXEC (for the 1st step)

DD 1 (for the 1st step)

.

.

DD n (for the 1st step)

EXEC (for the 2nd step)

DD 1 (for the 2nd step)

.

.

DD n (for the 2nd step)

EXEC (for the 3rd step)

DD 1 (for the 3rd step)

.

.

DD n (for the 3rd step)

JOB

1st Step

2nd Step

3rd Step

Job start delimiter

The job end delimiter is the next job begin

(in the old times, it was mandatory a statement just with // in positions 1-2 and remaining spaces)

Page 113: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

113Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB – Overview

For the steps:

Remember that DDs are opcional.

If a program does not use datasets, no DD’s are needed or

If a program uses dynamic allocation for a dataset, no DD is needed to that dataset

BUT : EXEC is mandatory; EXEC defines a step.

Page 114: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

114Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB – Overview

//ABCARS01 JOB ...//STEP1 EXEC PGM=PGM01//DDA1 DD ...//DDB1 DD ...//DDC1 DD ...//STEP2 ESEC PGM=PGM02//DDA2 DD ...//DDB2 DD ...//DDC2 DD ...//STEP3 EXEC PGM=PGM03//DDA3 DD ...//DDB3 DD ...//DDC3 DD ...

If, for instance, the 2nd step “EXEC” has na operation code error,

it isn’t identified as a EXEC and therefore it does not identify

another new step delimiter, and therefore its DD’s are considered

as belonging to the 1st step DD’s.

As 2nd “EXEC” is in error, it doesn’t delimits the 2nd step beginning.

All blue statements are the 1st step statements

The green ones are the 2nd step statements

Page 115: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

115Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB – OverviewExample of a batch JOB with a SELECT from a DB2 database, and the

corresponding output produced.

//ARSARS01 JOB (1234),’ALBERTO’,MSGCLASS=X,CLASS=R //STEP001 EXEC PGM=IKJEFT01,DYNAMNBR=20,REGION=6M //STEPLIB DD DSN=SYS1.DSNDB1D.SDSNLOAD,DISP=SHR // DD DSN=SYS1.DSNDB1D.RUNLIB.LOAD,DISP=SHR //DBRMLIB DD DSN=SYS1.DSNDB1D.DBRMLIB.DATA,DISP=SHR //SYSTSPRT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //SYSTSIN DD * DSN SYSTEM(DB1D) RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) - LIB('SYS1.DSNDB1D.RUNLIB.LOAD') – PARMS('/ALIGN(MID)') END //SYSIN DD * SELECT CD_AGE, NM_AGE FROM DB2T.ZZZ100_CADAGE WHERE CD_AGE > 20 AND CD_AGE < 100;

PAGE 1 ***INPUT STATEMENT: SELECT CD_AGE, NM_AGE FROM DB2T.ZZZ100_CADAGE WHERE CD_AGE > 20 AND CD_AGE < 100;  +----------------------------------+ | CD_AGE | NM_AGE | +----------------------------------+1_| 30 | BARUERI |2_| 40 | S.JOSE R.PRETO |3_| 50 | SAO CARLOS |4_| 60 | PINHEIROS |5_| 70 | PERDIZES |6_| 80 | MARAMBAIA |7_| 90 | JAGUARETE | +----------------------------------+

Page 116: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

116Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB – Commands

Commands

Page 117: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

117Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL - Comandos

There are 3 main JCL commands:

JOB, EXEC and DD

Let’s see them.

Page 118: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

118Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB

JOB

Page 119: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

119Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB

Sintax :

//jobname JOB positional_parameters,keyword_parameters

Page 120: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

120Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB

Example :

//PDR001P2 JOB (B281),ALBERTO,MSGCLASS=X,CLASS=R

2 positional parameters 2 keyword parameters

Page 121: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

121Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB

Positional parametersGenerally they have information about job submitter and

accounting.

The sequence is mandatory, and the installation’ standards

must be followed.

//PDR001P2 JOB (B281),ALBERTO,MSGCLASS=X,CLASS=R

2 positional parameters 2 keyword parameters

Page 122: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

122Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB

Keyword parametersInformation about the job, given by means of keywords;

therefore, they can be specified at any sequence.

//PDR001P2 JOB (B281),ALBERTO,MSGCLASS=X,CLASS=R

2 positional parameters 2 keyword parameters

Page 123: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

123Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB

Keyword parameters

CLASS= Specify the job execution class.

Each class is served by 1 (or more) initiator.

The amount of initiators and the classes each one serves is determined by support and production people.

Page 124: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

124Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB

TIME= indicates the maximum amount of CPU usage allowed for the JOB; 1440 = specifies that there’s no CPU limit

Keyword parameters

Page 125: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

125Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB

MSGCLASS= Specifies the sysout class for the messages related to the JOB

(as specified in MSGLEVEL)

Keyword parameters

Page 126: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

126Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB

MSGVEVEL= Specifies what has to be printed.

Syntax: MSGLEVEL=(a,b) where

a : JCL messages

0 = only JOB statement

1 = everything must be printed:

submitted JCL statements +

generated JCL statements

2 = only submitted JCL statements

b : allocation messages

0 = do not print

1 = print

Keyword parameters

Page 127: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

127Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JOB

NOTIFY= Specifies TSO userid to be notified at the job termination

REGION= Specifies the size of the region to be allocated to the JOB

RESTART= Specifies the stepname for the JOB to be restarted

TYPRUN= Specifies the type of submission.SCAN = submit, validate JCL, but do not execute the job (it is finished after interpreter validation process; no INIT services done)HOLD = the JOB remains in wait state, until selected for execution by an initiator

Keyword parameters

Page 128: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

128Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

EXEC

EXEC

Page 129: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

129Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

EXEC

Sintax :

//stepname EXEC positional_parameter,keyword_parameters

Page 130: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

130Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

EXEC

Example :

//VERIFY EXEC P756,COND=EVEN,PARM.S1=‘T=YES’

1 positional parameter 2 parameters keyword

Page 131: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

131Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

EXEC

Positional parameter

only 1: procname

It is a name, specifying the name of the PROC to be

executed.

If specified, keyword parameters PROC= and PGM=

cannot be used.

//STPR1 EXEC PD0011 parâmetro posicional

Page 132: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

132Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

EXEC

Keyword parametersInformation related to the step, specified via keywords; they

can be specified in any sequence.

//ST01 EXEC PGM=LISTABND,COND=ONLY

2 keyword parameters

Page 133: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

133Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

EXEC

COND= Specifies the execution conditions the step must be executed or flushed. COND=EVEN step is executed even if any previous step is cancelledCOND=ONLY step is executed only if any previous step cancelledCOND=(n,cond) step is NOT EXECUTED if n satisfies the specified condition, in any previous stepCOND=(n,cond,step) step is NOT EXECUTED if n satisfies the condition specified in the step with the specified nameCond may be specified as : LT or GT or EQ or NE Examples.:

COND=(4,LT) if 4 is less than the return code of any previous step, STEP IS NOT EXECUTEDin other words:if any previous step emitted a return code greater than 4, STEP IS NOT EXECUTED COND=((4,LT,COMP),(4,LT,LKED))(if 4 is less than the return code emitted by step COMP AND if 4 is less than the return code emitted by step LKED) THEN STEP IS NOT EXECUTEDin other words:(if step COMP had a return code > 4 OR if step LKED had a return code > 4) THEN STEP IS NOT EXECUTED

Page 134: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

134Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

EXEC

PARM= Data to be passed as parameters (arguments) to the called program.

Ex.: PARM='NOSEQ,QUOTE,OFFSET,LIB'PARM='JAN/2003'

Page 135: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

135Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

EXEC

PGM= Specifies the name of the program to be executed

PROC= Specifies the name of the proc(edure) to be executed. If no PGM= nor PROC= specified, then PROC= is assumed

Examples :

//STEP1 EXEC TST01 executes PROC named TST01

//STEP2 EXEC PROC=TST01 executes PROC named TST01

//STEP1 EXEC PGM=TST01 executes program named TST01

Page 136: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

136Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

DD (Data Definition)

Page 137: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

137Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

Sintax :

//filename DD positional_parameters,keyword_parameters

Page 138: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

138Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

Example :

//INFILE DD *,DCB=(LRECL=80)

1 positional parameter 1 keyword parameter

Page 139: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

139Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

Positional parameters

There are 3, and they are mutually

exclusives. Only 1 positional parameter is allowed.

//FIL1 DD *

//FIL2 DD DATA

//FIL3 DD DUMMY

1 positional parameter

Page 140: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

140Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

Positional parameters: DD *Specifies that the record(s) from the following one are one

(in-stream) dataset. The last record is the record before the

next with // in positions 1-2.

//FILE1 DD *

DATA RECORD 1

DATA RECORD 2

DATA RECORD 3

//FILE2 DD DSN=WFILE.TESTX,DISP=SHR

Arquivo in-stream com ddname ARQ1

Page 141: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

141Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

Positional parameters: DD *Examples:

//FILE1 DD *

DATA RECORD 1

DATA RECORD 2

DATA RECORD 3

//FILE2 DD *

DATA RECORD 1

DATA RECORD 2

DATA RECORD 3

//FILE3 DD *

DATA RECORD 1

DATA RECORD 2

DATA RECORD 3

In-stream dataset (ddname = FILE1)

In-stream dataset (ddname = FILE2)

In-stream dataset (ddname = FILE3)

Page 142: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

142Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

Positional parameters: DD *Examples:

//* FOLLOWING DATASET = TODAY’S TRANSACTIONS

//FILE4 DD *

DATA RECORD 1

DATA RECORD 2

DATA RECORD 3

//* FOLLOWIN DATASET = CONTROL DATA

//FILE5 DD *

JUL/2009

In-stream dataset (ddname FILE4)

In-stream dataset (ddname FILE5)

Page 143: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

143Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

Positional parameters: DD *Examples:

//FILE4 DD *

//* FOLLOWING DATASET = TODAY’S TRANSACTIONS

DATA RECORD 1

DATA RECORD 2

DATA RECORD 3

//FILE5 DD *

//* FOLLOWING DATSET = CONTROL DATA

JUL/2009

For Operating System is OK, but...

It’s WRONG!

Page 144: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

144Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

Positional parameters: DD *Examples:

//FILE4 DD *

//* FOLLOWING DATASET = TODAY’s TRANSACTIONS

DATA RECORD 1

DATA RECORD 2

DATA RECORD 3

//FILE5 DD *

//* FOLLOWING DATASET = CONTROL DATA

JUL/2009

WHY ?

Page 145: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

145Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

Positional parameters: DD *Examples:

//FILE4 DD *

//* FOLLOWING DATASET = TRANSACTION FILE

DATA RECORD 1

DATA RECORD 2

DATA RECORD 3

//FILE5 DD *

//* FOLLOWING DATASET = CONTROL FILE

JUL/2009

This statement (it has //) is understood by the system as end of FILE4 in-stream file (zero records); it is a

“normal” JCL statement, a comment

First line is identified as a non-JCL statement (it doesn’t have // at position 1-2); it is meant to be the first record of an in-stream file, whose

ddname is assumed to be SYSIN

Another in-stream data file starting

here

In-stream data starting here

This statement (it has //) is understood by the system as end of FILE5 in-stream file (zero records); it is a “normal” JCL

statement, a comment

This record is identified as a non-JCL statement (it doesn’t have // at position 1-2); it is meant to be the first record of an in-stream file, whose ddname is assumed to be SYSIN

(it overrides the previous SYSIN dataset)

Page 146: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

146Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

Positional parameters: DD *

THEN:This

//FILE4 DD *//* FOLLOWING DATASET = TODAY’S TRANSACTIONS DATA RECORD 1DATA RECORD 2DATA RECORD 3//FILE5 DD *//* FOLLOWING DATASET = CONTROL DATAJUL/2009

the system understands this way:

FILE4 = (dataset with zero records)FILE5 = (dataset with zero records)SYSIN = dataset with 1 record (JUL/2009)

Page 147: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

147Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

Positional parameters: DD DATASimilar to DD *.

Specifies that the statements that follow the DD DATA

statement are an in-stream dataset. Last record of this dataset is the one contents is equal to the delimiter

declared in the DLM keyword parameter.

//FILE1 DD DATA,DLM=‘EOF*’

DATA RECORD 1

DATA RECORD 2

DATA RECORD 3

// THIS ISN’T A JCL STATEMENT !

EOF*

//FILE2 DD DSN=FILEWORK.TESTX,DISP=SHR

In-stream records for ARQ1 ddname dataset

Page 148: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

148Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

Positional parameters: DD DUMMYJust for input files; specifies that the dataset does not exist (phisically – only

logically).

System pretends to the access method (when dataset is opened, read, or closed)

that the dataset exists, but has no records (empty dataset).

In other words: it is correctly opened, with no problems, at the 1st read the end-of-

file condition is triggered, it is correctly closed.

It is a good alternative when program opens, reads and closes the dataset, even if

dataset does not exist (the data won’t be used). Example: a program that reads 2

files: FILEA with transactions from the current month, and FILEB with transaction

from past months of the year. In january (there is no past months in the year),

FILEB can be a DD DUMMY file.

//FILEB DD DUMMY

//FILEA DD DSN=CURMONFI.TESTEX,DISP=SHR

Page 149: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

149Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

Keyword ParametersInformation related to the step, specified by keywords; so,

they can be specified in any sequence.

//ST01 EXEC PGM=LISTABND,COND=ONLY

2 keyword parameters

Page 150: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

150Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

DSN Data Set Name = specifies the dataset external name, the dataset name for the operating system (its name for the program is the ddname) Ex.://F1 DD DSN=ALB.WRK.FIL,DISP=SHR

Page 151: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

151Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

DCB Specifies the characteristics of the dataset. Some sub-parameters are:DSORG= (Data Set ORGanization) specifies the dataset organization.Main options: PO (Partitioned Organization = Partitioned Data Set = PDS) PS (Physical Sequential = Sequencial)EXPDT= (EXPiration DaTe) = specifies the date the datset may be deletedRETPD= (RETention PerioD) specifies the period in which the dataset, although expired, cannot be deletedLRECL= (Logical RECord Length) specifies the length, in bytes, og the logical recordRECFM= (RECord ForMat) specifies the dataset records’ format.Main options : FB = Fixed Blocked F = Fixed (Unblocked) FBA = Fixed Blocked Asa FA = Fixed (Unblocked) Asa V = Variable (Unblocked) VB = Variable blocked U = UndefinedBLKSIZE= (BLocKSIZE) specifies the length, in bytes, of the physical record (block)Ex.://SYSIN DD DUMMY,DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)

Page 152: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

152Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

LRECL Specifies the logical record length

RECFM Specifies the logical record format: F (fixed), FB (fixed blocked), V (variable), VB (variable blocked)

BLKSIZE Specifies the length of the physical records (blocks)

DSORG Specifies the dataset organization: OS (physical sequential), PO (partitioned organization)

EXPDT Specifies the dataset expiration date

RETPD Specifies the dataset retention period (in which it is not expired)

Page 153: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

153Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

DISP DispositionDISP=(a,b,c) specifies the action to be done with the dataseta = NEW (dataset must be created) or OLD (dataset is already exists; exclusive use) or SHR (shared – dataset already exists; shared use) or MOD (modify – dataset already exists; it will be extended)b = CATLG (dataset will be cataloged at the normal end of the program, if the program terminates normally) or UNCATLG (dataset will be uncataloged at the normal end of the program, if the program terminates normally) or DELETE (dataset will be deleted at the normal end of the program, if the program terminates normally) KEEP (dataset will be kept at the normal end of the program, if the program terminates normally) PASS (temporary dataset; it will be passed to the further steps)c = CATLG (dataset will be cataloged at the abnormal end of the program, if the program terminates abnormally) or UNCATLG (dataset will be uncataloged at the abnormal end of the program, if program terminates abnormally) or DELETE (dataset will be deleted at the abnormal end of the program, if the program terminates abnormally) KEEP (dataset will be kept at the abnormal end of the program, if the program terminates abnormally)

Page 154: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

154Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

UNIT Specifies where the dataset must be allocated.Generally (in development environments) : SYSDA or 3390

SYSOUT SYSOUT=classSYSOUT=(class,,formsname)SYSOUT=(class,writername,formsname)SYSOUT=(class,writername)SYSOUT=(class,INTRDR)Ex.://SYSOUT DD SYSOUT=*

Page 155: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

155Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

SPACE SPACE= (a,(b,c),RLSE) orSPACE= (d,(b,c),RLSE)Specifies the amount of disk space to be allocated to the datase.a = TRK or CYL or ABSTR allocation unit : tracks, cylinders, or logical record length b = primary area amountc = secondary area amount (optional)d = logical record lengthRLSE = (ReLeaSE) (optional) specifies that if there is space left in the primary area after closing the file, this space must be released

Page 156: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

156Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

KEYOFF= KEY OFFset = specifies the key offset in the logical record (for VSAM KSDS datasets)

KEYLEN= KEY LENgth = specifies the key length (for VSAM KSDS datsets)

RECORG= RECord ORGanization = specifies the VSAM type: KS (KSDS), ES (ESDS), RR (RRDS) or LS (Linear Space)

Page 157: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

157Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

DD

Examples : //OUTFIL DD DSN=ATAAABPS.EPC.SE62, // DISP=(NEW,CATLG,DELETE),SPACE=(TRK,(100,50)),// UNIT=SYSDA,DCB=LRECL=83 //INFIL DD DSN=ATAAABPS.EPC.SLB005,DISP=SHR //EPCASLBS DD DSN=ATAAABPS.EPC.SE64(+1), // DISP=(NEW,CATLG,DELETE),// SPACE=(TRK,(100,50)),// UNIT=SYSDA,// DCB=LRECL=83 //EPCASLBS DD DSN=ATAAABPS.EPC.SE64(+1), // DISP=(NEW,CATLG,DELETE),// SPACE=(TRK,(100,50)),// UNIT=SYSDA,// DCB=(LRECL=83,BLKSIZE=830)

//VKSDS1 DD DSN=DSVAABVS.LSG.A889.ALBERTO,DISP=(,CATLG,DELETE),// SPACE=(CYL,(10,10)),LRECL=100,KEYOFF=10, // KEYLEN=12,RECORG=KS

Page 158: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

158Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Library search

Library search

Page 159: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

159Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Busca em bibliotecas

There are in the system lists of libraries that must be searched when a member must be found.

Some of these lists refer to:

Executable programsJCL

Page 160: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

160Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Load module search

Executable programs (load modules) search

Operating system librariesSYS1.LINKLIB

User librariesEx.: SYS9.LINKLIB

SYS9.EMPLK01 SYS8.USRRHLIB SYS7.EASYLIB etc

Page 161: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

161Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Load module search

Load module search

Normally the operating system libraries are automatically searched

SYS1.LINKLIB etcThe user libraries are searched if:- They are in the automatic search list- They are specified in the JOBLIB or STEPLIB statements

Page 162: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

162Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Load module search

Load module search

JOBLIB / STEPLIB

These are special DDs that specify that na automatic search must be made in the libraries they refer.JOBLIB must be specified at the beginning of the JOB, and is by all EXECs of the jobSTEPLIB must be specified just after the EXEC statement, and the search in the library it refers to is made just for the step

Page 163: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

163Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Load module search

Load module search

JOBLIB example//JOBEXEMP JOB (1234),’ALBERTO’,CLASS=A//JOBLIB DD DSN=SYS9.MYLIB,DISP=SHR //STEPX1 EXEC PGM=PGTST01//ENTRADA DD DSN=ARQUIVOX,DISP=SHR//SAIDA DD SYSOUT=A//STEPX2 EXEC PGM=PGTST02//DD1 DD DSN=ARQUIVOX,DISP=SHR//SYSOUT DD SYSOUT=A//STEPX3 EXEC PGM=PGTST03//SYSIN DD DSN=ARQUIVOX,DISP=SHR//RELAT DD SYSOUT=A

- Programs PGTST01, PGTST02 and PGTST03 are searched at SYS9.MYLIB

Page 164: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

164Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Load module search

Load module search

STEPLIB example//JOBEXEMP JOB (1234),’ALBERTO’,CLASS=A//STEPX1 EXEC PGM=PGTST01//STEPLIB DD DSN=SYS8.MYLIBX,DISP=SHR//ENTRADA DD DSN=ARQUIVOX,DISP=SHR//SAIDA DD SYSOUT=A//STEPX2 EXEC PGM=PGTST02//STEPLIB DD DSN=SYS8.MYLIBY,DISP=SHR//DD1 DD DSN=ARQUIVOX,DISP=SHR//SYSOUT DD SYSOUT=A//STEPX3 EXEC PGM=PGTST03//STEPLIB DD DSN=SYS8.MYLIBZ,DISP=SHR//SYSIN DD DSN=ARQUIVOX,DISP=SHR//RELAT DD SYSOUT=A

- Program PGTST01 is searched at SYS8.MYLIBX

- Program PGTST02 is serached at SYS8.MYLIBY

- Program PGTST03 is searched at SYS8.MYLIBZ

Page 165: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

165Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL search

JCL search

Operating system libraries SYS1.PROCLIB

User librariesEx.: SYS9.PROCLIB

SYS9.EMPROC1 SYS8.USRPROCL SYS7.PRODPROC etc

Page 166: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

166Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL search

JCL search

Normally the operating system libraries are automatically searched

SYS1.PROCLIB The user libraries are searched if:- They are in the automatic search- They are specified in the JCLLIB statement

Page 167: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

167Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL search

JCL search (procedures – PROCS)

JCLLIB / INCLUDE

It is a special DD that specifies that it must have search in the specified libraries.JCLLIB must be specified in the beginning of the JOB.

To insert the JCL statements from a library (specified in the JCLLIB) member into the stream of JCL statement being built (by the reader / interpreter) use INCLUDE statement.

See following example:

Page 168: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

168Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL search

JCL search (procedures)

JCLLIB / INCLUDE: example//LSG#@ARS JOB ('ALBERTO'),'ALBERTO',CLASS=1,MSGCLASS=X // JCLLIB ORDER=(JCL.SIST.SRC) // INCLUDE MEMBER=BIBPROD //*------------------------------------- //STEP1 EXEC PGM=P001 //STEP2 EXEC PGM=P003//STEP3 EXEC PGM=P004

If BIBPROD member of JCL.SIST.SRC dataset has the statement //STEPAUX EXEC PGM=SHOWTIME the submetted JCL is:

//LSG#@ARS JOB ('ALBERTO'),'ALBERTO',CLASS=1,MSGCLASS=X //* JCLLIB ORDER=(JCL.SIST.SRC) //STEPAUX EXEC PGM=SHOWTIME //*------------------------------------- //STEP1 EXEC PGM=P001 //STEP2 EXEC PGM=P003//STEP3 EXEC PGM=P004

Page 169: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

169Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL search

JCL search (procedures)

JCLLIB / INCLUDE: another example//LSG#@ARS JOB ('ALBERTO'),'ALBERTO',CLASS=1,MSGCLASS=X // JCLLIB ORDER=(JCL.SIST.SRC) // INCLUDE MEMBER=BIBDESEN //*------------------------------------- //STEP1 EXEC PGM=P001 //STEP2 EXEC PGM=P003//STEP3 EXEC PGM=P004

If BIBDESEN member of JCL.SIST.SRC dataset has the statement //STEPAUX EXEC PGM=IEFBR14 the submitted JCL is:

//LSG#@ARS JOB ('ALBERTO'),'ALBERTO',CLASS=1,MSGCLASS=X //* JCLLIB ORDER=(JCL.SIST.SRC) //STEPAUX EXEC PGM=IEFBR14 //*------------------------------------- //STEP1 EXEC PGM=P001 //STEP2 EXEC PGM=P003//STEP3 EXEC PGM=P004

Page 170: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

170Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCS

PROCS

Page 171: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

171Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCS

Procs = procedures = set of non-JOB and non-data statements. There are 2 types:        CATALOGED       IN-STREAM

Page 172: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

172Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCS

       CATALOGED procedures

Page 173: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

173Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCS

Cataloged procedures are those:- prepared - cataloged (as a member) in a PROCLIBso that they can be called for execution in the jobs

- They cannot have JOB statement

- Start with PROC statement

- End with PEND statement

- They cannot have in-stream data (but they can be inserted via override)

Page 174: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

174Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCSPreparing the proc:

- Edit with Roscoe / TSO and save it. Ex.

//PROCDEMO PROC//STEPX1 EXEC PGM=PGTST01//INFILE DD DSN=XFILE,DISP=SHR//OUFILE DD SYSOUT=A//STEPX1 EXEC PGM=PGTST01//INFILE DD DSN=XFILE,DISP=SHR//OUFILE DD SYSOUT=A//STEPX1 EXEC PGM=PGTST01//INFILE DD DSN=XFILE,DISP=SHR//OUFILE DD SYSOUT=A// PEND

- It is an “almost normal” JCL!

- No JOB statement is allowed

- Begins with PROC statement

- Ends with PEND statement

- No in-stream data allowed

This proc has 3 steps

(STEPX1, STEPX2 & STEPX3)

Page 175: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

175Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCSCataloging the proc:

- Copy to a proclib. Ex.

//CATAL EXEC PGM=IEBCOPY//SAIDA DD DSN=SYS9.PROCLIB(PROCDEMO)//ENTRA DD DATA,DLM=‘FINAL’

//PROCDEMO PROC //STEPX1 EXEC PGM=PGTST01 //INFILE DD DSN=XFILE,DISP=SHR //OUFILE DD SYSOUT=A //STEPX1 EXEC PGM=PGTST01 //INFILE DD DSN=XFILE,DISP=SHR //OUFILE DD SYSOUT=A //STEPX1 EXEC PGM=PGTST01 //INFILE DD DSN=XFILE,DISP=SHR //OUFILE DD SYSOUT=A // PEND

FINAL

- Simple copy to a proclib member

Page 176: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

176Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCSExecuting the proc:

- Calling for execution. Ex.

//ARSARS01 JOB (1234),’ALBERTO’,CLASS=T,MSGCLASS=R//S1 EXEC PROC=PROCDEMO 1ST CALL//S2 EXEC PROCDEMO 2ND CALL//STEPX1.INFILE DD *in-stream data (INFILE dataset, STEPX1 step, proc PROCDEMO) //S3 EXEC PROCDEMO 3RD CALL

- Reader / interpreter finds PROCDEMO in a proclib to know how to expand it

Page 177: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

177Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCS

       IN-STREAM procs

Page 178: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

178Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCS

They are- declared at the beginning of the JOB- called for execution in the same JOB

- JOB statement is not allowed

- Must begin with a PROC statement

- Must end with a PEND statement

- In-stream data are not allowed

Page 179: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

179Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCS

- Declared at the beginning of the JOB. Ex.//ARSARS01 JOB (1234),’ALBERTO’,CLASS=T,MSGCLASS=R//PROCDEMO PROC//STEPX1 EXEC PGM=PGTST01//INFILE DD DSN=XFILE,DISP=SHR//OUFILE DD SYSOUT=A//STEPX1 EXEC PGM=PGTST01//INFILE DD DSN=XFILE,DISP=SHR//OUFILE DD SYSOUT=A//STEPX1 EXEC PGM=PGTST01//INFILE DD DSN=XFILE,DISP=SHR//OUFILE DD SYSOUT=A// PEND//S1 EXEC PROC=PROCDEMO//* 1ST CALL//S2 EXEC PROCDEMO//* 2ND CALL//STEPX1.INFILE DD *in-stream data (INFILE dataset, STEPX1 step, proc PROCDEMO) //S3 EXEC PROCDEMO//* 3RD CALL

Declaring the Proc

- PROC declared at the beginning of the JOB

Page 180: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

180Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCS

- Called for execution at the same job. Ex.//ARSARS01 JOB (1234),’ALBERTO’,CLASS=T,MSGCLASS=R//PROCDEMO PROC//STEPX1 EXEC PGM=PGTST01//INFILE DD DSN=XFILE,DISP=SHR//OUFILE DD SYSOUT=A//STEPX1 EXEC PGM=PGTST01//INFILE DD DSN=XFILE,DISP=SHR//OUFILE DD SYSOUT=A//STEPX1 EXEC PGM=PGTST01//INFILE DD DSN=XFILE,DISP=SHR//OUFILE DD SYSOUT=A// PEND//S1 EXEC PROC=PROCDEMO//* 1ST CALL//S2 EXEC PROCDEMO//* 2ND CALL//STEPX1.ENTRADA DD *in-stream data (INFILE dataset, STEPX1 step, proc PROCDEMO) //S3 EXEC PROCDEMO//* 3RD CALL

Calling the proc

- PROC is called in the same job where it is declared

- Reader / Interpreter DOES NOT GO to any PROCLIB in order to expand the PROC;

- Expansion is done “inquiring” the PROC-PEND block at the same job where it is referred to

Page 181: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

181Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCs – symbolic parameters

Symbolic parameters

Page 182: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

182Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCs – symbolic parameters

In the following PROC :

//SSSPRO1 PROC//STEPA EXEC PGM=PPPX1//DD1 DD DSN=ARQALB.DATA.DISP=SHR//REPORT1 DD SYSOUT=A//STEPB EXEC PGM=PPPX2//REPORT2 DD SYSOUT=A//STEPC EXEC PGM=PPPX3//REPORT3 DD SYSOUT=A// PEND

Everytime it is called, reports with ddname REPORT, REPORT2 & REPORT3 are class A output.

Page 183: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

183Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCs – symbolic parameters

To provide flexibility, one may leave the class able to be modified when PROC is invoked. This is possible via symbolic parameters:

//SSSPRO1 PROC//STEPA EXEC PGM=PPPX1//DD1 DD DSN=ARQALB.DATA.DISP=SHR//REPORT1 DD SYSOUT=&REPCLA//STEPB EXEC PGM=PPPX2//REPORT2 DD SYSOUT=&REPCLA//STEPC EXEC PGM=PPPX3//REPORT3 DD SYSOUT=&REPCLA// PEND

This way the class is NOT specified.- CLASS must have a default value or- CLASS must be specified when PROC is invoked (if not specified, default value is assumed)

Page 184: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

184Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCs – symbolic parameters

If there isn’t default value: JCL error.When this in-stream PROC is expanded

//JOBEXEMP JOB (1234),’ALBERTO’,CLASS=B//SSSPRO1 PROC//STEPA EXEC PGM=PPPX1//DD1 DD DSN=ARQALB.DATA.DISP=SHR//REPORT1 DD SYSOUT=&REPCLA//STEPB EXEC PGM=PPPX2//REPORT2 DD SYSOUT=&REPCLA//STEPC EXEC PGM=PPPX3//REPORT3 DD SYSOUT=&REPCLA// PEND//* //S1 EXEC SSSPR01

the system won’t know what class must me associated to reports DD’s REPORT1, REPORT2 & REPORT3 in STEP S1.

Page 185: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

185Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCs – symbolic parameters

One alternative to specify the default value is via PROC statement.

//JOBEXEMP JOB (1234),’ALBERTO’,CLASS=B//SSSPRO1 PROC REPCLA=*//STEPA EXEC PGM=PPPX1//DD1 DD DSN=ARQALB.DATA.DISP=SHR//REPORT1 DD SYSOUT=&REPCLA//STEPB EXEC PGM=PPPX2//REPORT2 DD SYSOUT=&REPCLA//STEPC EXEC PGM=PPPX3//REPORT3 DD SYSOUT=&REPCLA// PEND//* //S1 EXEC SSSPR01

System knows that the 3 DD’s are SYSOUT=*, due to the default specification at PROC statement.

Page 186: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

186Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCs – symbolic parameters

To change the default value (to override it):One must specify the new value when PROC is invoked.

//JOBEXEMP JOB (1234),’ALBERTO’,CLASS=B//SSSPRO1 PROC REPCLA=*//STEPA EXEC PGM=PPPX1//DD1 DD DSN=ARQALB.DATA.DISP=SHR//REPORT1 DD SYSOUT=&REPCLA//STEPB EXEC PGM=PPPX2//REPORT2 DD SYSOUT=&REPCLA//STEPC EXEC PGM=PPPX3//REPORT3 DD SYSOUT=&REPCLA// PEND//* //S1 EXEC SSSPR01,REPCLA=A

System knows that the 3 DDs are SYSOUT=A, due to the override

Page 187: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

187Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCs – symbolic parameters

(override)In this case

//JOBEXEMP JOB (1234),’ALBERTO’,CLASS=B//SSSPRO1 PROC REPCLA=*//STEPA EXEC PGM=PPPX1//DD1 DD DSN=ARQALB.DATA.DISP=SHR//REPORT1 DD SYSOUT=&REPCLA//STEPB EXEC PGM=PPPX2//REPORT2 DD SYSOUT=&REPCLA//STEPC EXEC PGM=PPPX3//REPORT3 DD SYSOUT=&REPCLA// PEND//* //S1 EXEC SSSPR01,RELCLA=A//S2 EXEC SSSPR01

System knows that the 3 step S1 DDs are SYSOUT=A andthe 3 step S2 DD’s are SYSOUT=*

Page 188: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

188Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCs – symbolic parameters

(override)One can alter only the desired DDs:

//JOBEXEMP JOB (1234),’ALBERTO’,CLASS=B//SSSPRO1 PROC REPCLA=*//STEPA EXEC PGM=PPPX1//DD1 DD DSN=ARQALB.DATA.DISP=SHR//REPORT1 DD SYSOUT=&REPCLA//STEPB EXEC PGM=PPPX2//REPORT2 DD SYSOUT=&REPCLA//STEPC EXEC PGM=PPPX3//REPORT3 DD SYSOUT=&REPCLA// PEND//* //S1 EXEC SSSPR01,REPCLA.STEPA=A,REPCLA.STEPC=R//S2 EXEC SSSPR01,REPCLA.STEPB=X

System knows that:REPORT1, STEPA, procstep S1 : SYSOUT=A REPORT1, STEPB, procstep S1 : SYSOUT=* REPORT1, STEPC, procstep S1 : SYSOUT=R REPORT1, STEPA, procstep S2 : SYSOUT=* REPORT1, STEPB, procstep S2 : SYSOUT=X REPORT1, STEPC, procstep S2 : SYSOUT=*

Page 189: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

189Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCs – symbolic parameters

To override symbolic parameters default values, one must specify the new value in when proc is invoked. :

ddname.step_name=xxx

Page 190: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

190Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCs – symbolic parameters

Another way to change default, valid for the whole or part of the job, is via SET command:

Syntax : //[name] SET symbolic_variable=[value]

//SSSPRO1 PROC //STEPA EXEC PGM=PPPX1//DD1 DD DSN=...//SYSPRINT DD SYSOUT=&REPCLA//STEPB EXEC PGM=PPPX2//SYSPRINT DD SYSOUT=&REPCLA//STEPC EXEC PGM=PPPX3//SYSPRINT DD SYSOUT=&REPCLA// PEND// SET REPCLA=A//STEP1 EXEC SSSPR01 //STEP2 EXEC SSSPR01 //STEP3 EXEC SSSPR01 //STEP4 EXEC SSSPR01 //STEP5 EXEC SSSPR01 // SET REPCLA=B//STEP6 EXEC SSSPR01 //STEP7 EXEC SSSPR01 //STEP8 EXEC SSSPR01 //STEP9 EXEC SSSPR01 //STEP10 EXEC SSSPR01

Steps 01, 02, 03, 04 and 05 have REPCLA value ASteps 06, 07, 08, 09 and 10 have RELCLA value B

Page 191: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

191Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCs – including DD in the proc

Including DD in the proc

Page 192: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

192Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCS – including DD in the proc

If you need to include a DD (there is no such DD in the PROC, it must be included to the step’s DDs) :

//stepname.ddname DD parameters

Ex.:

//S2 EXEC SSSPR01,REPCLA.STEPB=X//STEPB.REPOTHER DD SYSOUT=*

Page 193: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

193Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCS – including datasets in the proc

Including datasets

Page 194: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

194Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCs – includind datasets

Additional dataset:

If it is necessary to include a dataset (there is no such DD in the PROC, it must be included to the step’s DDs):

//stepname.ddname DD parameters

Ex.:

//S2 EXEC SSSPR01,REPCLA.STEPB=X//STEPB.REPOTHER DD SYSOUT=*

Page 195: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

195Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCs – including datasets

To include one more dataset in a concatenation sequence:

To include one additional dataset (to concatenate) in na existing DD: specify 1 DD for each existant DD, without parameters, and add the desired one as the last DD.

//stepnameddname DD // DD// DD new_datasetExample : //STEP1 EXEC PROCX1//STEPA.DD2 DD // DD // DD DSN=TST.ARQUIVOX...

Page 196: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

196Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCs – changing EXEC parameters

Changing EXEC parameters

Page 197: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

197Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

PROCs – changing EXEC paameters

When invoking the PROC, specify the parameter and stepname you wish to change:

//stepname EXEC PROC=xxx,parameter.stepname=value

Ex.:

//S2 EXEC SSSPR01,RELCLA.STEPB=X,PARM.STEPB=‘YES’//STEPB.RELOUTRO DD SYSOUT=*

Page 198: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

198Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – IF / THEN / ELSE / ENDIF

IF / THEN / ELSE / ENDIFCommands

Page 199: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

199Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – IF / THEN / ELSE / ENDIF

These commands coan be used rather than COND (and they’re easyer to understand...).

Syntax : // IF (condition) THEN statements to execute if condition is TRUE// ENDIF

or

// IF (condition) THEN statements to execute if condition is TRUE// ELSEstatements to execute if condition is FALSE// ENDIF

Page 200: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

200Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – IF / THEN / ELSE / ENDIF

Condition = indicates that the statements below THEN must be executed if condition is TRUE. The tests may be as follows:

Page 201: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

201Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – IF / THEN / ELSE / ENDIF

To test the previous’ step return code:

[stepname.]RC EQ return_code or [stepname.]RC GT return_code or [stepname.]RC LT return_code or [stepname.]RC NE return_code or [stepname.]RC NL return_code or [stepname.]RC NG return_code or [stepname.]RC GE return_code or [stepname.]RC LE return_code

Page 202: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

202Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – IF / THEN / ELSE / ENDIF

To test whether a previous step was executed or not (not flushed or flushed) :

[stepname.]RUN EQ TRUE ou [stepname.]RUN EQ FALSE [stepname.]RUN EQ TRUE ou [stepname.]RUN EQ FALSE

Page 203: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

203Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – IF / THEN / ELSE / ENDIF

To test whether a previous step has abended or not:

[stepname.]ABEND EQ TRUE or [stepname.]ABEND EQ FALSE [stepname.]ABEND EQ TRUE or [stepname.]ABEND EQ FALSE

Page 204: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

204Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – IF / THEN / ELSE / ENDIF

To test a previous’ step Completion Code (system or user) : [stepname.]ABENDCC EQ Snnn or [stepname.]ABENDCC EQ Unnnn [stepname.]ABENDCC EQ Snnn or [stepname.]ABENDCC EQ Unnnn

Page 205: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

205Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – IF / THEN / ELSE / ENDIF

Multiple contitions:

Use parenthesis to specify test priority and sequence.

Use & for and

Use | for or

Page 206: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

206Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – IF / THEN / ELSE / ENDIF

ENDIF is mandatory to specify the end of the set of commands to be executed, with or withot ELSE.

ELSE is optional.

IMPORTANT : Use of COND + IF / THEN / ELSE / ENDIF together is extremely confusing. DON’T DO THAT!

Page 207: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

207Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – IF / THEN / ELSE / ENDIF

Example :

//ARSARS01 JOB (1234),'ROMANO',CLASS=1,MSGCLASS=X //*------------------------------------------------------------ //STEP01 EXEC PGM=IEFBR14 //STEP02 EXEC PGM=IEFBR14 // IF (STEP01.RC NG 0) THEN //STEP03 EXEC PGM=IEFBR14 // ENDIF //*------------------------------------------------------------ //STEP04 EXEC PGM=IEFBR14 // IF ((STEP01.RC EQ 0)) THEN //STEP05 EXEC PGM=IEFBR14 // ELSE //STEP06 EXEC PGM=IEFBR14 // ENDIF //*------------------------------------------------------------ //STEP07 EXEC PGM=IEFBR14 // IF ((STEP01.RUN EQ TRUE)) THEN//STEP08 EXEC PGM=IEFBR14 // ENDIF // IF ((STEP01.RUN EQ FALSE)) THEN //STEP09 EXEC PGM=IEFBR14 // ENDIF

The execution of this JCL results in:

Page 208: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

208Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

JCL – IF / THEN / ELSE / ENDIF

Example :

$HASP373 LSG#@ARS STARTED - INIT 2 IEF403I LSG#@ARS - STARTED - TIME=14.52.18 # # JOBNAME STEPNAME PROCSTEP PROGRAM RC # LSG#@ARS STEP01 IEFBR14 00 # LSG#@ARS STEP02 IEFBR14 00 # LSG#@ARS STEP03 IEFBR14 00 # LSG#@ARS STEP04 IEFBR14 00 # LSG#@ARS STEP05 IEFBR14 00 # LSG#@ARS STEP06 IEFBR14 FLUSH # LSG#@ARS STEP07 IEFBR14 00 # LSG#@ARS STEP08 IEFBR14 00# LSG#@ARS STEP09 IEFBR14 FLUSH IEF404I LSG#@ARS - ENDED - TIME=14.52.19

Page 209: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

209Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

Appendix - CONTROL’s – BMC SoftwareProduto Função

Control-M Automated Production Control and Scheduling System

Manages and automates the setup, scheduling and execution of jobs in the data center.

Control-M / Restart Restart Management System

Automates the activities that must be performed when restarting failed jobs, including the scratching and uncataloging of datasets created by failed jobs.

Control-M / Tape Removable Media Management System

Increases utilization of removable media and controls retention periods. Prevents misuse of media, and provides tape library and vault control.

Control-M / Analyser

Automated Information Integrity System

Performs in-stream validation, accuracy, and reasonability checks on information used by data center production tasks (for example, reports, databases).

Control-D Output Management System Automatically schedules

and controls every aspect of report processing and distribution, including report decollating, bundling, printing, online viewing, and archiving.

Control-V Quick Access Archive Viewing System

Provides online access to archived reports and documents by indexed data retrieval

Page 210: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

210Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

CONTROL’s – BMC SoftwareProduto Função

Control-D / Page on demand

Report Retrieval and Display System

Enables end users to retrieve and view pages of reports that reside on mainframe storage in real time. Indexed reports can be retrieved by index name and value. AFP and XEROX reports can also be retrieved and displayed

using CONTROL-D/Web Access Server or CONTROL-D/Page On Demand API.

Control-D / Image Image Output Management System

Enables output from commercial imaging equipment to be imported into either CONTROL-D or CONTROL-V for decollation, distribution and viewing, and into

CONTROL-V for archiving and indexed retrieval.

Control-O Console Automation System and Desired State

Monitoring System

Monitors and automatically responds to messages, commands, and dataset events, as well as various other system events.

The CONTROL-O/COSMOS feature allows for status monitoring while maintaining all critical system objects in a desired and ideal status.

Page 211: 1 Summary Prev.Pg. Alberto Romano Schiesari –  MVS JCL concepts

211Summary Prev.Pg. Alberto Romano Schiesari – www.profars.com

THE END