On Mon, 1 May 2023 23:30:51 +0000, 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

The way I have done this is to use Parse Value with a space added at the end 
instead of Parse Var:

Parse Value option' ' With varOpt '(' valueOpt ') ' .

-- 
Dale R. Smith

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to