Couldn't get handle: Failure

General discussion of the Co:Z Toolkit
Post Reply
jacobsm
Posts: 37
Joined: Thu Apr 23, 2009 9:18 am
Location: Tampa, Florida

Couldn't get handle: Failure

Post by jacobsm »

I'm attempting to send a USS resident file to a zOS dataset using cozsftp and I'm getting this error. I'm successful going the other way, i.e. zOS dataset to USS file.

Co:Z cozsftp version: 1.4.0 beta5 (5.0p1) 2009-08-14
Copyright (C) Dovetailed Technologies, LLC. 2008. All rights reserved.
Connecting to tcs1...
[00818] Couldn't get handle: Failure
ZosPosixFile: Closing file /u/aimj/test.data - 0 bytes read, 0 bytes sent

Here is the failing JCL

//COZBATCH EXEC PGM=COZBATCH
//A DD DSN=AIMJ.INPUT.DATA.LARGE,DISP=SHR
//STEPLIB DD DISP=SHR,DSN=MVSISV.COZ.LOAD
//STDIN DD *
cozsftp aimj@tcs1
put /tcs/ncoahttp/ncoarpt/out/CIRCH12A.xls //DD:A
//SYSOUT DD SYSOUT=*
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

With the cozsftp put command, the name of the local file is the first argument and the name of the second argument is second. You have the arguments reversed.
jacobsm
Posts: 37
Joined: Thu Apr 23, 2009 9:18 am
Location: Tampa, Florida

File handle problem

Post by jacobsm »

I figured out the problem

It seems like the home directory isn't being set correctly with the source of the put is a USS file.

This works

//STEPLIB DD DISP=SHR,DSN=MVSISV.COZ.LOAD
//STDIN DD *
cozsftp aimj@tcs1
put /u/aimj/test.data //DD:A
//SYSOUT DD SYSOUT=*
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*

This doesn't

//STEPLIB DD DISP=SHR,DSN=MVSISV.COZ.LOAD
//STDIN DD *
cozsftp aimj@tcs1
put test.data //DD:A
//SYSOUT DD SYSOUT=*
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*

cozsftp> put test.data //DD:A
Uploading test.data to //DD:A

Co:Z cozsftp version: 1.4.0 beta5 (5.0p1) 2009-08-14
Copyright (C) Dovetailed Technologies, LLC. 2008. All rights reserved.
Connecting to tcs1...
[00818] Couldn't get handle: Failure
ZosPosixFile: Closing file /u/aimj/test.data - 0 bytes read, 0 bytes sent


My home directory is set to /u/aimj and the home directory is picked up with I put to a USS file.

//A DD DSN=AIMJ.INPUT.DATA.LARGE,DISP=SHR
//STEPLIB DD DISP=SHR,DSN=MVSISV.COZ.LOAD
//STDIN DD *
cozsftp aimj@tcs1
put //DD:A test.data
//SYSOUT DD SYSOUT=*
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*

cozsftp> put //DD:A test.data
Uploading //DD:A to /u/aimj/test.data
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

You can't put to a remote DD, since the DD wouldn't be allocated on the remote server.
jacobsm
Posts: 37
Joined: Thu Apr 23, 2009 9:18 am
Location: Tampa, Florida

Home directory problem

Post by jacobsm »

DD A is on the same server as the execution of the cozsftp command. All this job is doing is a fancy oput from an MVS dataset to an omvs file on the same system.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

OK, but how is DD:A allocated in the SSHD/sftp server address space?

The Co:Z sftp client supports DD references, the server does not.

If you want to copy a from from a omvs file to a dataset, sftp is far from the best way. Just use the Co:Z todsn or fromdsn commands under a COZBATCH step directly.
jacobsm
Posts: 37
Joined: Thu Apr 23, 2009 9:18 am
Location: Tampa, Florida

Post by jacobsm »

I'm still a bit mixed up;

This works;

//STEPLIB DD DISP=SHR,DSN=MVSISV.COZ.LOAD
//STDIN DD *
cozsftp aimj@tcs1
put /u/aimj/test.data //DD:A
//SYSOUT DD SYSOUT=*
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*

This doesn't

//STEPLIB DD DISP=SHR,DSN=MVSISV.COZ.LOAD
//STDIN DD *
cozsftp aimj@tcs1
put test.data //DD:A
//SYSOUT DD SYSOUT=*
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*

The only difference is that on the working job the USS file is spelled out with it's full path. When I reverse the source and target on the put command I don't need the full path to the uss file.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

I don't see how either would work, since I would not expect DD:A to be allocated in the SSDH/sftp-server address space.

What does the session log file created by Co:Z sftp-server show?
Post Reply