The VARTYPE() function returns a value indicating the data type associated with a variable.
QM stores data internally in a type variant manner. The actual data type associated with a variable may change as new data is stored. The VARTYPE() function allows a program to determine the internal data type being used. It returns one of the following values. The symbolic names shown are defined in the SYSCOM KEYS.H include record.
IF VARTYPE(FVAR) = VT$FILE.REF THEN
This program fragment tests whether FVAR references an open file and, if so, closes the file. The same effect could have been achieved using the FL$OPEN mode of the FILEINFO() function.