View previous topic :: View next topic
|
Author |
Message |
kanne
New User
Joined: 16 Dec 2009 Posts: 4 Location: Wiesbaden, Germany
|
|
|
|
Hi guys,
this is my first post as I'm rather new to Mainframe activities. I read a lot here already that helped me understand different aspects of OS/390 related topics.
But now to my problem:
I do some REXECs from MVS to UNIX using REXX.
My code looks like this:
Code: |
sendrexec:
x=outtrap('rexec1output.');
"REXEC -d" server rexeccommand1
x=outtrap('off');
rexec1rc=rc;
|
As a matter of fact, I do get local returncodes by calling from rc.
I now had the idea to put the remote rc on the remote-side into a file and later on get this file to check it on the MVS side.
I just would like to know, if there is some easier way of getting the result. I looked up the Internet and some related IBM documentation but didn't find anything useful, whereas I did find info on howto do it for FTP. Do you have an idea, how I could catch remote return codes by calling REXEC this way?
Thanx for any suggestions in advance.
Cheers! |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
You should have ... if You had searched with rexec command return code
here is a suggestion I found...
On the remote host echo the exit code after the command has completed and use that on the localhost by using tail -1 on the output of the rexec command.
used with something like ...
"REXEC -d" server rexeccommand1; echo $0
watch for the quotes and apostrophes !
not tested!! |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Mainframe UNIX or external UNIX boxes? |
|
Back to top |
|
|
kanne
New User
Joined: 16 Dec 2009 Posts: 4 Location: Wiesbaden, Germany
|
|
|
|
@enrico:
Thanx a lot so far, I found the link you refer to.
Actually I use an echo $? to get rc and would you it for my imho little overkill idea to write rc to a file remote and ftp it back to process it further. Tough that should work somehow.
By using echo $? and not putting it into a file, that is, just displaying it, I find it in my Rexx output but don't know how to parse it. I know of tail -1 but can't figure how to use such a construct in Rexx. Any hints are highly appreciated. Btw, in production my whole Rexx will be called by another Rexx, which again is started by JCL if that matters at all.
@Peter:
Thanx too for participating on this. I'm communicating with an external Unix box.
Cheers! |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
what happens when You issue a rexec from the tso command line..
IIRC if You get an output You should see on the screen,
if it is so then outtrap should ... the namell trap it
an since You can outtrap to a stem , all You need is to do a bit of tweaking on the stem itself |
|
Back to top |
|
|
kanne
New User
Joined: 16 Dec 2009 Posts: 4 Location: Wiesbaden, Germany
|
|
|
|
Hi,
your idea sound perfect.
As a matter of fact, the OUTTRAP is not trapping anything. My stem is empty. I think it is because the stuff displayed there is not coming from REXX say commands. Apperently remote output is not getting trapped. Is there another way of getting this done?
Many thanx for your input so far!
Cheers! |
|
Back to top |
|
|
|