|
This is a collection of hints, tips, and samples that may be
useful to people who use JCL.
The usual disclaimers apply to all code samples (including the MACROs').
Obviously the JCL coded here will need to be tailored to your own sites standards and
the dataset names changed to match your own. The samples are just
examples of how to, and not they are not meant to be copied verbatim
|
How to Avoid Missing Symbolic Parameters |
|
|
//ANYPROC
PROC PARM1='NOSUCHPARM',PARM2='SYS1',PARM3='ANYVALUE'
//NOFAIL EXEC PGM=IEFBR14,
// PARM='&PARM1&PARM2&PARM3'
|
This is a useful little trick to avoid instances where you change a JCL procedure and
inadvertently delete any instance of a symbolic parameter. This is especially true if
it is the only instance of that symbolic parameter.
By using the parameters in
the parameter list for IEFBR14 you will ensure that the procedure will always resolve the
symbolic parameters. IEFBR14 will do absolutely nothing with them so it is 100% safe.
Remember that there is a limit to the length of a parameter and you may need to use
multiple IEFBR14 steps to account for all the parameters used with the JCL procedure. |
|
|
| |
|
How to use ASLPARMC |
|
|
//BKPQMGR
PROC SERVER='NOSUCHSERVERNAME',PORT='1414',SR='AB'
//CARD1 EXEC PGM=ASLPARMC,
// PARM='@JOBNAME - Backup of &SR&SERVER Qmgr defines
started'
//OUTPUT DD DISP=(,PASS,DELETE),UNIT=SYSDA,
// SPACE=(TRK,(10,5),RLSE),DSN=&&SYSSTAR
//CARD2 EXEC PGM=ASLPARMC,
// PARM='@JOBNAME - Backup of &SR&SERVER Qmgr defines ended'
//OUTPUT DD DISP=(,PASS,DELETE),UNIT=SYSDA,
// SPACE=(TRK,(10,5),RLSE),DSN=&&SYSEND
//CARD3 EXEC PGM=ASLPARMC,
// PARM='<CONN>&SR&SERVER(&PORT)'
//OUTPUT DD DISP=(,PASS,DELETE),UNIT=SYSDA,
// SPACE=(TRK,(10,5),RLSE),DSN=&&SYSTIN
//CARD31 EXEC PGM=ASLPARMC,
// PARM='<BKUP>*'
//OUTPUT DD DSN=*.CARD3.OUTPUT,DISP=MOD
//STEPDEL1 EXEC PGM=UTDELETE,PARM='RC=0,ABBYDALE.BKUP.&SERVER..PDS'
//STEPSTAR EXEC PGM=BSLBR14,PARM='WAIT=0'
//DD1 DD DSN=ABBYDALE.BKUP.&SERVER..PDS,SPACE=(TRK,(5,4,10)),
// VOL=SER=volser,UNIT=SYSALLDA,DISP=(,CATLG),
// DCB=(LRECL=80,BLKSIZE=6160,RECFM=FB)
//SYSIN DD DSN=*.CARD1.OUTPUT,DISP=(MOD,DELETE)
//STEP EXEC PGM=BSLNULL
//DD1 DD DISP=SHR,DSN=ABBYDALE.BKUP.&SERVER..PDS($$$INDEX)
//STEP1 EXEC PGM=RMTMQBKP
//BKUP0001 DD DISP=SHR,DSN=ABBYDALE.BKUP.&SERVER..PDS
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//CMDIN DD DSN=*.CARD3.OUTPUT,DISP=(MOD,DELETE)
//STEPEND EXEC PGM=BSLBR14,PARM='WAIT=0'
//SYSIN DD DSN=*.CARD2.OUTPUT,DISP=(MOD,DELETE) |
ASLPARMC is available from here.
ASLPARMC enables you to use JCL
symbolic replacements in control cards to be used in later JCL steps.
This negates the need for control card libraries and it
makes the JCL much more flexible.
Another neat feature of ASLPARMC is that it will replace any @JOBNAME
found in the passed parameter with the name of the job actually
executing the program.
This particular piece of JCL is used to backup all the MQ queue
managers on a Windows server.
Of course you need our MQTCPServer Windows
service installing and the programs RMTMQBKP, UTDELETE, BSLNULL and BSLBR14 installed but
this example is really
only here to show how to use ASLPARMC
This JCL also presupposes that the
programs reside in a library that is in the LNKLST concatenation. |
|
|
| |
|
How to Reload an IEBUPDTE unloaded dataset |
|
|
//IEBUPDTE JOB
//STEPDEL EXEC PGM=ASLDEL,
// PARM='your.output.dataset.name'
//BUILD EXEC PGM=IEBUPDTE,PARM=NEW
//SYSPRINT DD DUMMY
//SYSUT2 DD DISP=(,CATLG),UNIT=SYSALLDA,SPACE=(80,(5,1,4)),
// DSN=your.output.dataset.name,VOL=SER=volser,
// RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PO
//SYSIN DD DISP=SHR,DSN=your.input.dataset.name
|
This job stream will reload a partitioned dataset that is in IEBUPDTE unloaded format.
It uses ASLDEL to delete the target dataset if it currently exists. If it doesn't exist the
jobstream will still run successfully (this is ASLDEL's advantage over IEFBR14...no JCL error!')'
ASLDEL is available from here.
The JCL will need to be tailored to your site and your dataset naming conventions...and indeed your SMS
requirements.
If you need to see the output generated then change the SYSPRINT from DUMMY to SYSOUT=* (or your desired output class).
This JCL assumes that ASLDEL reside in a library that is in the LNKLST concatenation. |
|
|
|