Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 736
paxdiablo Avatar asked Jun 12 '14 08:06

paxdiablo


People also ask

Does SCP transfer in binary mode?

In essence, all files are transferred in "binary" mode, meaning that line endings are never changed.

What is binary transfer?

Binary file transfer is a standard used to transmit data files through protocols of different telematic services, including Telefax Group 3 and 4, Teletex and Data Transfer and Manipulation (DTAM) normal mode.


1 Answers

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
like image 160
paxdiablo Avatar answered Sep 21 '22 13:09

paxdiablo