# z/OS: the ZOS_* variables, computed from MVS control blocks when read. # # ZOS_SYSNAME and ZOS_SYSPLEX come from the CVT and the ECVT, ZOS_ASID and # ZOS_JOBNAME from the running ASCB, and ZOS_RELEASE from __osname(). # sysvar(1) reports the first two independently. The address-space ID and # the job name belong to this process alone, so two commands can never agree # on them: their shape is checked instead. command -v sysvar >/dev/null 2>&1 || exit 77 for v in SYSNAME SYSPLEX; do eval "value=\$ZOS_$v" if [ "$value" = "$(sysvar "$v")" ]; then echo "$v agrees with sysvar" else echo "$v differs: '$value'" fi done if [ "${#ZOS_JOBNAME}" -ge 1 ] && [ "${#ZOS_JOBNAME}" -le 8 ]; then echo "jobname: 1 to 8 characters" else echo "jobname: '$ZOS_JOBNAME'" fi case $ZOS_RELEASE in [0-9][0-9].[0-9][0-9].[0-9][0-9]) echo "release: two digits per field" ;; *) echo "release: shape '$ZOS_RELEASE'" ;; esac case $ZOS_ASID in [0-9A-F][0-9A-F][0-9A-F][0-9A-F]) echo "asid: four hex digits" ;; *) echo "asid: shape '$ZOS_ASID'" ;; esac # They are read on demand, so they are not in the environment, and a # ZOS_SYSNAME handed in by a parent cannot outrank the one the shell # computes for itself. env | grep -q '^ZOS_' && echo "exported" || echo "not exported" if [ "$(ZOS_SYSNAME=WRONG "$TSH" -c 'echo "$ZOS_SYSNAME"')" = "$ZOS_SYSNAME" ]; then echo "inherited: ignored" else echo "inherited: kept" fi