On Fri, 28 Feb 2020 19:48:54 +0800, David Crayford <[email protected]> wrote:
>How to do this maintaining the quotes? That's needed for allocating the >data set. > >Yet again, simple to do with a regex. > >On 2020-02-28 1:41 AM, Dale R. Smith wrote: >> On Thu, 27 Feb 2020 17:30:03 +0000, Seymour J Metz <[email protected]> wrote: >> >>> The quotes were OK, the space between translate and the left paren was not. >>> Fixing that >>> >>> parm="INDSN('HLQ.DSNAME(MEMBER)')" >>> Parse Value Translate(parm,"","'")' ' With fill1 '(' val ') ' fill2;say >>> 'fill1='fill1 'val='val 'fill2='fill2 >>> >>> gives me >>> >>> fill1=INDSN val= HLQ.DSNAME(MEMBER fill2=) >>> >>> Not only did it lose the RP, it also stripped off the apostrophes >>> indicating that it was a FQDSN. >>> >>> >>> -- >>> Shmuel (Seymour J.) Metz >>> http://mason.gmu.edu/~smetz3 The original Parse command I posted will do that and not touch the quotes. When you posted the second examples with quotes, I thought you wanted to remove the quotes as well as the parens. parm = "INDSN('HLQ.DSNAME(MEMBER)')" Parse Value parm' ' With . '(' val ') ' . Say val 'HLQ.DSNAME(MEMBER)' -- Dale R. Smith ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
