sunique/STOU equivalent?

A discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
jmoeyersons
Posts: 2
Joined: Mon May 14, 2018 10:16 am

sunique/STOU equivalent?

Post by jmoeyersons » Wed Jun 06, 2018 9:56 am

We are in the process of replacing all our FTP with SFTP. One snag: some of the regular FTP jobs use (and require) the sunique option. That option makes the FTP client use the STOU instead of the STOR verb to upload a file. The FTP server, when it detects the file-to-upload already exists, will then append a .1 (.2, .3...) to the filename in order to avoid overwriting the already-there file on the server.

I did not find an equivalent option on the SFTP client. Is there one? How can I get the same behaviour using the czsftp command?

Thanks and very best regards,

Jantje.

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

Re: sunique/STOU equivalent?

Post by dovetail » Fri Jun 08, 2018 4:00 pm

Please clarify: is z/OS the client or the server in this scenario?

- if z/OS is the client, then this feature would require something in the SSH/SFTP protocol that does not exist. We wouldn't be able to address that with non z/OS sftp servers.

- if z/OS is the server: there is not currently a matching feature in the sftp protocol or in Co:Z SFTP server.
There is a "noreplace" option in Co:Z SFTP, but this only prevents replacing an existing data set.
It would be possible to add support for z/OS system symbols in z/OS target dataset names, so that a remote client could do something like:

sftp> put localfile //HLQ.DATA.D&LYYMMDD.T&LHHMMSS

>>>> Would a new feature like this meet anyone's requirements for something like this?

jmoeyersons
Posts: 2
Joined: Mon May 14, 2018 10:16 am

Re: sunique/STOU equivalent?

Post by jmoeyersons » Mon Jun 11, 2018 3:54 am

In my scenario, z/OS is the client.
You confirm the equivalent of STOU does not exist in SFTP. I feared already as much...
Obviously, if this were a greenfield development, I could get away with a different scheme and clearly, system symbols could help, but unfortunately, this is not my case...

Post Reply