Language Reference
TABLEISEXISTINGVAR Function
TABLEISEXISTINGVAR (table, colnames) ;
This function is supported by the IML procedure and the iml action.
The TableIsExistingVar function returns a binary row vector that indicates whether the specified column names exist in a table. The return value is 1 for each variable that exists and 0 for each variable that does not exist.
The function takes the following input arguments:
- table
specifies an existing table.
- colnames
specifies a character vector of names (such as {"X" "Y"}).
The following statements indicate whether the specified column names are in the table. Figure 462 shows that the table contains columns that are named Sex and Height. Figure 462 displays a 1 for the Sex and Height variables and 0 for the variables that do not exist.
tbl = TableCreateFromDataSet("Sashelp", "Class");
colNames = {"Sex" "ABC" "Height" "X"};
isVar = TableIsExistingVar(tbl, colNames);
print isVar[colname=colNames];
Figure 462: Indicator Variable for Column Names
| isVar | |||
|---|---|---|---|
| Sex | ABC | Height | X |
| 1 | 0 | 1 | 0 |