On Apr 4, 2022, at 10:47:36, Kirk Wolf wrote:
>
> - You can make awk not only act like (f)grep, but it also takes dsn syntax
> since uses fopen().
>
Is that documented as supported?
> - awk will also read multiple files in one execution, so this will run rings
> around other ways that require a couple of forks for every dsn that you are
> searching.
> - you can also customize how the output looks (see below)
>
> //AWK EXEC PGM=COZBATCH
>
Provided that the user's punching department considers the price acceptable.
> //DSNS DD *
> "//'SYS1.MACLIB(ACB)'"
> "//'SYS1.MACLIB(CHECK)'"
> "//'SYS1.MACLIB(CLOSE)'"
> "//'SYS1.MACLIB(DYNALLOC)'"
> /*
> //STDIN DD *
> fromdsn //DD:DSNS |
> xargs awk '/STR/ {print FILENAME ":" NR "\t" $0 }'
> //
>
> Replace STR above with your regex.
>
fgrep doesn't use a regex; awk match() requires a regex.
Is there a circumvention other than escaping all metacharacters
in a regex?
Is ISRSUPC SRCHFOR an alternative?
> You can make this work with BPXBATCH and cat instead of fromdsn, but its not
> nearly as slick :-)
--
gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN