CA TPX Session Management for z/OS

Tuesday Tip: Do you know how to get the type of a variable in an ACL program?

  • 1.  Tuesday Tip: Do you know how to get the type of a variable in an ACL program?

    Posted 08-29-2014 09:53 AM

    Sometimes you might need to know the type of a variable, for example when someone enters a string in a field and the ACL need to check for that type of string before continuing processing.

    To find out the current length of a variable, you can use the built-in function &TYPE_OF(...):

     

    Example:

        VDEFINE    VAR,8,TYPE=CHAR

        SET        VAR,'HELLO'
        SET        T,&SIZE_OF(VAR)      <-- without '&'!!

     

    Variable &T will contain 'CHAR ALL', the length of the value currently kept in variable &VAR.

     

    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