Products Resources Support About Us

Rocket Software

"Can Python do things like REXX?"

I was asked communicating with another Rocket Python user.

“Its code is much nicer than REXX. I’d to replace more things which are currently done in REXX with Python. I’m interested in executing commands from different address spaces (i. e. TSO and etc.) using Python; executing IDCAMS commands and etc.”

This is an interesting topic.
Unfortunately, I have not done much in this area.
But was looking out for ways to do this too!

One thing that could be done in Python is to spawn a subprocess to execute other programs / unix commands.
There is the problem of passing the right parameters and returning the result.

At IBM there is Mike Fulton that worked on mvscmd, a c programs that could be called from unix shell to execute z/OS services. Recently, he removed his project from github

However, it seems that mvscmd has been incorporated into z open automation utilties listing an Python API as well
https://www.ibm.com/support/knowledgecenter/en/SSKFYE_1.0.0/welcome_zoautil.html

May be that’s worth checking out!

Any other ideas or experiences?

Cheers, M_Mueller

Hey @M_Mueller, Z Open Automation utilities are probably what you’re after, but I’m a little biased since I’m the developer for the python library it offers :wink:

Depending on what you’re trying to do, calling USS commands from Python could be a way to perform z/OS actions in Python. Alternatively, you can create Python functions with CPython, allowing you to use all of the functionality z/OS offers for C/C++