Setting target file format for zos to zos transfers

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
mklandrum
Posts: 3
Joined: Thu Nov 05, 2020 9:26 am

Setting target file format for zos to zos transfers

Post by mklandrum »

I’m running the job below attempting to transfer a sequential file between z/os systems. The transfer is successful but the target file is transferred as a single record
//SFTPGET EXEC PROC=SFTPPROC
//SFTPIN DD *
export COZ_LOG=T
cert="A009_COZ_KEYRING:CoZ-sftp-tplex-rsa"
user=A009
host=192.168.9.10
lzopts="mode=text,lrecl=80,recfm=fb,space=trk.3.2,linerule=crlf"
lfile=//A009.TPLEX.MOVEDSN
rfile=//A009.SFTPPUT.DATA
. $script_dir/sftp_put.sh
//

Here is the log output from the target system

BROWSE /MVS2/tmp/sftp-server.a009.047.184316.66032.log Line 0000000000 Col 001 103
Command ===> Scroll ===> CSR
******************************************** Top of Data ******************************
Co:Z SFTP Server version: 5.6.0 (6.4p1) 2019-08-20
Copyright (C) Dovetailed Technologies, LLC. 2008-2019. All rights reserved.
Ý96.738¨ session opened for local user A009 from Ý10.43.102.15¨
Connection established, local_addr=192.168.9.10 local_port=22 remote_addr=10.43.102.15 remote_port=1152
Ý96.793¨ coz-zopts@dovetail.com ",%servercp"
Ý96.798¨ coz-zopts@dovetail.com "clientcp=IBM-1047"
Ý97.024¨ open "//A009.SFTPPUT.DATA" flags WRITE,CREATE,TRUNCATE mode 0666
ZosSettingsÝI¨: Transfer options: mode=binary
ZosDatasetÝI¨: Opening dataset A009.SFTPPUT.DATA for write with options: new catalog
Ý97.183¨ close "//A009.SFTPPUT.DATA" bytes read 0 written 1851
ZosDatasetÝI¨: Closing dataset //A009.SFTPPUT.DATA - 1851 bytes received, 1 records written
Ý97.257¨ session closed for local user A009 from Ý10.43.102.15¨
******************************************* Bottom of Data ****************************

Here is output from the transfer. Should be RF=FB with rl=80 BS=8000. Instead its RF=U RL=0 BS=6144

*********************************************************** Top of Data ************************************************************
//A009SND JOB (0000,0000),'SEND DSN(S)',.// CLASS=A,MSGCLASS=X,NOTIFY=A009,.// TIME=1440,REGION=6M.//*.//*************
********************************************************** Bottom of Data **********************************************************

How do I set the receiving file format
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: Setting target file format for zos to zos transfers

Post by dovetail »

Your problem is that you are not setting the options on the remote Co:Z SFTP server. lzopts only sets the local options.
See https://dovetail.com/docs/sftp/client.h ... erver_opts

Even better is the new dsput / dsget commands, which coordinates setting the target options (DCB, space) to match the source system options.
See: https://dovetail.com/docs/sftp/client.html#client-ztoz

For example:

Code: Select all

//  EXEC PROC=SFTPPROC
//SFTPIN DD *
export COZ_LOG=T
cert="A009_COZ_KEYRING:CoZ-sftp-tplex-rsa"
user=A009
host=192.168.9.10
lfile=//A009.TPLEX.MOVEDSN
rfile=//A009.SFTPPUT.DATA

. $script_dir/sftp_connect.sh <<EOB
dsput $lfile $rfile
EOB
//
Post Reply