I need to copy files from zOS 1.11 to a Unix machine on a regular basis (not to USS or Linux under zVM). I came across a sample REXX under the IBM web site to execute USS shell commands (not a JCL solution but Rexx). The /bin directory has ssh and scp. I set up the id_rsa.pub so I can now ssh into my zOS/USS and from there I can "scp" files to my Unix machine. Once I ssh into zOS/USS, I can also ssh from zOS/USS to the same Unix machine with the id_rsa.pub set up. The above ssh and scp can be accomplished without a password because of the id_rsa.pub that was set up on remote Unix machine. Known hosts was properly set up the first time I went from zOS to Unix machine. But my task is not to sign on from remote machine via SSH to zOS/USS. My work needs to be originated from zOS and in some cases from TSO. The problem is that when I try to use my REXX from TSO, I cannot scp or ssh into my remote Unix machine. (yes, the one that when I used ssh to get to zOS/USS, I can go from there to my Unix machine - I hope I am not confusing everybody here). The REXX is using "BPXBATSL PGM /bin/scp uss-file [email protected]:/tmp" I tried "BPXBATSL PGM /bin/ssh [email protected] 'ls" to no avail. I keep on getting a return code of 2 without anything in STDOUT or STDERR.
Does anybody have a sample REXX that can be shared to either scp or ssh to remote Unix from TSO? I have seen JCL to that effect using BPXBATCH but I have not tried it since I need the REXX. ps/ I am able to get "BPXBATSL PGM /bin/ls" to work by going to USS and pulling the "ls" listing. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
