Append to MVS Dataset

A discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
0c4
Posts: 4
Joined: Fri Sep 29, 2017 3:51 pm

Append to MVS Dataset

Post by 0c4 » Mon Mar 26, 2018 3:17 pm

Is the append command supported at all when the server is running CO:z SFTP? I have simplified the use case I am testing. A client (running COZBATCH via JCL), connects to a mainframe site (running CO:z SFTP), deletes a file, the recreates it with a PUT, followed by updating the file with an append. The append always fails.


I am able to work around the append by using disp=mod on the ls command, and change the append to a put. However I am curious if failure with append is due to a mis-configuration or a bug. Please advise.
CoZBatchÝN¨: version: 5.0.0 2018-01-10
CoZBatchÝN¨: Copyright (C) Dovetailed Technologies, LLC. 2005-2018. All rights r
CoZBatchÝI¨: executing progname=login-shell="-/bin/sh"
Co:Z SFTP version: 5.0.0 (6.4p1) 2018-01-10
Copyright (C) Dovetailed Technologies, LLC. 2008-2018. All rights reserved.
Connecting to sp04ftp...
Connected to sp04ftp.
Connection established, local_addr=172.26.250.9 local_port=38979 remote_addr=172
cozsftp> ls /+mode=text,lrecl=80,recfm=fb,space=cyl.1.5
/+mode=text,lrecl=80,recfm=fb,space=cyl.1.5
cozsftp> -rm //CCOODY.TMP.APPEND.REMOTE
Removing //CCOODY.TMP.APPEND.REMOTE
cozsftp> put //CCOODY.SP.PARMLIB(DONKEY) //CCOODY.TMP.APPEND.REMOTE
Uploading //CCOODY.SP.PARMLIB(DONKEY) to //CCOODY.TMP.APPEND.REMOTE
ZosSettingsÝI¨: Transfer options: mode=binary
ZosDatasetÝI¨: Opening dataset CCOODY.SP.PARMLIB(DONKEY) for read with options:
ZosDatasetÝI¨: Closing dataset //CCOODY.SP.PARMLIB.V1(DONKEY) - 27 records read,
cozsftp> append //CCOODY.SP.PARMLIB(DONKEY) //CCOODY.TMP.APPEND.REMOTE
Uploading //CCOODY.SP.PARMLIB(DONKEY) to //CCOODY.TMP.APPEND.REMOTE
ZosSettingsÝI¨: Transfer options: mode=binary
ZosDatasetÝI¨: Opening dataset CCOODY.SP.PARMLIB(DONKEY) for read with options:
Ý29.099¨ Couldn't write to remote file "//CCOODY.TMP.APPEND.REMOTE": Failure
ZosDatasetÝI¨: Closing dataset //CCOODY.SP.PARMLIB.V1(DONKEY) - 27 records read,
CoZBatchÝI¨: returning rc=exitcode=1

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

Re: Append to MVS Dataset

Post by dovetail » Thu Mar 29, 2018 3:08 pm

Hi Protection Exception,

Your observation is correct - the Co:Z SFTP client "append" command doesn't work if the server is also Co:Z SFTP and the target is a data set.
I believe that the documentation needs to be clarified here, so I appreciate you pointing this out.

You are also correct - the supported way to append to a data set (on a remote Co:Z SFTP server) is to use disp=mod. This works if the client is Co:Z SFTP or any other SFTP client product.

Post Reply