On Tue, 16 Sep 2025 00:35:21 +0000, Farley, Peter <[email protected]>
wrote:
>Gil is correct, only Unix utilities that use the underlying C function
>“fopen(…)” can read or write "//'userid.TEMP.OUT2'". Since shell redirection
>means the writing program is the shell itself (/bin/sh) and that program does
>NOT support MVS datasets directly, you cannot do that.
>
A pedantic clarification:
Shell redirects, with open(), not fopen.
Utility to left of "<" is the writing program.
Closely analogous:
//SYSUT2 DD DSM='userid.TEMP.OUT2' Initiator allocates
// EXEC PGM=IEBGENER is the writing program.
>Some Unix utilities like “awk” do in fact directly support MVS datasets as
>input or output, BUT it is NOT documented to do so (as gil has rightly said
>several times when I have brought up this “awk” behavior), so letting any
>important work depend on that observed-but-not-documented fact could be risky.
>
<https://www.laws-of-software.com/laws/hyrum/>
>Instead, you could try to pipe your command output to the “cp” command (which
>IS documented to support MVS datasets) and tell “cp” to write to
>"//'userid.TEMP.OUT2'" like this:
>
>(your command(s) here) | cp - "//'userid.TEMP.OUT2'"
>
>The first operand to “cp” of “-“ (minus sign or hyphen) tells “cp” to use
>stdin as the input source and the second operand "//'userid.TEMP.OUT2'" as the
>output destination.
>
Thanks for the clarification.
--
gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN