Thanks Gil.  Tried your suggestion, but got this in STDERR:

cp: FSUM4262 target "/bin/sh" must be a directory
cp: or a partitioned data set

It would seem that the PGM invocation does not recognize or just ignores the 
pipe operator.

Peter

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Paul Gilmartin
Sent: Sunday, April 3, 2022 2:27 PM
To: [email protected]
Subject: Re: Running z/OS Unix commands from an MVS sequential dataset

On Apr 3, 2022, at 11:53:23, Farley, Peter x23353 wrote:
> 
> CC'ed to IBM-MAIN for a wider audience.
> 
> DSN='TSOUSER.PDS(MEMBER01)'
> echo $DSN
> cat //"'$DSN'" | fgrep ''' STRING-TO-FIND '''
>  
"cat //" ..." Is not documented as supported, but it sometimes Works, so that 
may not be the cause of your problem.
    "cp //... /dev/fd/1 | ..;" is documented as supported.

> I have tried this JCL to accomplish running the commands from a file.  It 
> runs with CC=0, but STDOUT is never populated:
> 
> //RUNCMDS EXEC BPXBATCH,REGION=256M,
> // PARM='PGM /bin/sh . //"''TSOUSER.UNIXCMDS.SH''"'
> //STDOUT DD SYSOUT=*
> //STDERR DD SYSOUT=*
> //STDIN DD DUMMY
>  
I'll suggest
    // PARM='PGM /bin/cp //"''TSOUSER.UNIXCMDS.SH''" | /bin/sh'

--

This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.

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

Reply via email to