Hi all,
I hope i am not repeating an already answered query.
My requirement is that i want to execute a REXX step in a JCL (there are few steps prior to REXX step) and the the output of this REXX step i want to pass on to next step.
Below is my REXX step but i don't know how to execute it in a job:
Code:
/* REXX */
OLD_DSN = ABC.DEF.XYZ
TOD=TIME('N') /* GET TIME OF DAY*/
PARSE VAR TOD HH ':' MM ':' SS /*FOR REMOVE THE SEMI-COLNS*/
NEW_DSN = OLD_DSN||'.'||DATE('S')||'.'||HH||MM||SS||'00'
SAY NEW_DSN
And the NEW_DSN created above i want to pass on to next step. But as this output 'll be dynamic based on date and time, can anyone help me out on what name i should pass on as the next step input.
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
In order to pass data from one job step to another, you must write out to external storage (VIO, DISK, TAPE) in the current job step, then read the data in the next job step. You need to write out the dataset name to an assigned DD (with a Disposition that keeps the dataset, such as CATALOG or PASS) with an EXECIO statement. Then, that data will be available to a subsequent job step.
Here's an example job, using your example code:
Code:
//*
//STEP0001 EXEC PGM=ICEGENER
//SYSUT1 DD *,DLM=@@
/* REXX */
OLD_DSN = ABC.DEF.XYZ
TOD=TIME('N') /* GET TIME OF DAY*/
PARSE VAR TOD HH ':' MM ':' SS /*FOR REMOVE THE SEMI-COLNS*/
NEW_DSN = OLD_DSN||'.'||DATE('S')||'.'||HH||MM||SS||'00'
SAY NEW_DSN
PUSH NEW_DSN
"EXECIO 1 DISKW OUTDD (FINIS"
EXIT 0
@@
//SYSUT2 DD DSN=&&PDS(X),DISP=(,PASS),UNIT=VIO,
// SPACE=(TRK,(1,1,1),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//*
//STEP0002 EXEC PGM=IKJEFT01,PARM='%X'
//SYSPROC DD DSN=&&PDS,DISP=(OLD,PASS)
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//OUTDD DD DSN=&&T1,DISP=(,PASS),UNIT=VIO,
// RECFM=FB,LRECL=80,
// SPACE=(TRK,(1,1),RLSE)
//*
//STEP0003 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD DSN=&&T1,DISP=(OLD,PASS)
//*
So, in the output of STEP003, your dataset name appears:
Code:
1IDCAMS SYSTEM SERVICES TIME: 16:01:50
0
ABC.DEF.XYZ.20060821.16015700
0IDC3219I VERB NAME 'BC.DEF.XYZ.20060821.' UNKNOWN
0IDC3202I ABOVE TEXT BYPASSED UNTIL NEXT COMMAND. CONDITION CODE IS 12
0
0IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 12