Hi gil, here is what we do:
1. Run an inhouse program that massages several files and creates one (possibly) large file (&&Untersedfile).
2. Terse that large file (&&Tersedfile)
3. Pre-emptively delete the Unix file (this is the new step)
4. PGM=SORT to copy that file to Unix (as /tmp/tempfile.txt (actually, a more meaningful name is used).
5. Run sftp to transfer it to a remote server at another company.

I thought I had referenced my #4 solution previously, but in any case, Kolusu gave me a SORT OPTION=COPY step that will create the Unix file I need. Sort wants the DCB info for both sides of the copy, which is not a problem as these attributes don't change. I am also considering adding a !cp command to my Sftp script instead of the separate step, but don't know how to test for success of that !cp command before doing the "put" command. I am still researching that, as I am not a very good shell programmer.

Thank you and best regards,
Billy Ashton

------ Original Message ------
From "Paul Gilmartin" <0000000433f07816-dmarc-requ...@listserv.ua.edu>
To IBM-MAIN@listserv.ua.edu
Date 2/8/2022 12:04:56 PM
Subject Re: how to do Unix copy command with temp file

On Tue, 8 Feb 2022 16:06:35 +0000, Billy Ashton wrote:

gil, the reason I cannot write directly is that in one case, after creating my 
file, I run it through AMATERSE to shrink it, and AMATERSE cannout output to 
the Unix file. So in this case, I need to write to a temp file, then copy it to 
Unix where I can send it.

Do you ever need both the TERSE instance and the sftp instance?  If
you need only one you can select whether to allocate a temp DSN or
a UNIX file.

If your data set is large it might be desirable to avoid creating a large
UNIX file.  Sftp just executes a monitor program at the remote site.
Instead of sftp you might be able to:
   cp //temp.dsn /dev/fd/1 |        ssh user@remotehost " set -x; cat 
>remote.file.txt"

(Yo never said how you solved the original "cp" problem.)

Are you allowed to use Dovetailed Co:Z?

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to