Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 4650
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: 4650
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 it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Hardcoded negative sign value in output scdinesh SYNCSORT 8 Fri Sep 08, 2017 5:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us