Page 1 of 1

JCL to Pass Command to REXX Program

PostPosted: Thu May 13, 2021 2:24 am
by Krishna22
I am working on REXX Program for the first time and Need help to pass Command through Parameter or SYSTIN Option from JCL to REXX Program

Right now , We are executing manually by executing the REXX Program using EX Option as below.

EX ENV.ABCD.V6R2M0.USERLIB(NCMD)

We get Local Prompt and will provide the command in the local Prompt as below

Local> export binding E1_ABC TSO.DRABC.BINDING.XML

We want to pass the command( export binding E1_ABC TSO.DRABC.BINDING.XML) through a PARM OR SYSTIN .Can this be achieved

REXX Program Details.

Code
ENV.ABCD.V6R2M0.USERLIB(NCMD)

/*REXX*/
"ALLOCATE DDNAME(SYSOUT) DUMMY"
"ALLOCATE DDNAME(SYSDUMP) DUMMY"
"EXEC 'ENV.ABCD.V6R2M0.USERLIB(FCALL)'
'TASKLIB NAVUTIL P('''')' "
"FREE,DDNAME(SYSOUT)"
"FREE DDNAME(SORTWK01)"
RETURN


ENV.ABCD.V6R2M0.USERLIB(FCALL) Code Below

CALL 'ENV.ENV.V6R2M0.LOAD(FCALL)' '&MEM,&P' --------------> Load Program

JCL

//JS30 EXEC IKJEFT01,
// ENV='EN19.',
// APPL='MIS.',
// APPL2='MIS.',
// PARM=NCMD,
// DYNAMNBR=10
//SYSEXEC DD DSN=ENV.ABCD.V6R2M0.USERLIB,
// DISP=SHR
//PARMIN DD DSN=ENV.MIS.PARMLIB(CMD), ----------------> The Parmin member has export command.
// DISP=(SHR,KEEP,KEEP)
//SYSTSIN DD DUMMY

I tried both PARM Option and also Passing command in SYSTSIN Option both didn't work .

After Executing with JOB, The SYSOUT has Local> for 6+ Million Rows and need to manually kill the job.

Local>
Local> ... 6 Million

Our requirement is execute the below command either passing thru dataset or SYSTSIN Option
export export binding E1_ABC TSO.DRABC.BINDING.XML

Note : REXX Programs are provided by Vendor and only we are writing JCL to run the REXX Program and pass the command.
Appreciate if you can help on this.

Thank you,
Krishna

Re: JCL to Pass Command to REXX Program

PostPosted: Thu May 13, 2021 2:42 am
by willy jensen
Something like:
//JS30 EXEC PGM=IKJEFT01,PARM='%NCMD EN19.MIS.MIS.'
//SYSEXEC  DD DISP=SHR,DSN=ENV.ABCD.V6R2M0.USERLIB
//PARMIN DD DSN=ENV.MIS.PARMLIB(CMD),
// DISP=(SHR,KEEP,KEEP)
//SYSTSIN DD DUMMY
//SYSTSPRT DD SYSOUT=*

Re: JCL to Pass Command to REXX Program

PostPosted: Thu May 13, 2021 2:47 am
by sergeyken
I’ve tried to read the post about 15 times. Nothing except senseless bullshit of words, some code with definitely syntax errors, with absolutely no idea how one part is related to any other of them?

First, learn how to use code tags, and how to align the lines of code, for someone to be able to understand something.

Re: JCL to Pass Command to REXX Program

PostPosted: Thu May 13, 2021 2:54 am
by willy jensen
of course you need an 'parse arg parm' or 'parse upper arg parm' at the top of your program to pull in the parameter string.

Re: JCL to Pass Command to REXX Program

PostPosted: Sat May 15, 2021 3:39 am
by Pedro
re: "We get Local Prompt and will provide the command in the local Prompt as below"

It seems like your NCMD calls compiled program LOAD(FCALL) which displays an ISPF panel where you type in your EXPORT command. Is this correct? If so, I think you need to re-write FCALL so that it does not display the ISPF panel.