Issue with parsing input from command line to REXX.



IBM's Command List programming language & Restructured Extended Executor

Issue with parsing input from command line to REXX.

Postby aniln2154 » Fri Oct 10, 2014 10:16 am

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
aniln2154
 
Posts: 2
Joined: Fri Oct 10, 2014 9:53 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby Pedro » Fri Oct 10, 2014 9:14 pm

To get the parameter, use:
ISREDIT "MACRO (rgn)"
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

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

Postby NicC » Sat Oct 11, 2014 1:02 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

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

Postby aniln2154 » Mon Oct 13, 2014 8:07 am

Many Thanks Pedro Vera. It worked :)
aniln2154
 
Posts: 2
Joined: Fri Oct 10, 2014 9:53 am
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post