Using //DD:ddname fails

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
david.lemasters
Posts: 5
Joined: Fri Jan 27, 2012 3:17 pm

Using //DD:ddname fails

Post by david.lemasters »

I have a dd card //DOWNLOAD DD DSN=...
and use the command: get from/file/data //DD:DOWNLOAD
it fails with the message: Couldn't open local file "//DD:DOWNLOAD" for reading: EDC5037I The specified ddname was not found. (errno2=0xC00B05B1)
it works if I use the real dsname, but not the ddname .
Running z/os 1.11 with cozsftp 2.0.1.
Any ideas?

Thanks
David LeMasters
coz
Posts: 392
Joined: Fri Jul 30, 2004 5:29 pm

Re: Using //DD:ddname fails

Post by coz »

David,

You may be doing something in your script that is causing a new address space to be created, which would remove your access to the DD.

Can you post your entire script here for us to look at? If you don't want to do that, send it to info@dovetail.com.
david.lemasters
Posts: 5
Joined: Fri Jan 27, 2012 3:17 pm

Re: Using //DD:ddname fails

Post by david.lemasters »

Here is the JCL and control statements:

//RUNSFTP EXEC PGM=COZBATCH
//STEPLIB DD DISP=SHR,DSN=SOFT.COZ201.LOADLIB
//UPLOAD DD DSN=DLEMAST.MYLOG2.TXT,DISP=OLD
//STDIN DD DDNAME=OPTIONS
// DD DDNAME=EXECSFTP
// DD DDNAME=COMMANDS
//OPTIONS DD *
echo $PATH
export PATH=/home/dlemast/coz201/bin:$PATH
echo $PATH
# Customize these ...
remoteuser="dlemast"
server="mvsc"

# If ascii remote use ISO8859-1, if ebcdic remote use IBM-1047
#servercp="ISO8859-1"
servercp="IBM-1047"

# define remote file name
remotefile="mylog3"

# define local file name
localfile="//DD:UPLOAD"

# define password location
export PASSWD_DSN='//DLEMAST.SYSTEMS.DATA(PASSWORD)'

# Options - mode=text or binary
mode=text

//EXECSFTP DD *
# Cozbatch OMVS Directory
coz_bin="/home/dlemast/coz201/bin"
export SSH_ASKPASS=$coz_bin/read_passwd_dsn.sh
export DISPLAY=none

ssh_opts=""
ssh_opts="$ssh_opts -oBatchMode=no"
ssh_opts="$ssh_opts -oConnectTimeout=60"
ssh_opts="$ssh_opts -oServerAliveInterval=60"
ssh_opts="$ssh_opts -oStrictHostKeyChecking=no" # accept initial host key

$coz_bin/cozsftp $ssh_opts -b- $remoteuser@$server <<EOB
lzopts mode=$mode,servercp=$servercp

//COMMANDS DD *
# sftp commands
put $localfile $remotefile
EOB

//*


And here is the SYSOUT listing:

CoZBatch.N.: Copyright (C) 2005-2009 Dovetailed Technologies LLC. All rights reserved.
CoZBatch.N.: version 2.0.1 2012-01-14
CoZBatch.I.: executing progname=login-shell="-/bin/sh"
/usr/lpp/zosmf/V1R11/bin:/usr/lpp/zosmf/V1R11/bin:.:/usr/lpp/zosmf/V1R11/bin:.:/bin:/usr/lpp/java/J5.0/bin:/usr/local/bin:/usr/lpp/p
orted/bin:/bin:
/home/dlemast/coz201/bin:/usr/lpp/zosmf/V1R11/bin:/usr/lpp/zosmf/V1R11/bin:.:/usr/lpp/zosmf/V1R11/bin:.:/bin:/usr/lpp/java/J5.0/bin:
/usr/local/bin:/usr/lpp/ported/bin:/bin:
Co:Z SFTP version: 2.0.1 (5.0p1) 2012-01-14
Copyright (C) Dovetailed Technologies, LLC. 2011. All rights reserved.
cozsftp> lzopts mode=text,servercp=IBM-1047
mode=text servercp=IBM-1047
cozsftp>
cozsftp> # sftp commands
cozsftp> put //DD:UPLOAD mylog3
Uploading //DD:UPLOAD to /home/dlemast/mylog3
ZosDataset.I.: Opening dataset DD:UPLOAD for read
DatasetHandler.E.: Error in fopen(//DD:UPLOAD, rb,type=record,noseek,recfm=*) - EDC5037I The specified ddname was not found.
(errno2=0xC00B05B1)
.13.770. Couldn't open local file "//DD:UPLOAD" for reading: EDC5037I The specified ddname was not found. (errno2=0xC00B05B1)
CoZBatch.I.: returning rc=exitcode=1


Thanks
David LeMasters
coz
Posts: 392
Joined: Fri Jul 30, 2004 5:29 pm

Re: Using //DD:ddname fails

Post by coz »

David,

Can you add an "env" call to your script to dump your environment and post the results? It doesn't matter where you put it, but this will work fine:

Code: Select all

ssh_opts="$ssh_opts -oStrictHostKeyChecking=no" # accept initial host key 
env
$coz_bin/cozsftp $ssh_opts -b- $remoteuser@$server <<EOB 
--Steve
david.lemasters
Posts: 5
Joined: Fri Jan 27, 2012 3:17 pm

Re: Using //DD:ddname fails

Post by david.lemasters »

Here is the SYSOUT with env added:

CoZBatch.N.: Copyright (C) 2005-2009 Dovetailed Technologies LLC. All rights reserved.
CoZBatch.N.: version 2.0.1 2012-01-14
CoZBatch.I.: executing progname=login-shell="-/bin/sh"
/usr/lpp/zosmf/V1R11/bin:/usr/lpp/zosmf/V1R11/bin:.:/usr/lpp/zosmf/V1R11/bin:.:/bin:/usr/lpp/java/J5.0/bin:/usr/local/bin:/usr/lpp/p
orted/bin:/bin:
/home/dlemast/coz201/bin:/usr/lpp/zosmf/V1R11/bin:/usr/lpp/zosmf/V1R11/bin:.:/usr/lpp/zosmf/V1R11/bin:.:/bin:/usr/lpp/java/J5.0/bin:
/usr/local/bin:/usr/lpp/ported/bin:/bin:
_EDC_ADD_ERRNO2=1
MAIL=/usr/mail/DLEMAST
PATH=/home/dlemast/coz201/bin:/usr/lpp/zosmf/V1R11/bin:/usr/lpp/zosmf/V1R11/bin:.:/usr/lpp/zosmf/V1R11/bin:.:/bin:/usr/lpp/java/J5.0
/bin:/usr/local/bin:/usr/lpp/ported/bin:/bin:
_TAG_REDIR_IN=TXT
_BPXK_AUTOCVT=ON
_CXX_PLIB_PREFIX=SYS1
SSH_ASKPASS=/home/dlemast/coz201/bin/read_passwd_dsn.sh
_CEE_RUNOPTS=FILETAG(AUTOCVT,AUTOTAG) HEAPP(ON)
PYTHONHOME=/usr/local/bin
_CC_PLIB_PREFIX=SYS1
_BPX_SPAWN_SCRIPT=YES
_=/bin/env
PASSWD_DSN=//DLEMAST.SYSTEMS.DATA(PASSWORD)
CLASSPATH=:/usr/lpp/WebSphere/AppServer/lib/servlet.jar
LOGNAME=DLEMAST
PEGASUS_HOME=/usr/lpp/wbem
LANG=C
LIBPATH=/lib:/usr/lib:.:/etc/websrv1/lib:/usr/local/bin:/usr/lpp/wbem/lib:/usr/lpp/wbem/provider
DISPLAY=none
_TAG_REDIR_OUT=TXT
_CXX_CLIB_PREFIX=SYS1
_BPXK_JOBLOG=STDERR
_EUV_AUTOLOG=NO
_BPX_SHAREAS=NO
HOME=/home/dlemast
_CC_CLIB_PREFIX=SYS1
TZ=EST5EDT
_TAG_REDIR_ERR=TXT
MANPATH=/usr/man/%L
NLSPATH=/usr/lib/nls/msg/%L/%N
Co:Z SFTP version: 2.0.1 (5.0p1) 2012-01-14
Copyright (C) Dovetailed Technologies, LLC. 2011. All rights reserved.
cozsftp> lzopts mode=text,servercp=IBM-1047
mode=text servercp=IBM-1047
cozsftp>
cozsftp> # sftp commands
cozsftp> put //DD:UPLOAD mylog3
Uploading //DD:UPLOAD to /home/dlemast/mylog3
ZosDataset.I.: Opening dataset DD:UPLOAD for read
DatasetHandler.E.: Error in fopen(//DD:UPLOAD, rb,type=record,noseek,recfm=*) - EDC5037I The specified ddname was not found.
(errno2=0xC00B05B1)
.54.334. Couldn't open local file "//DD:UPLOAD" for reading: EDC5037I The specified ddname was not found. (errno2=0xC00B05B1)
CoZBatch.I.: returning rc=exitcode=1


Thanks
David LeMasters
coz
Posts: 392
Joined: Fri Jul 30, 2004 5:29 pm

Re: Using //DD:ddname fails

Post by coz »

David,

Your login shell is setting _BPX_SHAREAS=NO, which is the problem. You can either set it to YES explicitly in your script, or fix your login profile to do it all of the time.

Once this environment variable is set properly, you should be able to access the DD.
david.lemasters
Posts: 5
Joined: Fri Jan 27, 2012 3:17 pm

Re: Using //DD:ddname fails

Post by david.lemasters »

Thanks, that took care of the problem.

We had it working and then it stopped.
Now I'll have to figure out how that got changed.


Thanks again for your help.

David LeMasters
Post Reply