Arrgh, editing error left from prior version.

It should be:

rparen = ')'||'ff'x
parse value option||'ff'x with varOpt '(' valueOpt (rparen)


The idea is to pin the final char to the end of the input string. I'm using a 
non-printable character, but that means it needs to be a variable since REXX 
won't accept a concatenated literal.

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Schmitt, Michael
Sent: Tuesday, May 2, 2023 12:16 PM
To: [email protected]
Subject: Re: REXX parse parens

rparen = ')'||'ff'x
parse value option||'~' with varOpt '(' valueOpt (rparen)


-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Frank Swarbrick
Sent: Tuesday, May 2, 2023 10:08 AM
To: [email protected]
Subject: Re: REXX parse parens

I don't want a separate "member" value.  I want the full "TEST(MEMBER)".
This is what I have now, and it seems to work OK:

Parse Var option varOpt '(' valueOpt ')'
/* Add back closing paren, if there is a leading one */
If POS("(", valueOpt) \= 0 Then
  valueOpt = valueOpt')'


-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Jack Zukt
Sent: Tuesday, May 2, 2023 1:02 AM
To: [email protected]
Subject: Re: REXX parse parens

Hi
This should work

Parse arg opt
Parse value opt with "(" opt") "
If  pos(" (", opt) >0 then
    Parse value opt with opt" ("member")"
Do
End

Regards
Jack

On Tue, May 2, 2023, 00:31 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

----------------------------------------------------------------------
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




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

Reply via email to