cond code 0 when //!filename not found

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
mhenson
Posts: 3
Joined: Tue Nov 19, 2013 5:37 am

cond code 0 when //!filename not found

Post by mhenson »

running in ZOS batch mode . When we prefix MVS filenames with // all works well . If file does not exist we get cond code 1 .

However when we use //! ( to ensure MVS filename standards ) , if the file does not exist , we still get condition code 0
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: cond code 0 when //!filename not found

Post by dovetail »

The //! prefix or the new maxdsndirlevels option are required if you are using a data set name that ALSO can be treated as a logical "directory" because other data sets exist below it. See this explanation on how data set names are determined:

http://dovetail.com/docs/sftp/dsn-determination.html

Regarding your problem with not getting a error return code - please post example job input / output or email to info@dovetail.com and we will review.

It may be helpful to capture debugging information by adding this to your script, before the cozsftp command:

export COZ_LOG=T
ssh_opts="$ssh_opts -vvv"
mhenson
Posts: 3
Joined: Tue Nov 19, 2013 5:37 am

Re: cond code 0 when //!filename not found

Post by mhenson »

this is log where we use // prefix and get a cond code 1 as required

..59.703. debug3: Sent message fd 6 T:17 I:5
..59.704. debug3: Received stat reply T:105 I:5
..59.712. stat //IMA7.D7.LR.BDK.D7BX014.SORTTAF.F131114: not found
..59.714. the put command can only upload a single dataset or PDS member
..59.714. debug3: process_put() err=-1
.debug2: channel 0: read<=0 rfd 5 len 0
.debug2: channel 0: read failed

this is using //! - step returns cond code 0 implying successful transfer

..58.198. debug3: Sent message fd 6 T:17 I:5
..58.199. debug3: Received stat reply T:105 I:5
..58.217. stat //!IMA7.D7.LR.BDK.D7BX014.SORTTAF.F131114: not found
.ZosUtil.E.: zos_readdir should only be called for OS directories
.debug2: channel 0: read<=0 rfd 5 len 0
.debug2: channel 0: read failed
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: cond code 0 when //!filename not found

Post by dovetail »

I would like to see a more (all) of the log from the failing case to see what happened before and after.

For example: I can't tell from the log fragment what version of Co:Z SFTP you are running, which is important since there have been fixes in recent versions in this area.

If you wish, you can email the entire log to info@dovetail.com. Please do not include any confidential information.
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: cond code 0 when //!filename not found

Post by dovetail »

We reviewed your log, and confirmed that the problem is a known bug that was fixed in release 2.3.2:

See: http://dovetail.com/docs/cozinstall/changes.html
Release 2.3.2
...
o Fixed a problem where the cozsftp put command could fail but not set the exit code appropriately.
I notice that you are running a very old version; I would suggest that you review the revision history above and consider upgrading to the current release.

Note that you can install the current release in an alternate directory and then point the coz_bin variable in your script to that version for testing.
Post Reply