Skip to content

Instantly share code, notes, and snippets.

@dkelosky
Last active September 15, 2023 14:06
Show Gist options
  • Save dkelosky/b45af05b7fa244ccc2f228ad92d7e8f1 to your computer and use it in GitHub Desktop.
Save dkelosky/b45af05b7fa244ccc2f228ad92d7e8f1 to your computer and use it in GitHub Desktop.
Call python and pass variables
/* REXX */
/* obtain system info from OPS */
sysname = OPSINFO("SYSNAME")
opsversion = OPSINFO("VERSION")
oslevel = OPSINFO("MVSVERSION")
osfnum = ""
rc = opsprm("show", "osfmin")
do while queued() > 0
pull data
osfnum = data
end
/* run python script */
cmd = "python3 /tmp/script.py"
/* echo output */
address uss
"USSCMD COMMAND('"cmd sysname opsversion oslevel osfnum"') STEM(RESPONSE)"
if RESPONSE.0 > 0 then do
do i = 1 to RESPONSE.0
say " " RESPONSE.i
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment