I seriously doubt that he meant for the file name to be a constant.

--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Paul Gilmartin [0000000433f07816-dmarc-requ...@listserv.ua.edu]
Sent: Tuesday, February 25, 2020 11:48 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Rexx parse using period as placeholder

On Wed, 26 Feb 2020 04:32:43 +0000, Seymour J Metz wrote:

>Absent a problem description, there's no way to tell whether that does what 
>the OP wants; does he want to treat the last word containing a period as 
>fn.fext, or the fourth word? Does he want to allow multiple periods in the 
>name, e.g., foo.bar.text? I could write a regex for any of these, but not 
>without knowing which, if any, of them is correct.
>
He said only, "I wanted to parse out the string 'word3' using the period as a 
place holder."
So, how about:

trace R
myVar = 'word1 word2 9.12 word3.ext'
Parse Var myVar . 'word3' +0 myVal +5 .

     2 *-* myVar = 'word1 word2 9.12 word3.ext'
       >=>   "word1 word2 9.12 word3.ext"
     3 *-* Parse Var myVar . 'word3' +0 myVal +5 .
       >V>   "word1 word2 9.12 word3.ext"
       >.>   "word1 word2 9.12 "
       >>>   "word3"
       >.>   ".ext"

-- gil

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

Reply via email to