sftp VBS PDS members between z/OS

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
howikok
Posts: 9
Joined: Mon Sep 24, 2018 8:58 am

sftp VBS PDS members between z/OS

Post by howikok »

We are running Co:Z SFTP version: 5.1.1 (6.4p1). No CRLF when transferring members of a PDS with RECFM=VB from z/OS to z/OS. The resulting files have all the lines stringed together. I have tried linerule=rdw and linerule=crlf.
Thanks for your help.

Howi
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: sftp VBS PDS members between z/OS

Post by dovetail »

Try this:

Code: Select all

lzopts mode=binary,l=l4
zopts mode=binary,l=l4
lcd //local.pds
cd //remote.pds
put mem1
For more information, see: https://dovetail.com/docs/sftp/client.h ... erver_opts
howikok
Posts: 9
Joined: Mon Sep 24, 2018 8:58 am

Re: sftp VBS PDS members between z/OS

Post by howikok »

Specifying l=l4 gives me ZosDatasetÝE¨: RecordStreamException: unclaimed data at end of input stream; len=2478, maxLen=0, streamOffset=2478,
recordNumber=0.
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: sftp VBS PDS members between z/OS

Post by dovetail »

Please post a small example (input and output) of what you are doing.
howikok
Posts: 9
Joined: Mon Sep 24, 2018 8:58 am

Re: sftp VBS PDS members between z/OS

Post by howikok »

The remote and local PDS are RECFM=VB and LRECL=255. One sample remote member contains two lines:
/*************/
/* junk */
/*************/
Without the l=l4 option the get command output on the local PDS member contains one line:
/*************//* junk *//*************/
With the l=l4 option the error message is:
ZosDatasetÝE¨: RecordStreamException: unclaimed data at end of input stream; len=144, maxLen=0, streamOffset=144,
recordNumber=0

Regards,
Howi
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: sftp VBS PDS members between z/OS

Post by dovetail »

*all* of the input, and *all* of the output from the failing case please.
lisa
Posts: 5
Joined: Tue Jan 08, 2013 1:39 pm

Re: sftp VBS PDS members between z/OS

Post by lisa »

Please double check that you are setting l=l4 on the client and the server side, i.e. execute lzopts and zopts.

lzopts mode=binary,l=l4
zopts mode=binary,l=l4

You will see the RecordStream error if you have missed one of these settings.
howikok
Posts: 9
Joined: Mon Sep 24, 2018 8:58 am

Re: sftp VBS PDS members between z/OS

Post by howikok »

Thank you Lisa. I need to specify both zopts and lzopts to avoid the ZosDatasetÝE¨: RecordStreamException: unclaimed data at end of input stream

JCL:
//SFTPGET1 EXEC PROC=SFTPPROC
//SFTPIN DD *
user=user1
host=rhost
zopts="mode=text,l=l4:
lzopts="mode=text,l=l4:
# lfile=a text file in your
lfile=//DD:LOCALF2
rfile=//SYSC.XYZ/JUNK
. $script_dir/sftp_get.sh
//LOCALF2 DD DSN=SYSC.XYZ(JUNK),DISP=SHR

input member JUNK:
/*************/
/* junk */
/*************/

SYSOUT:
Co:Z SFTP version: 5.1.1 (6.4p1) 2018-06-01
Copyright (C) Dovetailed Technologies, LLC. 2008-2018. All rights reserved.
Connecting to rhost...
Connected to rhost.
Connection established, ...
cozsftp>
cozsftp> get //SYSC.XYZ/JUNK //DD:LOCALF2
Fetching //SYSC.XYZ/JUNK to //DD:LOCALF2
ZosSettingsÝI¨: Transfer options: mode=binary
ZosDatasetÝI¨: Opening dataset DD:LOCALF2 for write
ZosDatasetÝI¨: Closing dataset //SYSC.XYZ(JUNK) - 45 bytes received, 1 records written
CoZBatchÝI¨: returning rc=exitcode=0

Output
/*************//* junk *//*************/

Thanks.
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: sftp VBS PDS members between z/OS

Post by dovetail »

The problem is that "zopts" is not a variable that is used by the sftp_get.sh sample script.

Try using the more flexible "sftp_connect.sh", which allows arbitrary subcommands:

Code: Select all

//SFTPGET1 EXEC PROC=SFTPPROC
//SFTPIN DD *
user=user1
host=rhost
zopts="mode=text,l=l4:
lzopts="mode=text,l=l4:
# lfile=a text file in your
lfile=//DD:LOCALF2
rfile=//SYSC.XYZ/JUNK

. $script_dir/sftp_connect_sh <<EOB
$lzopts
$zopts
get ${rfile} ${lfile}
EOB
//LOCALF2 DD DSN=SYSC.XYZ(JUNK),DISP=SHR
howikok
Posts: 9
Joined: Mon Sep 24, 2018 8:58 am

Re: sftp VBS PDS members between z/OS

Post by howikok »

Corrected the following typos and it worked:
zopts="zopts mode=text,l=l4"
lzopts="lzopts .."
. $script_dir/sftp_connect.sh <<EOB
Thanks!
Howi
Post Reply