Set LRECL/RECFM for "put" to Sterling SSH Server

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
kdl1985
Posts: 13
Joined: Thu Sep 22, 2011 2:33 pm

Set LRECL/RECFM for "put" to Sterling SSH Server

Post by kdl1985 »

We are running Co:Z SFTP V4.1.0 and I am using COZBATCH SFTP job to "put" a Fixed Block data set to a system running IBM Sterling GIS SSH Server supporting SFTP/SCP. The vendor is indicating that they are trying to process the dataset and it is failing, because it is appearing as a Variable Blocked data set with a record length of 5921.

The control statements I am using are:

# Customize these ...
coz_bin="/usr/local/coz/bin"
ruser="username"
server="servername"
servercp="ISO8859-1"

# These can be used to read the ssh password from a (secured) dataset
# if you don't want to setup public/private keypairs
export PASSWD_DSN='//XFTP.XXXXXXX.xxxx'
export SSH_ASKPASS=$coz_bin/read_passwd_dsn.sh
export DISPLAY=none

ssh_opts="-oBatchMode=no"
ssh_opts="$ssh_opts -oPort=22"
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.
# Note that "-oBatchMode=no" must be specified before "-b"
# since ssh opts are first-sticky

$coz_bin/cozsftp $ssh_opts -b- $ruser@$server <<EOB
lzopts mode=text,recfm=fb,lrecl=94,NOTrim,servercp=$servercp
put //DD:UPLOAD put_data_set_name.txt

I have tried the zopts parameter, which failed due to the receiving side not running Co:Z and my attempts to use "ls /+mode=text,lrecl=94,recfm=fb" have also failed with a message "Can't ls: '/+mode=text' not found".

Is it possible to set the lrecl and recfm for the remote site when it is running Sterling SSH Server?

Thank you!
Kevin
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: Set LRECL/RECFM for "put" to Sterling SSH Server

Post by dovetail »

I strongly suggest that you use the sample SFTPPROC and sample batch scripts.
There are documented here: https://dovetail.com/docs/sftp/client.html#client-batch

When you send from Co:Z SFTP to a remote non z/OS server, the file sent is a stream of bytes.
The options that you are using are:

lzopts mode=text,NOTrim,servercp=$servercp

(note: that recfm and lrecl are ignored, because you are sending an existing data set).

If the data set that you are sending has RECFM=FB,LRECL=94, then what you will be sending will be a stream of bytes where each 94 byte record will be translated to ISO-8859-1 and then will be followed by an ASCII newline character. So if you have n records, you will send (94+1)*n bytes of ASCII text.

The vendor's complaint makes no sense to me.
kdl1985
Posts: 13
Joined: Thu Sep 22, 2011 2:33 pm

Re: Set LRECL/RECFM for "put" to Sterling SSH Server

Post by kdl1985 »

Thank you for the suggestions. The SFTP was successful using the sample SFTPPROC. This led me to compare with the COZBATCH job that was not successful and one difference that I saw was the use of NOTRIM vs. TRIM. Using TRIM the vendor indicated that the transmission was successful using COZBATCH or the SFTPROC sample.

Thanks again,
Kevin
Post Reply