How to get information about TPX variables like type, length etc. from within an ACL program?
search cancel

How to get information about TPX variables like type, length etc. from within an ACL program?

book

Article ID: 9395

calendar_today

Updated On:

Products

Teleview TELEVIEW- PACKAGE TPX - Session Management Vman Session Management for z/OS

Issue/Introduction

Sometimes you need information about a variable beside the content of that variable. You want to know the length of the data inside the variable or the Data Type. There are some functions in ACL/E which were created for that purpose.



Environment

Release: NVINAM00200-5.2-TPX-Session Management-Access Management package
Component:

Resolution

To get information about variables you can use three predefined function variables:

&MSIZE_OF(...)

Example:

    VDEFINE    VAR,8
    SET        VAR,'HELLO'
    SET        M,&MSIZE_OF(&VAR)

Variable &M will contain 8, the maximum possible length of variable &VAR, as defined in the VDEFINE statement.

&SIZE_OF(...)

Example:

    VDEFINE    VAR,10
    SET        VAR,'HELLO'
    SET        S,&SIZE_OF(&VAR)

Variable &S will contain 5, the length of the value currently kept in variable &VAR

&TYPE_OF(...)

Note: The variable name must be entered without '&'.

Possible values are:

ARRAY             Indicates that this is an array variable
BIN               Indicates that this is a binary variable.
CHAR              Indicates that this is a character variable.
UPCHAR            Indicates that this is an uppercase character variable.
HEX               Indicates that this is a hexadecimal variable.
NOTRUNC           Indicates that the variable will not be stripped of trailing blanks when substitution takes place.
NUM               Indicates that this is a numeric variable.
UNDEFINED         Indicates that this variable is not defined.
This value can be attached to the ones above:
ACL               Indicates that the variable was defined in ACL/E

Example:

    VDEFINE    VAR,8,TYPE=CHAR
    SET        VAR,'HELLO'
    SET        T,&SIZE_OF(VAR)  <--- without '&' 

Variable &T will contain string 'CHAR ACL'.