On Tue, 8 Feb 2022 17:50:15 +0000, Billy Ashton wrote:

>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)
>
Is delete necessary?  (Does sort require a new (pathopts=OEXCL) file?

>4. PGM=SORT to copy that file to Unix (as /tmp/tempfile.txt (actually, a 
>more meaningful name is used).
>
Why SORT rather than IEBGENER?
o I wouldn't expect Kolusu to suggest anything else.
o A co-worker long ago told me that SYNCGENR outperforms IEBGENER.
o Bur IEBGENER will copy attributes from SYSUT1 to SYSUT2.
o I suggest a private subdirectory of /tmp, with a meaningful name.

>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.
>
What's "!cp"?  I don't understand the "!"
Ah!  on further review, shell negation.

Perhaps:
    if cp ...
    then
        sftp ...
    else
        echo "cp failed with status $?." >&2
    fi
Or:
    cp ... || {
        echo "cp failed with status $?." >&2
        exit 1; }
    sftp ...

-- 
gil

----------------------------------------------------------------------
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