Has anyone attempted to use the OSHELL command from ADDRESS TSO to run an OMVS script? I was looking to see if there was any success in running a script and getting the output back, it looks like it can only be saved in the /tmp/ dir with out modifying the original OSHELL REXX.
Have you considered using the CA OPS/MVS Unix Systems Services?Using this component you can issue USS commands from an OPS/REXX program and get the response.Here is a sample OPS/REXX program that issues an USS command and displays the response:
cmd = 'ls -l' /* USS command to be issued */address USS"USSCMD COMMAND('"cmd"') STEM(OUT)"do i = 1 to out.0say out.iend
Information on how to install the CA OPS/MVS Unix Systems Services component can be found in the link below:
Thanks Carlos, I am testing with ADDRESS USS, it works fine, with commands, but I am trying to run a bash script that will su to a specific userid, then ssh to a Linux server and run a script. I can get it to work in JCL and REXX BPXBATCH. There are issues when I run it as a ops rexx command, it gets to the su, a USS task is started for the userid I am su'ing to, but I cannot tell if the script completes. I may open a ticket so I can get someone to explain how the address uss process flows. I am not sure if there is a way to monitor the script or can I issue the commands in the script one at a time so OPS can monitor them for me. here is what the script is doing.
#!/bin/sh echo pwd whoami this is where i lose track of what is happeningsu -s userid01 pwd whoami ssh -t lnx##### cd /opt/softdev/batch/scripts pwd ./o8967b.sh echo this has run
Please, open a CA OPS/MVS support case so that we can investigate this subject further.
So was there a conclusion that can be shared from the CA case Allamon ?
We are still working on it. The switch user command in the script is not acting the way that you would think, when executed from the Address USS area. I expected that the script would be running under the OPSUSS task ID, but it appears to be using the first id it finds in RACF that has a UID(0). At least that is my assumption. Support has asked me to update the USSSECURITY parm to the CHECKUSERID value, they have said that this will give me more detail on what is actually happening. I need to schedule a change to do that since this is a production environment.
I will get back with this stream once I have more details on the issue.