When you need information on the status of a Session in an ACL, you can use the function &SESS_INF(SessionID).
This function returns one of the following values:
ACTIVE APPL=appl Indicates that the session is currently active. The name of the VTAM-application is also returned.
ACL=program This indicates that the specified ACL/E program is running in the active session.
CURRENT Indicates that the session is the user's current session.
INACT Indicates that the session is not currently active, although it has been active during the user's current session with CA-TPX.
NEVACT Indicates that the session has never been active during the user's current session with CA-TPX.
UNDEFINED The specified session is not a valid session name.
Usage of these variables is normally in a SCAN-Statement where the value is compared against a string. Depending on the result, which is stored in a Condition Code, processing continues.
1. This piece of code checks if session CICSA is inactive. If this is the case, the condition code set by the SCAN is 'EQ'. Then the ACL branches to label START where session CICSA is started:
START COMMAND 'A CICSA'
2. Referencing e.g. &SESS_INF(TPXOPER) in an ACL named DISPLAY running in session TPXOPER will result in: ACTIVE CURRENT ACL=DISPLAY APPL=TPXOPER
3. Referencing e.g. &SESS_INF(TPXADMIN) in an ACL named DISPLAYrunning in session TPXOPER will result in: ACTIVE APPL=TPXADMIN if session TPXADMIN is active or either in INACT or NEVACT if not active.