Page 1 of 1

How to execute & pass a PDS from JCl to Rexx pgm

PostPosted: Tue May 17, 2016 11:55 am
by prasanthgp
Hi ,
I am a Beginner to Rexx program. I want to execute a file called "main.rexx"(rexx pgm module) through JCl.
and also I want to pass a PDS called (REXX.OUTPUT.REPORT) from JCl to this "main.rexx".
please can anyone help me out with this JCl code

Re: How to execute & pass a PDS from JCl to Rexx pgm

PostPosted: Tue May 17, 2016 2:35 pm
by prasanthgp
guys....."main.rexx" is a PDS name which as mainframe REXX code..,

Re: How to execute & pass a PDS from JCl to Rexx pgm

PostPosted: Tue May 17, 2016 4:05 pm
by willy jensen
well, the standard JCL to execute a REXX program is something like this:
//GO      EXEC PGM=IKJEFT01                
//SYSTSPRT DD SYSOUT=*                      
//SYSEXEC  DD DISP=SHR,DSN=WJENSEN.LIB.EXEC
//SYSTSIN  DD *                            
 Hello                                      
 

where your program is stored as a member in the PDS referenced by the SYSEXEC JCL statement.
The program is normally named in the SYSTSIN JCL statement, though is can also be named by the JCL PARM statement. In this case the program is the member HELLO of the WJENSEN.LIB.EXEC PDS.
You say that you want to pass a PDS to the REXX, but not how you intend to use it. A PDS normally cannot be read by a REXX program, but a member of a PDS can. The JCL statement for allocating your PDS would most likely be
//PDS1 DD DISP=SHR,DSN=REXX.OUTPUT.REPORT

but it depends on the type of usage that you intend.

Re: How to execute & pass a PDS from JCl to Rexx pgm

PostPosted: Tue May 17, 2016 4:07 pm
by willy jensen
And by the way, MAIN.REXX is not a valid member name. If it is a dataset then you need to copy it to a PDS member in order to execute it.

Re: How to execute & pass a PDS from JCl to Rexx pgm

PostPosted: Tue May 17, 2016 4:31 pm
by prasanthgp
thanks for the reply jensen...,

I used this jcl to execute rexx
//* INVOKE REXX IN BATCH...
//JS10 EXEC PGM=IRXJCL,REGION=0K,PARM='MAIN'
//SYSEXEC DD DSN=IDF.REXX.COCOV.DAUG15,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY,BLKSIZE=80
//


In this "MAIN" is member (which is rexx pgm) this only i want to execute through JCl and also this "main" will call many sub module programs
this sub modules uses EXECIO based Read and Write concepts....,
when i run this JCl i got the following error in spool

"the input or output file OUTDD is not allocated. It cannot be opened for I/O
EXECIO error while trying to GET or PUT a record "

please can u help out

Re: How to execute & pass a PDS from JCl to Rexx pgm

PostPosted: Tue May 17, 2016 6:02 pm
by enrico-sorichetti
EXECIO is supported only in a FULL TSO environment

search the forum for examples on how to run in batch IKJEFT01

Re: How to execute & pass a PDS from JCl to Rexx pgm

PostPosted: Tue May 17, 2016 7:37 pm
by willy jensen
Actually my sample above is TSO batch using IKJEFT01.
But ant files that you want to access must have been allocated somehow. In batch the easiest method is a JCL statement like the PDS1in my first post. See the JCL Reference manual for details. And without knowing your program, I cannot advise further - I might give you some advise which would destroy your dataset.

Re: How to execute & pass a PDS from JCl to Rexx pgm

PostPosted: Tue May 17, 2016 8:28 pm
by prino
willy jensen wrote:I might give you some advise which would destroy your dataset.

And the TS might loose his job. Now that would be really sad. :mrgreen:

Re: How to execute & pass a PDS from JCl to Rexx pgm

PostPosted: Wed May 18, 2016 11:10 am
by prasanthgp
ya k fine i understood....jensen...,

Re: How to execute & pass a PDS from JCl to Rexx pgm

PostPosted: Wed May 18, 2016 9:11 pm
by NicC
ya k fine

Please write English - this is gobbledy-gook!