On Wed, 25 Jul 2012 22:12:01 +0000, Uriel Carrasquilla wrote: > >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. > Crudely (error recovery is left as an exercise for the student), but it works:
/* Rexx */ signal on novalue; /* Doc: Using ssh from a Rexx EXEC. run on ******** or ???????? */ trace R user_host = ******************* /* Sorry! */ source_file = ******************* parse source . RC = SYSCALLS( 'ON' ) address 'SYSCALL' 'open /dev/null' O_RDWR /* busy out stdin, stdout, stderr. */ 'open /dev/null' O_RDWR 'open /dev/null' O_RDWR say RC RETVAL 'open (source_file)' O_RDONLY stdin = RETVAL map.0 = stdin map.1 = 1 map.2 = 2 arg.1 = 'ssh' arg.2 = user_host arg.3 = 'set -x; cat >foo-sshtest; echo done' arg.0 = 3 env.1 = 'PATH=/bin:/usr/sbin' env.0 = 1 'spawn /bin/ssh 3 map. arg. env.' say RC RETVAL 'close' stdin say RC RETVAL exit( RC ) -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN