> And Sri's example contained a node longer than 8 bytes. Well, if it were up to me z/OS would support cataloged data sets with longer index levels, but circumstances being what they are I'd rather not parse them. Besides, they're only valid inside of apostrophes.
If the problem definition changes then the regex must change with it, but it's still fairly straightforward. Doesn't awk have captures these days? -- 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, May 26, 2020 6:02 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: How to get last node in DFSORT On Tue, 26 May 2020 19:42:31 +0000, Seymour J Metz wrote: >Well, in this case the hammer is the reverse function; >/\.([#$@[:upper:][:digit:]]{1,8})\n/, despite the awkward syntax, is still >cleaner. > I was more thinking of the OP's requirement for DFSORT as the hammer. And Sri supplied a massive sledgehammer. Don't forget '-' is sorta legal in data set names; more characters if the DSN needn't be catalogued. And Sri's example contained a node longer than 8 bytes. And what if there are characters further to the right that must be preserved? But I assumed a terminating ' '. So: awk '{ match( $0, /\.[^. ]* / ) print( substr( $0, 1, 50) substr( $0, RSTART + 1, 8 ) substr( $0, 59 ) ) }' >Wasn't there a song on the 1960's, Lexity, Lex, YACCitty YACC? -- 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