address SYSCALL foo WITH OUTPUT bar

would be a lot shorter. It's only been a quarter of a century since X3.274-1996 
came out :-(

IAC, both of your snippets should solve a problem, but we (TINW) still don't 
know whether that is what the OP wants to do.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List [[email protected]] on behalf of 
Paul Gilmartin [[email protected]]
Sent: Wednesday, March 9, 2022 9:01 AM
To: [email protected]
Subject: Re: Rexx copy to OMVS

On Wed, 9 Mar 2022 10:39:50 +0000, Seymour J Metz wrote:

>I'm not sure what you are asking. If you are calling the rexx script from a 
>Unix shell, then you can certainly use normal redirection, e.g., "foo >bar 
>2>baz".
>
Within a Rexx script cslled from a Unix shell, I have used:
    address SYSCALL
    'dup' 1
    Stdout = RETVAL  /* save oriigial stdout.  */
    'open bar' O_CREAT + O_READWR + O_TRUNC
to redirect Rexx output to "bar".

>Are you trying to redirect the output of an OMVS command that you call from 
>REXX? If so, outtrap might do what you need. Alas, the ANSI extensions to 
>address are not available in TSO/E REXX.
>
You might come close with:
    'pipe P.'
    address SH 'foo >'P.2 '&'
    'readfile /dev/fd/'P.1 'STEM.'

>________________________________________
>From:  Jake Anderson
>Sent: Wednesday, March 9, 2022 1:38 AM
>
>Cross posted
>
>Good evening
>
>Is it possible to copy a rexx output to a OMVS file everytime by overriding
>it ?
>
>Any samples that I can refer to ?

--
gil

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

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

Reply via email to