× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



As you noticed, REXX receives parameters differently from CL or RPG. In
REXX, you would use the PARSE ARG command to retrieve the parameter
values.

If you had a command such as
MYREXCMD CMD('my command') CMD2('my other command')
Then you would code REXX like this
PARSE ARG 'CMD('cmd')'
PARSE ARG 'CMD2('cmd2')'

The variable cmd would receive the value "my command" and cmd2 would
receive "my other command".

You could also put them on the same line:
PARSE ARG 'CMD('cmd')' 'CMD2('cmd2')'

One huge issue I noticed with REXX is how it (doesn't) handle date
parameters. In a command with a date parameter such as PARM
KWD(SOMEDATE) TYPE(*DATE), normally you would code the corresponding CL
parameter as DCL VAR(&SOMEDATE) TYPE(*CHAR) LEN(7). The command
processor reformats the date entered on the command (such as 9/10/2008
(Oct 9)) and CL receives 1081009. RPG behaves in the same manner.
However, the REXX procedure does not benefit from reformatted dates. It
receives the date just as it's entered: PARSE ARG
'SOMEDATE('somedate')'. Somedate is "9/10/2008". It is on you to
reformat the date as you need. However, for other "simple" parameter
types, REXX's argument parsing works fine.

Loyd Goodbar
Business Systems
BorgWarner Shared Services
662-473-5713
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of David FOXWELL
Sent: Thursday, October 09, 2008 2:53 AM
To: Midrange Systems Technical Discussion
Subject: RE: REXX QIBM_REX_FIND_SRCMBR


Thanks Lloyd.

I am not very experienced in creating commands. I'd created a command
that used a CLP which was adding QIBM_REX_FIND_SRCMBR then running
STRREXPRC. Now I've created a command compiled as you say with
PGM(*REXX). But now, if I execute MYREXCMD CMD('my commande'), I notice
that the REXX procedure receives the string 'CMD('my commande')' as a
parameter. How should I deal with this?



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.