How to implement the JCL &&temp function available in z/OS JCL for the creation of RC/Migrator for Db2 for z/OS (RCM) temporary files in Batch processor code.
These temp files are to be stored on work packs as would the &&temp file in JCL.
This can be customised in the models. If SMS is active, modification of the symbolic variables can create a filename that would be picked up
and placed on work packs. If SMS is not active the use of UNIT(WORK) would do the same job.
As an example , the allocation of the temporary DD PTIUT1 in a FLOAD utility model where SMS is not active:
.ALLOC FI(PTIUT1) +
SPACE(%UT1SP1,%UT1SP2) CYL +
UNIT(%UTUNIT)
or without UNIT where SMS is active.
.ALLOC FI(PTIUT1) +
SPACE(%UT1SP1,%UT1SP2) CYL
UTUNIT = WORK
UT1SP1 = %CALC((%ROSYSUT1*50)/100+1)
UT1SP2 = %CALC((%ROSYSUT1*30)/100+1)
The analysis output produces:
.ALLOC FI(PTIUT1) +
SPACE(6,4) CYL +
UNIT(WORK)
or
.ALLOC FI(PTIUT1) +
SPACE(6,4) CYL
After the above statement is executed , in the allocated datasets , on the test system this DD name could be seen:
TMPD06 NEW,DEL > PTIUT1 SYS21203.T010818.RA000.myjobid.R0636121
of format:
TMPDnn NEW,DEL > PTIUT1 SYSyyddd.Thhmmss.RA000.jjobname.Rggnnnnn
The "SYS21203.T010818.RA000.myjobid.R0636121" temporary dataset name was allocated by the system for this job as the allocation statement above did not have the DA parm.
where:
yy
indicates the year
ddd
indicates the Julian day
hh
indicates the hour
mm
indicates the minute
ss
indicates the second
jjobname
indicates the name of the job
Rgg
01, or, in a sysplex:
for JCL allocations, the system identifier of the system that interpreted the job.
for dynamic allocations, the system identifier of the system on which the job executed.
nnnnn
a number that is unique within a system
Caution:
A user is able to manually code this in a batch processor job:
.ALLOC FI(PTIUT1) +
DA('&&TEMP') +
SPACE(6,4) CYL
And executed...........
.ALLOC FI(PTIUT1) +
DA('&&TEMP') +
SPACE(6,4) CYL +
UNIT(WORK)
RETCODE = 0
and a temporary dataset similar to this is allocated:
TMPD09 NEW,DEL > PTIUT1 SYS21203.T003028.RA000.myjobid.TEMP.H06
of format:
TMPDnn NEW,DEL > PTIUT1 SYSyyddd.Thhmmss.RA000.jjobname.dsetname.Hgg
where:
yy
indicates the year
ddd
indicates the Julian day
hh
indicates the hour
mm
indicates the minute
ss
indicates the second
jjobname
indicates the name of the job
dsetname
the 1 to 8 character DSNAME coded following the two ampersands (&&)
Hgg
01, or, in a sysplex:
for JCL allocations, the system identifier of the system which interpreted the job.
for dynamic allocations, the system identifier of the system on which the job executed.
However, the &&TEMP syntax IS NOT supported in an RC/Migrator model!!. The &&TEMP is changed to $$TEMP during the analysis and the execution will fail.
.ALLOC FI(PTIUT1) +
DA('$$TEMP') +
SPACE(6,4) CYL +
UNIT(WORK)