Why do You have "blank" before and after "()"? -----Ursprungligt meddelande----- Från: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> För Jack Zukt Skickat: den 2 maj 2023 09:02 Till: IBM-MAIN@LISTSERV.UA.EDU Ämne: 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 <frank.swarbr...@outlook.com> 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN