Hi John.
is "bpxunix" something available?
I am getting a "label" not found when the call to bpxunix is executed.
Thanks.

________________________________________
From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
McKown, John [john.mck...@healthmarkets.com]
Sent: Thursday, July 26, 2012 10:55 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Using SSH or SCP in REXX under TSO

Ah. I hadn't realized that you worked for a financial institution. I know they 
are very regulated. We are not as regulated, but HIPAA regs have made things a 
bit more difficult for us too. Have you looked at the bpxunix function? It 
allows you to run z/OS UNIX commands, redirecting stdin, stdout, and stderr 
from REXX. It is documented here:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/BPXZB6A0/5.2

You might be able to do something like:

/* REXX */
stdin.1='cd /unix/subdirectory'
stdin.2='ls -la'
stdin.3='scp unix.file user@UNIX:/tmp'
stdin.4='ls -l /tmp/unix.file'
stdin.0=4
stdout.0=0
stderr.0=0
call bpxunix '/bin/sh -L',stdin.,stdout.,stderr.
do i=1 to stdout.0
say "stdout:"stdout.i
done
do i=1 to stderr.0
say "stderr:"stderr.i
done
/* alternate:
call bpxunix '/bin/sh -L','DD:STDIN','DD:STDOUT','DD:STDERR'
and create
 //STDOUT DD SYSOUT=*
 //STDERR DD SYSOUT=*
 //STDIN  DD *
  scp.unix.fil user@UNIX:/tmp
 /*

*/

//RUNIT EXEC PGM=IKJEFT01,PARM='%DOUNIX'
//SYSTSPRT DD SYSOUT=*
//SYSEXEC DD DISP=SHR,DSN=pds.containing.rexx.above

Remember! that scp on z/OS does an EBCDIC to ASCII translation. If you need a 
binary transfer,
you'll need to use sftp.

--
John McKown
Systems Engineer IV
IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone *
john.mck...@healthmarkets.com * www.HealthMarkets.com

Confidentiality Notice: This e-mail message may contain confidential or 
proprietary information. If you are not the intended recipient, please contact 
the sender by reply e-mail and destroy all copies of the original message. 
HealthMarkets(r) is the brand name for products underwritten and issued by the 
insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance 
Company(r), Mid-West National Life Insurance Company of TennesseeSM and The 
MEGA Life and Health Insurance Company.SM

<snip>
> > -----Original Message-----
> > From: IBM Mainframe Discussion List
> > [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Uriel Carrasquilla
> > Sent: Wednesday, July 25, 2012 5:12 PM
> > To: IBM-MAIN@LISTSERV.UA.EDU
> > Subject: Re: Using SSH or SCP in REXX under TSO
> >
> > 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
> u...@unix.com:/tmp"
> > I tried "BPXBATSL PGM /bin/ssh u...@unix.com '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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to