To find out the current length of a variable, you can use the built-in function &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.
To find out the maximal possible length of a variable, you can use the built-in function &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.