using fromdsn //dd: to point the dsn for export PASSWD_DSN=

Discussion of the COZBATCH utility for z/OS
Post Reply
tnakelski
Posts: 3
Joined: Fri Feb 25, 2011 1:42 pm

using fromdsn //dd: to point the dsn for export PASSWD_DSN=

Post by tnakelski »

Looking over the output of the exec of cozsftp in batch noticed that the fromdsn(MY.CNTL(PW)) which contains my password for the remote ftp site. Wondering if it is possible to use "fromdsn //dd:" within standard MVS JCL to point to this file, instead of using the parm option. Trying to make a generic proc that can be used for multiple sites using symbolics. We currently have a generic proc setup to handle non sftp transfers which the application people us. All they need to do is replace some symbolic
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

Unfortunately, it is not possible.

The Ported Tools "ssh" command forks the $SSH_ASKPASS program/script in a separated address space, so using a DD in the original job is not possible.
tnakelski
Posts: 3
Joined: Fri Feb 25, 2011 1:42 pm

Post by tnakelski »

Tring to use a parm to add the file name into the script. But it seems not to be working. I saw that in a post that it should work. I have attached the exec jcl, part of the script and what it looks like after exec.
JCL
//SFTP EXEC PGM=COZBATCH,
// PARM='TRANSFER=BINARY PASSWD=ST1MAT.CNTL(PW)'
Script
coz_bin="/usr/lpp/coz/bin"
remoteuser="pcchsec"
server="sftp.data-mail.com"
servercp="ISO8859-1"
# remotefile="/users/pcchsec"
export PASSWD_DSN='//$PASSWD'

message
IKJ56228I DATA SET $PASSWD NOT IN CATALOG OR CATALOG CAN NOT BE ACCESSED
fromdsn($PASSWD)ÝE¨: DatasetHandler: BPXWDYN allocation failed S99ERROR=0x
fromdsn($PASSWD)ÝE¨: DatasetHandler: BPXWDYN command was: "alloc fi(SYS000
IKJ56247I FILE SYS00003 NOT UNALLOCATED, IS NOT ALLOCATED
FOTS1346 Permission denied, please try again.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

Tip: add a line "set -x" to the beginning of your shell script to get a trace.

It looks to me that your problem is that you have single quotes on this line:

export PASSWD_DSN='//$PASSWD'

The Unix shell quoting rules require that you use double quotes instead of single quotes if you want to allow substitution of the $PASSWD variable.
tnakelski
Posts: 3
Joined: Fri Feb 25, 2011 1:42 pm

Post by tnakelski »

I understand what you are saying. The example from your install shows the statement as:
export PASSWD_DSN='//COZUSER.PASSWD(SITE1)'
having single quotes on this line. I'm assuming the singe quotes are required in the script.

If I change the parm to:
//SFTP EXEC PGM=COZBATCH,
// PARM='TRANSFER=BINARY PASSWD='//ST1MAT.CNTL(PW)' '
and the script to:
export PASSWD_DSN="$PASSWD"

It should look like this:
export PASSWD_DSN='//ST1MAT.CNTL(PW)'

after reading the parm and applying it.

Hopefully.
Post Reply