1 / 211

MVS JCL concepts

MVS JCL concepts. Presentation. Thanks for using this presentation. You are free to use it. I appreciate if you refer to the author when using it.

sandra_john
Download Presentation

MVS JCL concepts

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MVS JCL concepts

  2. 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 arschiesari@yahoo.com

  3. Summary IBM main operating systems MVS line Executing services demand General flow JES2 Input spool and Output spool Input spool Job submission - Roscoe Stacking jobs at input spool Contents of each job in the input spool Initiators Output spool JCL JOB EXEC DD Library search PROCS Apendix - CONTROL’s

  4. Concepts IBM main operating systemsseehttp://publib.boulder.ibm.com/infocenter/zos/basics/index.jsp

  5. Concepts – IBM main operating systems • IBM main operating systems “DOS” or “VSE” lineDOS (1966)DOS/VS (1972)DOS/VSE (80’s)VSE/ESA (1991)z/VSE (2005)

  6. Concepts – IBM main operating systems • IBM main operating systems“VM” lineVM/370 (1972)VM/SP (1980)VM/XA (1988)VM/ESA (1990)z/VM (2000)

  7. Concepts – IBM main operating systems Conceitos • IBM main operating systems “Real-time” (transactional) lineACP (1969)TPF (1979)z/TPF (2005)

  8. Concepts – IBM main operating systems Conceitos • IBM main operating systemsUnix-like lineUTS (1981)AIX/370 (1990)AIX/ESA (1991)LINUX (1999)Open Solaris (2008)

  9. Concepts – IBM main operating systems Conceitos • IBM main operating systems MVS lineMFT (1966) ; OS/VS1 (1972) (end)MVT (1967) OS/VS2 R1 (SVS) (1972) 24-bit addressing; Single Address SpaceMVS (OSVS2 R2) (1974) 24-bit addressing; Multiple Address SpacesMVS/370 (1981) .MVS/XA (83) Extended ArchitectureMVS/ESA (1988) Enterprise System Architeture; 31-bit addressingOS/390 (1995) . z/OS (2000) ; 24-,31- 64-bit addressingz/OS 1.10 (Sep 2008)

  10. Concepts – IBM main operating systems 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 userThis language, in MVS and derived operating systems, is known as JCL (Job Control Language)

  11. Concepts – IBM main operating systems Conceitos Curiosity: example of a DOS (PC’s) JCL (.bat files) @echo offcls:aECHO Compiling %1IF EXIST %1.OBJ DEL %1.OBJCOBOL %1; ANIM COPYLIST > %1.LSTIF ERRORLEVEL 1 ECHO *** Error LINK %1+%COBDIR%\ADIS+%COBDIR%\ADISKEY+%COBDIR%\ADISINIT; >> %1.LSTrem TYPE %1.LSTshift if not "%1" == "" goto a@ECHO

  12. Concepts – IBM main operating systems 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.functionsFILE=/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

  13. Concepts – IBM main operating systems 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 /* /& * $$ EOJhttp://gsf-soft.com/Prism-CS/Samples/BKPD047.shtml

  14. Concepts – IBM main operating systems 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

  15. MVS line – executing services demand Executing services demand

  16. MVS line – executing services demand BE CAREFUL! ACHTUNG!Everything you’re gonna see/read/listen is OK for BACTH applications !

  17. MVS line – executing services demand BE CAREFUL! ACHTUNG!Everything you’re gonna see/read/listen is OK for BACTH applications !

  18. MVS line – general flow General flow System Service Input (execution order) Result Output basically: print (paper or “terminal”)

  19. ? How do services get into the system? MVS line – general flow General flow SYSTEM Service Input (execution order)

  20. ? How do results get out of the system? MVS line – general flow General flow SYSTEM Result Output basically: print (paper or “terminal”)

  21. 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)

  22. JES2 JES2 components that receive the inputs JES2 components that send the results out JES2 Therefore: Service Input (execution order) Result Output (basically: print on paper or “terminal”)

  23. JES2 In other words: z/OS Operating system Component 1 ... Component 2 ... JES2 Component n ... Application 1 Service Input (execution order) Result Output (basically: print on paper or “terminal”) Application 2 ... Apllication n (ex.:CICS) ... Application x (ex.: DB2) ... Application z ...

  24. JES2 For example: z/OS Operating system Component 1 ... Component 2 ... JES2 Component n ... Application 1 Services input via terminal (“sub” command ) Results output browse via terminal (job sysout browse) Application 2 ... Apllication n (ex.:CICS) ... Application x (ex.: DB2) ... Application z ...

  25. JES2 But... We have to remember that: z/OS Operating system Component 1 ... Component 2 ... JES2  Component n ...  Application 1 Application 2 ... Apllication n (ex.:CICS) ... Application x (ex.: DB2) ... Terminals for BROWSE (they MUST be associated to an application program !!!) Terminals for SUB (they MUST be associated to an application program !!!) Application z ...

  26. JES2 What is (are) this (these) application program(s)? z/OS Operating system Component 1 ... Component 2 ... JES2  Component n ...  Application 1 Application 2 ... Apllication n (ex.:CICS) ... Application x (ex.: DB2) ... What is the application program responsible for this terminal? What is the application program responsible for this terminal? Application z ...

  27. JES2 It may be Roscoe... JES2   ROSCOE Roscoe sends the services to the JES2 Roscoe gets the results from JES2

  28. JES2 Or TSO... JES2   TSO TSO sends the services to the JES2 TSO gets the results from JES2

  29. JES2 But, even either Roscoe or TSO... JES2   Roscoe or TSO The terminal is just a visual interface The terminal is just a visual interface

  30. JES2 Where are, in fact, the data? JES2   Roscoe or TSO Where is the sysout being accessed to browse? Where is the stream we built and submitted?

  31. JES2 In disk ! In the spool areas ! JES2   Roscoe or TSO Output spool area INPUT spool area

  32. JOB input Let’s see some details about spool input process JES2 Input spool area  Roscoe or TSO

  33. JOB input – TSO/ROSCOE NOTE : use of ROSCOE (data manipulation via AWS)... Roscoe work area (AWS) (create / FETCH/ATTACH) Roscoe  Roscoe LIB’s (proprietary data organization) (SAVE or UPDATE)

  34. JOB input – TSO/ROSCOE NOTE : ... or TSO (data manipulation directly in the “normal” datsets areas) Partitioned dataset member TSO  Sequential dataset

  35. JOB input – TSO/ROSCOE NOTE : we’ll refer to data manipulation using Roscoe or TSO using this figure Edited data To be submitted TSO/Roscoe 

  36. JOB input – TSO/ROSCOE Step 1 = edit data to be submitted Edited data To be submitted TSO/Roscoe 

  37. JOB input – TSO/ROSCOE Step 1 = edit data to be submitted //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 ENTRADA LAG 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---------* TSO/Roscoe 

  38. JOB input – TSO/ROSCOE Another sight... Roscoe 

  39. JOB input – TSO/ROSCOE A c-a-r-e-f-u-l analysys of the data to be submitted... //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 ENTRADA LAG 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---------* TSO/Roscoe 

  40. 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

  41. 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 * Step C, SYSIN dataset data Step G, AGENCIAS dataset data Red = JCL Blue = data

  42. //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 ENTRADA FLAG 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---------* JOB input – TSO/ROSCOE Getting back to the relationship between Roscoe and JES... TSO/Roscoe 

  43. JOB input – TSO/ROSCOE Roscoe submits (delivers) the stream that came from AWS to JES... JES2 Input spool area Edited data  TSO/Roscoe SUB

  44. JOB input – TSO/ROSCOE The JES component that reads the things somebody (Roscoe, TSO...) submitted is (are) the READER(s) / INTERPRETER(s) JES2 Input spool area Reader  TSO/Roscoe AWS SUB

  45.  SUB SUB JOB input – TSO/ROSCOE 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”) JES2 Input spool area Readers “Normal” datasets AWS TSO Roscoe

  46.  SUB SUB JOB input Let’s see better the input spool area JES2 Input spool area Readers “Normal” datasets AWS TSO Roscoe

  47. JOB0001 JOB0002 JOB0003 JOB0004 JOB0005 JOB0008 Etc... JOB0007 JOB0006 JOB input Input spool area : the archieving unit is the JOB

  48. JOB0001 JOB0002 JOB0003 JOB0004 JOB0005 JOB0008 Etc... JOB0007 JOB0006 JOB input The JOBS are queued based on the entry sequence; each Job receive an Id #, that will follow it throughout its whole life.

  49. JOB0001 JOB0002 JOB0003 JOB0004 JOB0005 JOB0008 Etc... JOB0007 JOB0006 JOB input The JOBS remains in the queue awaiting execution.

  50. JOB input Let’s see some details about how the Jobs are stored. Let’s detail one of them (JOB0001): JOB0001 ALL JCL records (statements) (one single dataset) For each in-stream dataset in the submitted stream, is created a file identified with stepname + DDname

More Related