Page 1 of 1

Issue with parsing input from command line to REXX.

PostPosted: Fri Oct 10, 2014 10:16 am
by aniln2154
Hi I'm writing a REXX code for my requirement and it works fine. The problem is my code is not fetching the input from command line and storing into the input variable.

Below is the simple REXX code which I used and it worked fine.

/* REXX - SIMPR */
ARG MEM
SAY 'ENTERD:' MEM
EXIT

I entered "TSO SIMPR R2"
Output: "ENTERD: R2"

---------------------------------------------------------------------------------------------------

Below is my REXX Macro code which I’m having problem with.

/* REXX - MACROR */
ARG RGN
"ISREDIT MACRO "
"ISPEXEC CONTROL ERRORS RETURN"
X = MSG("OFF")
"ISREDIT (PDSNAME) = DATASET"
"ISREDIT (MEMNAME) = MEMBER"
SAY PDSNAME
SAY MEMNAME
SAY RGN
EXIT

I Entered "MACROR R2"
Output: TCU.CA7.HIP
TEST

******

It has taken null value inside the variable RGN instead of R2.

Please advise how to pass input to the variable RGN from the command line.

Thanks,
Anil

Re: Issue with parsing input from command line to REXX.

PostPosted: Fri Oct 10, 2014 9:14 pm
by Pedro
To get the parameter, use:
ISREDIT "MACRO (rgn)"

Re: Issue with parsing input from command line to REXX.

PostPosted: Sat Oct 11, 2014 1:02 pm
by NicC
A macro is not the same as a rexx program. I suggest you refer to the 'edit and edit macros' manual and study the structure of several macros written by other people.

Re: Issue with parsing input from command line to REXX.

PostPosted: Mon Oct 13, 2014 8:07 am
by aniln2154
Many Thanks Pedro Vera. It worked :)