Hi again...is there a way to run a single BPXBATCH JCL member that copies some instream data into temp files and then run a command that uses those files?

For example, I tried this, but got no output:
//SFTP      EXEC PGM=BPXBATCH
//STDOUT    DD SYSOUT=*
//STDERR    DD SYSOUT=*
//SYSOUT    DD SYSOUT=*
//SYSPRINT  DD SYSOUT=*
//SYMBOLS   DD SYSOUT=*
//STDPARM   DD *,SYMBOLS=(JCLONLY)
sh cat > &PATH/pwd.sh   << EOF1
echo '&PASS'
EOF1
sh cat > &PATH/sftp1.sh << EOF2
export DISPLAY=FOO
export SSH_ASKPASS=&PATH/pwd.sh
#--------------- Now run the sftp command
sftp -vv  -F /tmp/ssh.cfg -b /tmp/sf.cmd $1@$2
EOF2
sh cat > &PATH/sf.cmd << EOF3
# ---------- 1. Change to the directory for dept upload files
cd Dept_files_XX
# ---------- 2. Type of file transfer - ascii or binary
&TYPE
# ---------- 3. Download the file from the server
get &SRVNAME
# ---------- 4. Copy the file from the unix HFS to z/OS
!cp &SRVNAME "//'&FTP$'"
# ---------- 5. Remove the intermediate work files from unix HFS
!rm &SRVNAME
!rm pwd.sh
!rm sf.cmd
!rm sftp1.sh
EOF3
sh cat > &PATH/ssh.cfg << EOF4
Host my.company.sensitive.downloads
Port 22
User &[email protected]
BatchMode no
StrictHostKeyChecking no
PasswordAuthentication yes
PubkeyAuthentication no
IdentityFile /dev/null
EOF4
sh cd &PATH;
sh /tmp/sftp1.sh &USER &FTP
/*

I read somewhere that every command in STDPARM needs a semi-colon at the end, and wonder if that is my problem--where would I put the s-colon on these redirected input commands? Or is there a better way to handle all these lines instream? I would like to keep it simple and in one JCL step, as the user base is not very JCL fluent. Here, JCL DD * cannot be used in BPXBATCH, as far as I can tell.

Also, before you ask, because of the highly sensitive nature of this server, the passwords are changed at a very high frequency, and they elected to use user/password authentication as keys do not allow the time-restricted access they need.

Thanks for your advice!
Billy


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to