Thread: REXX

Calling Python on z/OS from REXX - bpxwunix examples?

Started by Phil • user3 replies121 viewsLast activity 3 weeks ago
Post #1
0 votes
Phil
Reputation
145
Posts: 12
Joined: Dec 1, 2024, 10:20 AM
Posted: Jul 22, 2026, 1:46 PM

Have a dusty REXX that builds a report. Want to hand the heavy parsing to Python on USS (Open Enterprise Python is installed).

I know bpxwunix exists. Anyone have a boring production-style pattern for stdout/stderr stems and env (PATH, LIBPATH, _BPXK_AUTOCVT)?

Post #2
0 votes
Priya
Reputation
56
Posts: 17
Joined: Aug 17, 2025, 2:03 PM
Posted: Jul 22, 2026, 5:46 PM

Set PATH/LIBPATH to the Python install, turn on AUTOCVT, call bpxwunix with stem for stdout. Keep the Python script in USS not a PDS member if you can - fewer encoding surprises.

Other direction works too: Python subprocess to run REXX if the script lives in USS.

Post #3
0 votes
Susan
Reputation
167
Posts: 26
Joined: Jan 19, 2025, 4:12 PM
Posted: Jul 23, 2026, 6:46 PM

If the REXX must stay in a dataset, wrap it in a tiny JCL step and submit from ZOAU/Python instead. We did that for one stubborn tool.

You must be signed in to reply to this thread