Well, super, guys, thanks. As you can tell I am kind of shell-naive.

Much of my "UNIX" experience is writing z/OS C++ programs where pretty much any 
file can be /unix or //DD:MVSDD or //MVS.DATA.SET or //VSAM.FILE so I kind of 
proceeded as though all of UNIX was like that. Lesson noted. I know just enough 
shell to be almost dangerous.

Much like in @Phil's recent COBOL compiler plaint, a more informative error 
message would sure be a help. "MVS data sets not supported in this context" 
would have pointed me in the right direction.

(It's not just IBM. I was just on a hotel reservation site where "credit card 
not valid" turned out to mean "the room you requested is not available on that 
night.")

After I saw @Gil's reply I got to thinking the answer was a pipe to cp but 
thanks for confirming and giving me the syntax -- I would have had to wade 
through a VERY long doc page.

>HTH

Very much. Thanks again,

Charles.

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.
>
>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.
>
>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.
>
>HTH
>
>Peter

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to