OPS code calling Unix Python does not pull environment variables correctly
search cancel

OPS code calling Unix Python does not pull environment variables correctly

book

Article ID: 277488

calendar_today

Updated On:

Products

OPS/MVS Event Management & Automation

Issue/Introduction

The os.getenv function called from a Python program running using ADDRESS USS USSCMD is returning "None" instead of the contents of the z/OS system symbol.

Environment

OPS USS 

Cause

The z/OS system symbols are not directly available to be retrieved by the Python program using the os.getenv function. This function can only be used to retrieve USS environmental variables.

Resolution

This type of variable must be set in the STDENV file pointed by the OPSUSS JCL or in the script that calls the Python program:

export SYSNAME=$(sysvar SYSNAME)