*Well, I wouldn't have used the same variable name as the test data, and
it's not clear whether the period in 9.12 is fortuitous. Your parse won't
work against, e.g., myVar = 'word1 word2 666 word3.ext'*

I didn't use WORD3 in my test data. As for a fortuitous period in the test
data, you work with what you are given.

My less efficient solution is to use the REVERSE function.

TRACE I

MYVAR = 'WORD1 WORD2 9.12 XXXXZ.EXT'

PARSE VALUE REVERSE(MYVAR) WITH EXT '.' WORD3 .

SAY REVERSE(WORD3)

PULL RESP

Eliminates the fortuitous period from the mix.

5 *-* MYVAR = 'WORD1 WORD2 9.12 XXXXZ.EXT'
  >L>   "WORD1 WORD2 9.12 XXXXZ.EXT"
7 *-* PARSE VALUE REVERSE(MYVAR) WITH EXT '.' WORD3 .
  >V>   "WORD1 WORD2 9.12 XXXXZ.EXT"
  >F>   "TXE.ZXXXX 21.9 2DROW 1DROW"
  >>>   "TXE"
  >>>   "ZXXXX"
  >.>   "21.9 2DROW 1DROW"
9 *-* SAY REVERSE(WORD3)
  >V>   "ZXXXX"
  >F>   "XXXXZ"


*On Wed, Feb 26, 2020 at 4:01 AM Seymour J Metz <sme...@gmu.edu
<sme...@gmu.edu>> wrote:*

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *The name is from CS, but the regexen in, e.g., Perl, Python, Ruby, can
> describe grammars that are not RE grammars in the CS sense. -- Shmuel
> (Seymour J.) Metz http://mason.gmu.edu/~smetz3
> <http://mason.gmu.edu/~smetz3> ________________________________________
> From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU
> <IBM-MAIN@LISTSERV.UA.EDU>> on behalf of Paul Gilmartin
> <0000000433f07816-dmarc-requ...@listserv.ua.edu
> <0000000433f07816-dmarc-requ...@listserv.ua.edu>> Sent: Tuesday, February
> 25, 2020 11:51 AM To: IBM-MAIN@LISTSERV.UA.EDU <IBM-MAIN@LISTSERV.UA.EDU>
> Subject: Re: Rexx parse using period as placeholder On Tue, 25 Feb 2020
> 08:14:33 -0500, Tony Thigpen wrote: >"regular expressions". What a misnamed
> item. It should be called "geek >readable only expressions". :-) > The name
> is adopted from formal language theory, clearly a geeky field. An
> alternative name is Chomsky type-3.
> https://secure-web.cisco.com/1yEhmTUBhK8QGgUQt09y0JsOgSqhJXPgIB7Wz4gZwgrTHdy8wAmwypFT0tCrS-JB2GheOTXaWsSeHJvgS2ofoCdp0m-1F0xEEQ1yXoQPhi6lbKSQQKlTBLZzS3TTM684q07ZikhoWrXEgICvTpo9FJcP95rTkyG3euEsTRYwDhlCXDQy_L5QL_LGkcmjt4G4xcTLA5yxPC3kMDpTFlLzZ31kiCv-pmGKv9GELh_RI2HeGU3cuxaX9kEFbeLzlK9eZvHT_rqfF1xTGp98og32FnHCCvu30HGdzhtB0IkRj8VaAbLArDRGTApSMFRK0kJHQ6mgZ9_m92aUcmsqyN6vlKLSyxEZtJKpHgap3ZEnOXvRq8yUe1zu3WkELf09COKLJTEn0ROC6L2B7BXUy1LsGE4Qj6Jwt3MuW_tao1O43pxGqN5xEtkLqIt86glUmt6Hu/https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FChomsky_hierarchy#Type-3_grammars
> <https://secure-web.cisco.com/1yEhmTUBhK8QGgUQt09y0JsOgSqhJXPgIB7Wz4gZwgrTHdy8wAmwypFT0tCrS-JB2GheOTXaWsSeHJvgS2ofoCdp0m-1F0xEEQ1yXoQPhi6lbKSQQKlTBLZzS3TTM684q07ZikhoWrXEgICvTpo9FJcP95rTkyG3euEsTRYwDhlCXDQy_L5QL_LGkcmjt4G4xcTLA5yxPC3kMDpTFlLzZ31kiCv-pmGKv9GELh_RI2HeGU3cuxaX9kEFbeLzlK9eZvHT_rqfF1xTGp98og32FnHCCvu30HGdzhtB0IkRj8VaAbLArDRGTApSMFRK0kJHQ6mgZ9_m92aUcmsqyN6vlKLSyxEZtJKpHgap3ZEnOXvRq8yUe1zu3WkELf09COKLJTEn0ROC6L2B7BXUy1LsGE4Qj6Jwt3MuW_tao1O43pxGqN5xEtkLqIt86glUmt6Hu/https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FChomsky_hierarchy#Type-3_grammars>
> It refers not to the template but to the target.  I shudder to envision a
> formal grammer for UNIX regexen. On Tue, 25 Feb 2020 12:11:24 +0000,
> Seymour J Metz wrote: >What is happening is that everything in the template
> before the string match '.' >is a sub-pattern applied to the fragment to
> the left of the period. ... > Good description.  Does IBM use the term
> "sub-pattern" anywhere in its documentation? On Tue, 25 Feb 2020 13:24:09
> +0000, Seymour J Metz wrote: >While the Eunix RE syntax is grotesque, the
> regexen are incredibly useful. I just wish that >they had adopted the
> pattern syntax from SNOBOL or Wylbur. > There are two poles of UI design
> style: o Ergonomic or keystroke economy.  Frequently used   commands are
> single keystrokes with no lexical separator   between the command and its
> argument, as in the XEDIT   "/target" for a string search. o Orderly
> command grammar.   I suspect that TSO begat CLIST and linemod EDIT, which
> begat   ISPF commands.  Good in a script; terrible from the keyboard. A
> very simple regex pattern, / ' " /, was formerly available in ISPF EDIT
> only as F x'407d407f40'!  Now that ISPF has regexen, it can be the
> relatively transparent F R' ['] " '.  But only the hex can be used as a
> replacement. -- gil
> ---------------------------------------------------------------------- For
> IBM-MAIN subscribe / signoff / archive access instructions, send email to
> lists...@listserv.ua.edu <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 <lists...@listserv.ua.edu> with the message: INFO
> IBM-MAIN *




*-- *

*Wayne V. Bickerdike*

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