sftp VBS PDS members between z/OS

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

sftp VBS PDS members between z/OS

Post by howikok » Tue Jan 29, 2019 5:20 pm

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: 1875
Joined: Thu Jul 29, 2004 12:12 pm

Re: sftp VBS PDS members between z/OS

Post by dovetail » Thu Jan 31, 2019 12:04 pm

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: 5
Joined: Mon Sep 24, 2018 8:58 am

Re: sftp VBS PDS members between z/OS

Post by howikok » Mon Feb 25, 2019 4:50 pm

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: 1875
Joined: Thu Jul 29, 2004 12:12 pm

Re: sftp VBS PDS members between z/OS

Post by dovetail » Mon Feb 25, 2019 4:54 pm

Please post a small example (input and output) of what you are doing.

howikok
Posts: 5
Joined: Mon Sep 24, 2018 8:58 am

Re: sftp VBS PDS members between z/OS

Post by howikok » Fri Mar 08, 2019 1:58 pm

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: 1875
Joined: Thu Jul 29, 2004 12:12 pm

Re: sftp VBS PDS members between z/OS

Post by dovetail » Fri Mar 08, 2019 2:21 pm

*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 » Fri Mar 08, 2019 2:28 pm

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: 5
Joined: Mon Sep 24, 2018 8:58 am

Re: sftp VBS PDS members between z/OS

Post by howikok » Thu Mar 14, 2019 12:43 pm

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: 1875
Joined: Thu Jul 29, 2004 12:12 pm

Re: sftp VBS PDS members between z/OS

Post by dovetail » Thu Mar 14, 2019 3:39 pm

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: 5
Joined: Mon Sep 24, 2018 8:58 am

Re: sftp VBS PDS members between z/OS

Post by howikok » Thu Mar 21, 2019 1:18 pm

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