Null lines vanished after PUT

A discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
Bernhard
Posts: 6
Joined: Thu Jun 14, 2018 6:32 am

Null lines vanished after PUT

Post by Bernhard » Fri Jun 15, 2018 3:04 am

When I create a dataset with variable length records containing null lines, e.g.

record.1 = "Line 1"
record.2 = ""
record.3 = "Line 3"
"EXECIO 3 DISKW ddname (FINIS STEM record."

and sFTP it to a SSH daemon (in my case on i5) the file on the target system contains only record.1 and record.3. If record.2 is set to at least one blank, the target file contains all three lines.

Is this done by the target system or the sFTP client (the trim option does not influence the behaviour, it seems to be valid only for GET)? And if sFTP does it: is it a bug or a feature? Standard FTP does not kill the null lines...

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

Re: Null lines vanished after PUT

Post by dovetail » Mon Jun 18, 2018 12:48 pm

Co:Z SFTP uses the z/OS C/C++ library for data set I/O, and that library has some odd behavior when it comes to zero-length records.

What you can do to work-around this problem is to do this in your shell script before invoking cozsftp:

export _EDC_ZERO_RECLEN=Y

(watch the case and underscores... must match exactly).

We really should be setting this automatically in Co:Z SFTP. I expect that we will fix this in a subsequent release.

Since you are an Enterprise Support customer, please open a support ticket if you need further assistance.

Bernhard
Posts: 6
Joined: Thu Jun 14, 2018 6:32 am

Re: Null lines vanished after PUT

Post by Bernhard » Fri Jun 22, 2018 4:29 am

Thank you very much, this really works.

Post Reply