Having some difficulty with that.
My working REXX procedure permits me to pass and execute an sql instruction.
Now I've created a command that directly invokes REXX.
I parse the argument so :
PARSE ARG 'CMD('iSql')'
SAY iSql shows me that the parsing has taken place, but
ADDRESS EXECSQL,
EXECSQL iSql
Sends the error SQL0104 which is a syntax error.
-----Message d'origine-----
De : midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] De la part de lgoodbar@xxxxxxxxxxxxxx
Envoyé : jeudi 9 octobre 2008 14:27
À : midrange-l@xxxxxxxxxxxx
Objet : RE: REXX QIBM_REX_FIND_SRCMBR
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?
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.