HI All
we are trying to ftp a binary file from z/OS V2.1 to a PC running Windows.
The z/OS file is a "xmitted" jcl pds.
Have tried many different options to transfer this file with success but alas, when the file arrive on the PC it is not readable.
Here is my input:
coz_bin="/usr/local/bin"
remoteuser="xxx"
server="xxx.xxx.xxx.xxx"
servercp="IBM-1047"
remotefile="cpacp2.xmit"
ssh_opts="$ssh_opts -oConnectTimeout=60"
ssh_opts="$ssh_opts -oServerAliveInterval=60"
ssh_opts="$ssh_opts -oStrictHostKeyChecking=yes"
# Invoke the Co:Z sftp client with an in-line batch of commands
# that downloads a remote file to a local DD.
$coz_bin/cozsftp $ssh_opts -v $remoteuser@$server <<EOB
lzopts mode=binary,servercp=$servercp,linerule=rdw
put //DD:DOWNLOAD $remotefile
EOB
Here is the batch job result:
cozsftp> lzopts mode=binary,servercp=IBM-1047,linerule=rdw
linerule=rdw mode=binary servercp=IBM-1047
cozsftp> put //DD:DOWNLOAD cpacp2.xmit
ZosSettingsÝI¨: Transfer options: mode=binary
ZosDatasetÝI¨: Opening dataset DD:DOWNLOAD for read
Uploading //DD:DOWNLOAD to /xxx/xxx/cpacp2.xmit
ZosDatasetÝI¨: Closing dataset //SYS0002.CPACP2.XMIT - 5004 records read, 374793
I ftp the file from z/OS to a linux box .. and then from there to my PC and even straight to my PC ..
the file size when arriving on the PC is - 374810 - ..
I then try to read the file with a XMIT reader and the response is that I should try to ftp the file in binary without crlf.
This incidentally works if I use normal ftp.
Thanks
Nico Potgieter
From a very sunny, very very hot South Africa
BInary ftp from z/OS
Re: BInary ftp from z/OS
You have a couple of problems:
1) You should not use linerule=rdw or servercp. Try this for lzopts:
lzopts mode=binary
2) your record count (5004) and sent bytes (374793) don't make sense for an XMIT dataset. An XMIT data set should be RECFM=FB,LRECL=80. If you use the correct lzopts and a proper XMIT data set, you should get 5004 * 80 bytes sent.
These still don't explain why your sent byte count 374793 != 374810.
1) You should not use linerule=rdw or servercp. Try this for lzopts:
lzopts mode=binary
2) your record count (5004) and sent bytes (374793) don't make sense for an XMIT dataset. An XMIT data set should be RECFM=FB,LRECL=80. If you use the correct lzopts and a proper XMIT data set, you should get 5004 * 80 bytes sent.
These still don't explain why your sent byte count 374793 != 374810.