How can I convince z/OS scp to transfer binary files?
Asked Answered
L

1

7

We have SSH-based file transfer scripts currently set up for Linux-to-Linux and we're porting them to z/OS to go z/OS-to-Linux. Note that this is with USS, the UNIX system services within z/OS otherwise known as OMVS, which uses EBCDIC under the covers, not zLinux which uses ASCII.

We've set up all the SSH key files and what-not, and the transfer itself is working fine.

However z/OS, in it's infinite wisdom, insists on converting the files from EBCDIC to ASCII despite the fact that they're binary files - this is screwing up the content of the destination files.

The scp manpage on z/OS states:

scp assumes that files are text. Files copied between EBCDIC and ASCII platforms are converted.

and I can find nothing useful in the manuals that indicates how to get around this.

It seems a bizarre limitation for anyone wanting to transfer binary files between the two platforms. Does anyone know of a way, using SSH-standard keyfiles (we need this for security, no naked FTP allowed), to effect a binary transfer without translation?

Loosing answered 12/6, 2014 at 8:47 Comment(1)
I'm having a similar problem. For some reason SCP works from windows to USS but not form linux to USSLeach
L
8

You can use one of the other SSH-based tools such as sftp.

Whereas scp will let you transfer a file (with automatic authentication set up) with something like:

scp -i ident_file zos_file linux_user@linux_box:linux_file

you can do a similar thing with the secure FTP:

sftp IdentityFile=ident_file -b - linux_user@linux_box <<EOF
    binary
    put zos_file linux_file
EOF
Loosing answered 12/6, 2014 at 9:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.