IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Running REXX in a job and passing the output to next step


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sunnyk

New User


Joined: 20 Oct 2004
Posts: 59

PostPosted: Mon Aug 21, 2006 5:16 pm
Reply with quote

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.


Regds
Sunny
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Aug 21, 2006 6:07 pm
Reply with quote

Do you want to pass the content of the dataset or the name of the dataset?

O.
Back to top
View user's profile Send private message
sunnyk

New User


Joined: 20 Oct 2004
Posts: 59

PostPosted: Mon Aug 21, 2006 6:16 pm
Reply with quote

I want to pass Name of the dataset.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Aug 21, 2006 8:33 pm
Reply with quote

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             
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Aug 22, 2006 8:33 pm
Reply with quote

I also want to point out, once again, that:

ABC.DEF.XYZ.20060821.16015700

is NOT a valid dataset name.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top