Alternative POV: I gave up on TSO command format ages ago (where that
doesn't conflict with other people) and use *nix-style arguments.
In VM/CMS where Rexx got started everything after "(" is processed as
options
For my own use I accept some limitations of parse. Either every argument is
forced upper case or lower, or the keywords are case sensitive.
parse upper arg "-UNIT" " " unitt rest 1 "-STU" " " stuff rest
That sets unitt and stuff regardless of the order they are given. (I look
for options such as -help and -debug separately).
Doing it like that I can use -UNIT or -UNITTEST, but in truth it would
equally accept
-UNITBANANA as long as it's followed by a space and then a filename ended
by another space (or end of string).
So saying, long ago I had success simply repairing any missing ")" during
verification of TSO format arguments :-)
Roops
On Tue, 2 May 2023, 00:30 Frank Swarbrick, <[email protected]>
wrote:
> The following is a simplified version of some code from IBM's CEEBLDTX,
> placed in to an EXEC I've named PARENS:
>
> Parse Arg option
> Parse Var option varOpt '(' valueOpt ')'
> Say varOpt
> Say valueOpt
>
> This handles a simple dataset name, e.g.:
>
> Test1: PARENS COBOL(TEST):
> Results1:
> COBOL
> TEST
>
> But it doesn't work for a PDS member to following, also surrounded by
> parentheses:
>
> Test2: PARENS COBOL(TEST(MEMBER))
> Results2:
> COBOL
> TEST(MEMBER
>
> Any simple REXX parse option to handle this, or do I need to resort to
> more complex REXX? Or do I just add a trailing paren if there is a leading
> one in valueOpt? Perhaps that's the simples answer.
>
> Frank
>
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN