Print the current HLQ

With ZOAU, you can print the high-level qualifier (HLQ) of the active TSO environment in the following ways:

  • Issuing a shell command:

    • Option 1:
    hlq
    
    • Option 2:
    echo "  PROFILE" | mvscmdauth --pgm=IKJEFT01 --sysprint=* --systsprt=* --systsin=stdin | awk '/PREFIX/ { print $11; }'
    
  • Calling an API in Python programs:

    print(datasets.get_hlq())
    

Without ZOAU, to achieve the same purpose, you need to write the following JCL statements:

//*
//* Write high-level qualifier of current TSO user to SYSTSPRT
//* (console) as part of PREFIX, e.g. .... PREFIX(<hlq>) ...
//*
//HLQ      EXEC PGM=IKJEFT01
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD *
 PROFILE
/*