Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Running REXX in a job and passing the output to next step
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: 2360
Location: Israel

PostPosted: Mon Aug 21, 2006 6:07 pm    Post subject:
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    Post subject:
Reply with quote

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

Moderator Team Head


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

PostPosted: Mon Aug 21, 2006 8:33 pm    Post subject: Re: Running REXX in a job and passing the output to next ste
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

Moderator Team Head


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

PostPosted: Tue Aug 22, 2006 8:33 pm    Post subject: Re: Running REXX in a job and passing the output to next ste
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts Restart=Step not working ALAK SAHA JCL & VSAM 6 Fri Jun 30, 2017 6:28 pm
No new posts JES2 doesn't honor the priority of th... Aron Lendvai JCL & VSAM 7 Thu Jun 29, 2017 1:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us