SFTP PUT receives "Couldn't get handle: No such file or directory"

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
kdl1985
Posts: 13
Joined: Thu Sep 22, 2011 2:33 pm

SFTP PUT receives "Couldn't get handle: No such file or directory"

Post by kdl1985 »

Using COZBATCH to upload a z/OS data set to an external vendor fails with the following message:

[98.463] Couldn't get handle: No such file or directory

The STDERR DD contains the following:

+ coz_bin=/usr/local/coz/bin
+ ruser=xxxxxxxx
+ server=xxx.xxx.xxx.xx
+ servercp=ISO8859-1
+ export PASSWD_DSN=xxxx.xxxxxxxxx.xxxxx
+ export SSH_ASKPASS=/usr/local/coz/bin/read_passwd_dsn.sh
+ export DISPLAY=none
+ ssh_opts=-oBatchMode=no
+ ssh_opts=-oBatchMode=no -oPort=xxxx
+ ssh_opts=-oBatchMode=no -oPort=xxxx -oConnectTimeout=60
+ ssh_opts=-oBatchMode=no -oPort=xxxx -oConnectTimeout=60 -oServerAliveInterval=60
+ ssh_opts=-oBatchMode=no -oPort=xxxx -oConnectTimeout=60 -oServerAliveInterval=60 -oStrictHostKeyChecking=yes
+ /usr/local/coz/bin/cozsftp -oBatchMode=no -oPort=xxxx -oConnectTimeout=60 -oServerAliveInterval=60 -oStrictHostKeyChecking=yes -b-
xxxxxxxx@xxx.xxx.xxx.xx
+ 0<< EOB
lzopts mode=text,NOTrim,servercp=ISO8859-1
cd /xxxxxxxx
ls
put //DD:UPLOAD yyyyyy@yyyyyy
ls
Co:Z SFTP version: 2.4.5 (5.0p1) 2014-05-29
Copyright (C) Dovetailed Technologies, LLC. 2008-2013. All rights reserved.
-DEG SFTP
-WARNING: UNAUTHORIZED USE PROHIBITED.
-ALL USERS ARE LEGALLY ACCOUNTABLE FOR THEIR ACTIONS.
BY USING THIS SYSTEM, YOU CONSENT TO HAVING YOUR ACTIONS LOGGED.
/usr/local/coz/bin/read_passwd_dsn.sh prompt: "xxxxxxxx@xxx.xxx.xxx.xx's password: "
fromdsn(xxxx.xxxxxxxx.xxxxx) N : 1 records/80 bytes read; 10 bytes written in 0 milliseconds.
Connection established, local_addr=xxx.xxx.xxx.xx local_port=14955 remote_addr=xxx.xxx.xxx.xx remote_port=xxxx
ZosDataset I : Opening dataset DD:UPLOAD for read
98.463 Couldn't get handle: No such file or directory
ZosDataset I : Closing dataset //SYS15015.T111129.RA000.D032460F.ZIPOUT.H02 - 0 records read, 0 bytes sent

The STDOUT DD has the following:

cozsftp> lzopts mode=text,NOTrim,servercp=ISO8859-1
mode=text servercp=ISO8859-1 NOTrim
cozsftp> cd /xxxxxxxx
cozsftp> ls
canceled downloaded
cozsftp> put //DD:UPLOAD yyyyyyV@yyyyyy
Uploading //DD:UPLOAD to /xxxxxxxx/yyyyyy@yyyyyyy/DD:UPLOAD

Does the Uploading message appear to be correct, where it is appending the /DD:UPLOAD to the name? Would this be causing the "No such file or directory" message?

Thank you.
kdl1985
Posts: 13
Joined: Thu Sep 22, 2011 2:33 pm

Re: SFTP PUT receives "Couldn't get handle: No such file or directory"

Post by kdl1985 »

I determined the problem was due to the "@" in the member name. I will need to check with the vendor if a different name without the "@" will be accepted.

Thank you
kdl1985
Posts: 13
Joined: Thu Sep 22, 2011 2:33 pm

Re: SFTP PUT receives "Couldn't get handle: No such file or directory"

Post by kdl1985 »

The put was changed from:

put //DD:UPLOAD yyyyyy@yyyyyyy

to

put //DD:UPLOAD /yyyyyy/yyyyyy

This allowed the z/OS data set to be uploaded to the correct remote mailbox.

The Uploading comment also no longer showed that the DD:UPLOAD was being appended to the remote file name. Appears that the "@" in the name resulted in an incorrect remote file name being built.
Post Reply