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
 

 

JCL To Execute A REXX Program
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: JCL To Execute A REXX Program
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    Post subject:
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: 2360
Location: Israel

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

Or simply read the fine manuals?

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

Moderator Team Head


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

PostPosted: Mon Aug 06, 2007 6:59 pm    Post subject: Re: JCL To Execute A REXX Program
Reply with quote

Some good relevant topics:

http://ibmmainframes.com/viewtopic.php?t=5902
http://ibmmainframes.com/viewtopic.php?t=11083
http://ibmmainframes.com/viewtopic.php?t=5351
http://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    Post subject:
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    Post subject:
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: 205
Location: Bangalore

PostPosted: Tue Aug 07, 2007 2:27 pm    Post subject: Re: JCL To Execute A REXX Program
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Mar 21, 2008 12:38 pm    Post subject: Reply to: JCL To Execute A REXX Program
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: 8593
Location: Back in jolly old England

PostPosted: Fri Mar 21, 2008 2:18 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Mar 21, 2008 3:35 pm    Post subject: Reply to: JCL To Execute A REXX Program
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: 205
Location: Bangalore

PostPosted: Sun Mar 23, 2008 4:10 pm    Post subject: Reply to: JCL To Execute A REXX Program
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: http://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    Post subject: Reply to: JCL To Execute A REXX Program
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

Senior Member


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

PostPosted: Thu Jun 26, 2008 4:45 am    Post subject: Reply to: JCL To Execute A REXX Program
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Wed Jul 02, 2014 6:21 pm    Post subject: Reply to: JCL To Execute A REXX Program
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


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