Created
March 22, 2022 14:52
-
-
Save plavjanik/eead256404c161cd7f45f385231543b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess | |
| import json | |
| def zowe(arguments): | |
| zowe_command = "zowe " + arguments + " --rfj" | |
| try: | |
| completed_process = subprocess.run(zowe_command, shell=True, capture_output=True, check=True, encoding="utf8") | |
| parsed_output = json.loads(completed_process.stdout) | |
| return parsed_output.get("data", parsed_output) | |
| jobs = zowe('zos-jobs list jobs') | |
| for job in jobs: | |
| if job['status'] == 'OUTPUT': | |
| print(f"Job {job['jobname']}({job['jobid']}) has return code {job['retcode']}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment