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

JCL To Execute A REXX Program


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

New User


Joined: 04 May 2007
Posts: 58
Location: Manila, Philippines

PostPosted: Mon Aug 06, 2007 4:27 pm
Reply with quote

Hello,

I am new to REXX and I don't know how to execute it.
Can someone provide me with a JCL to execute a REXX program?


Thanks.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Aug 06, 2007 5:00 pm
Reply with quote

did you even try to search or look at the sticky(s) in the appropriate forum?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Aug 06, 2007 6:54 pm
Reply with quote

Or simply read the fine manuals?

O.
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 06, 2007 6:59 pm
Reply with quote

Some good relevant topics:

ibmmainframes.com/viewtopic.php?t=5902
ibmmainframes.com/viewtopic.php?t=11083
ibmmainframes.com/viewtopic.php?t=5351
ibmmainframes.com/viewtopic.php?t=4278
Back to top
View user's profile Send private message
ironmike

New User


Joined: 07 Aug 2005
Posts: 33

PostPosted: Tue Aug 07, 2007 4:24 am
Reply with quote

Here ya go:

Code:
//* INVOKE REXX IN BATCH...                       
//JS10    EXEC PGM=IRXJCL,REGION=0K,PARM='xxxxxxxx'   
//SYSEXEC   DD DSN=xxxxx.CLIST,DISP=SHR         
//SYSTSPRT  DD SYSOUT=*                           
//SYSTSIN   DD DUMMY,BLKSIZE=80                   
//                                               
   


Parm field contains name of REXX exec to invoke, and SYSEXEC DD points to PDS containing REXX exec to invoke. You will have to specify these two and add a JOB statement.
Back to top
View user's profile Send private message
Raphael Bacay

New User


Joined: 04 May 2007
Posts: 58
Location: Manila, Philippines

PostPosted: Tue Aug 07, 2007 11:41 am
Reply with quote

Thanks a lot!
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Tue Aug 07, 2007 2:27 pm
Reply with quote

Code:


//STEP1 EXEC PGM=IKJEFT01,PARM='%rexxpgm-name arguments'     
//SYSEXEC  DD DSN=REXX-PDS-NAME,DISP=SHR                       
//SYSTSPRT DD  SYSOUT=*                                                 
//MYINDD   DD  DSN=Input file if any
//SYSTSIN  DD  DUMMY                   

                               

Back to top
View user's profile Send private message
Anurag Singh

New User


Joined: 20 Jan 2008
Posts: 25
Location: India

PostPosted: Fri Mar 21, 2008 12:20 pm
Reply with quote

Hi,

Kindly guide me regarding my doubt ,
I have to invoke a rexx pgm by a job, for that i can use any of the provisions posted in this post,
however at every time executing the JCl job to invoke the rexx pgm, i have to pass different dataset name which is used in the REXX pgm ,
(The Passed dataset (PDS) is used by the rexx pgm to make changes in the members of the PDS).
Back to top
View user's profile Send private message
Anurag Singh

New User


Joined: 20 Jan 2008
Posts: 25
Location: India

PostPosted: Fri Mar 21, 2008 12:28 pm
Reply with quote

Hi,

Sorry the previous post was left incomplete , kindly refer this for full scenario,

Kindly guide me regarding my doubt ,
I have to invoke a rexx pgm by a job, for that i can use any of the provisions posted in this post,
however at every time executing the JCl job to invoke the rexx pgm, i have to pass different dataset name which is used in the REXX pgm ,
(The Passed dataset (PDS) is used by the rexx pgm to make changes in the members of the PDS).

Now how can i pass the DSN name from JOB , and what necessary changes should be done in the REXX pgm to accept the passed DSN name from JCL JOb??
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Mar 21, 2008 12:38 pm
Reply with quote

no need to pass the dsname to the rexx script

when running in batch why complicate things
let the jcl allocate the dataset and refer to it by ddname...

interactive snippet ...
Address TSO ALLOC DA(...dsname...) FI(...ddname...)
Address TSO EXECIO * READ ...ddname...

batch snippet
jcl section
//...ddname... DD ...
REXX section
Address TSO EXECIO * READ ...ddname...

less work to be done in rexx, no need to allocate and check the result
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Mar 21, 2008 2:18 pm
Reply with quote

ironmike wrote:
Here ya go:

Code:
//* INVOKE REXX IN BATCH...                       
//JS10    EXEC PGM=IRXJCL,REGION=0K,PARM='xxxxxxxx'   
//SYSEXEC   DD DSN=xxxxx.CLIST,DISP=SHR         
//SYSTSPRT  DD SYSOUT=*                           
//SYSTSIN   DD DUMMY,BLKSIZE=80                   
//                                               
   


Parm field contains name of REXX exec to invoke, and SYSEXEC DD points to PDS containing REXX exec to invoke. You will have to specify these two and add a JOB statement.

IRXJCL does not permit the full functionality of IKJEFT01, so if your REXX uses TSO commands such as ALLOCATE etc. etc. they will fail.
Back to top
View user's profile Send private message
XOpen

New User


Joined: 19 Mar 2008
Posts: 11
Location: Russia

PostPosted: Fri Mar 21, 2008 2:38 pm
Reply with quote

If it was working REXX, why not to pass DSN same way, as a parameter? I agree DD is better, but for new programs.

I also recomend create a PROC and pass your DSN as a parameter to PROC.(It doesn't matter you will use DD or parm) And it will allow you run it from console via /S command. (so you can ask operators do it, or schedule it)
Back to top
View user's profile Send private message
Anurag Singh

New User


Joined: 20 Jan 2008
Posts: 25
Location: India

PostPosted: Fri Mar 21, 2008 3:03 pm
Reply with quote

MY constraint is , i can not allocate the dataset by JCL, bcoz its already getting allocated through some other application.

In explored way ,
the datset which i want to pass to the REXX pgm is already allocated PDS with 25 members, i can not do any changes in that dataset,

So for this i am just copying the full pds with Utility and then my rexx pgm is there to insert some set of lines in each members of pDS,

Now every time of execution ,this dataset name will be different as it is coming from some other application.

Here every time before executing the Rexx Invoking JCL , manually i have to change the Dataset name in REXX pgm,

So in my JOb first step is for copying the Original pDS to other PDS.
step 2 is for invoking the REXX pgm ,
here only i want to Pass the Duplicate PDS which is generated thru step 1 to the REXX pgm , because the logic in REXX is started with the PDS name ,(Logic:open the PDS member and then insert a tag in every member.)
Kindly Suggest me the Way to resolve this prob??
Back to top
View user's profile Send private message
XOpen

New User


Joined: 19 Mar 2008
Posts: 11
Location: Russia

PostPosted: Fri Mar 21, 2008 3:32 pm
Reply with quote

I would design it with GDG dataset. So you can use in step 1 last in GDG(0), create(+1) and use(+1) in step2.

But if you can't follow GDG name convention, you can pass DD. Write in step 2 something like
//IN2REXX DD DISP=SHR,DSN=*.STEP01.OUT

So in step 1 you will change DSN in DD every time(because only you know new name), but you don't have to in step 2.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Mar 21, 2008 3:35 pm
Reply with quote

Quote:
MY constraint is , i can not allocate the dataset by JCL, bcoz its already getting allocated through some other application.


if that were true it would be impossible also to allocate thru "TSO ALLOC"
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Sun Mar 23, 2008 4:10 pm
Reply with quote

why not use:

Code:
//STEP1 EXEC PGM=IKJEFT01,
// PARM='%rexxpgm-name  YOURPDSNAME'     
//SYSEXEC  DD DSN=REXX-PDS-NAME,DISP=SHR                       
//SYSTSPRT DD  SYSOUT=*                                                 
//MYINDD   DD  DSN=Input file if any
//SYSTSIN  DD  DUMMY   



In the rexx pgm, you can receive the pds name as an argument and later on continue with your logic (LISTDS with MEMBERS parameter).

eg: ibmmainframes.com/post-51855.html

Thanks,
Ajay
Back to top
View user's profile Send private message
nirenchan

New User


Joined: 21 Jul 2005
Posts: 23
Location: USA

PostPosted: Thu Jun 26, 2008 3:21 am
Reply with quote

HI,

I want to invoke one TSO Command using REXX.
we use one command called DSNSRCH for searching strings in particualar dsn. I want to use the same in JCL

like through JCL I 've to pass the search string so that it will pass the strings to Rexx program and the Rexx program can invoke the DSNSRCH and this will give the output to my Output Dataset.

can any one help me ?

Regards,
Niren.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Thu Jun 26, 2008 4:45 am
Reply with quote

quoting Ajay:
Quote:
why not use:

Code:

//STEP1 EXEC PGM=IKJEFT01,
// PARM='%rexxpgm-name  YOURPDSNAME'     
//SYSEXEC  DD DSN=REXX-PDS-NAME,DISP=SHR                       
//SYSTSPRT DD  SYSOUT=*                                                 
//MYINDD   DD  DSN=Input file if any
//SYSTSIN  DD  DUMMY   


In the rexx pgm, you can receive the pds name as an argument and later on continue with your logic (LISTDS with MEMBERS parameter).


The code is slightly modified to show that you can pass multiple parameters
Code:

//STEP1 EXEC PGM=IKJEFT01,
// PARM='%rexxpgm-name  parameter1 parm2'   

be sure to follow the rest of Ajay's example.

The example shows %rexxpgm-name, but I believe it can be any TSO command. You could probably call your DSNSRCH command directly. Use the same parameters that you would use if called from TSO.
Back to top
View user's profile Send private message
Wondertree

New User


Joined: 26 Jun 2014
Posts: 1
Location: Chur - Switzerland

PostPosted: Wed Jul 02, 2014 12:27 pm
Reply with quote

The solutions from here didn't work by my programm. So I have here a example that works perfectly:
Code:

//*User" JOB *Jobstatment*     
//ISPF    EXEC PGM=IKJEFT01,REGION=2048K,DYNAMNBR=25               
//SYSPROC   DD DSN=*CLIST-lib*,DISP=SHR                 
//SYSEXEC   DD DSN=*EXEC-lib*,DISP=SHR                   
//ISPPLIB   DD DSN=ISP.SISPPENU,DISP=SHR                           
//ISPSLIB   DD DSN=ISP.SISPSENU,DISP=SHR                           
//ISPMLIB   DD DSN=ISP.SISPMENU,DISP=SHR                           
//ISPTLIB   DD DDNAME=ISPTABL                                     
//          DD DSN=ISP.SISPTENU,DISP=SHR                           
//ISPTABL   DD LIKE=ISP.SISPTENU,UNIT=VIO                         
//ISPPROF   DD LIKE=ISP.SISPTENU,UNIT=VIO                         
//ISPLOG    DD SYSOUT=*,RECFM=VA,LRECL=125                         
//SYSPRINT  DD SYSOUT=*                                           
//SYSTSPRT  DD SYSOUT=*                                           
//SYSUDUMP  DD SYSOUT=*                                           
//SYSDBOUT  DD SYSOUT=*                                           
//SYSHELP   DD DSN=SYS1.HELP,DISP=SHR                             
//SYSTSIN   DD *                                                   
ISPSTART CMD(*Commandname parm1*)               
/*                                                                 
//                                                                 
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jul 02, 2014 6:21 pm
Reply with quote

Quote:
The solutions from here didn't work by my programm. So I have here a example that works perfectly(*)


the solutions from here worked according to the topic discussed
the person asking thanked for the answers

nowhere was implied/requested that the REXX script would invoke ISPF services.

if You hads searched better You would have found gazillions of examples on how to run scripts using ISPF services

also no reason to resurrect a 6 years old topic

(*) perfectly for Your environment and needs naturally icon_cool.gif
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Jul 02, 2014 6:46 pm
Reply with quote

Quote:
also no reason to resurrect a 6 years old topic


Is there anyway to lock a topic after a certain perion of time (say 1 year)?

This would remove the possibility of the above happening.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Wed Jul 02, 2014 7:38 pm
Reply with quote

daveporcelan wrote:
Quote:
also no reason to resurrect a 6 years old topic


Is there anyway to lock a topic after a certain perion of time (say 1 year)?

This would remove the possibility of the above happening.

Don't know if there is an option to do it automatically, but on the FanDeZhi site I manually lock threads after just one month.
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Using API Gateway from CICS program CICS 0
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