|
Back Issue
|
Generating Control Cards
Sometimes, it is necessary to create control cards which have variable
content. This can be particularly useful for started task procedures
because instream SYSIN is not an option. One method sometimes used is
to use the assembler to create output control cards instead of machine
instructions using the symbol manipulation capabilities of the assembler
and the PUNCH directive.
Here is another method based on REXX:
- create a small REXX exec similar to the following:
/* REXX */
PARSE ARG parm
card.1 = 'Parm = 'parm
card.2 = 'Date = 'DATE()
card.3 = 'Jobname = 'MVSVAR('SYMDEF','JOBNAME')
count = 3 /* total number of cards */
'EXECIO 'count' DISKW CARDS (stem card. finis'
/* write the cards to DDNAME CARDS */
Exit 0
This example produces 3 control cards which contain the
input parameter to the EXEC, the current date and the
current job name.
- save it as a member, say CARDIN, in a partitioned dataset
- you can run this EXEC using JCL similar to the following:
//S1 EXEC PGM=IRXJCL,REGION=2000K,PARM='CARDIN DEMONSTRATION RUN'
//SYSEXEC DD DISP=SHR,DSN= PDS containing the REXX
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//CARDS DD DISP=(,PASS),UNIT=WORK,DSN=&&CARDS,RECFM=FB,LRECL=80
....
During development, the output can be directed to print rather than
a temporary dataset. The REXX environment provides access to a
powerful set of functions which can be useful in generating control
cards dynamically. Visit the REXX page here for
more information about REXX.
Feedback
Comments or suggestions can be
sent to the author.
Last Month's Issue