Syntax Supported by the IML Procedure and the iml Action
TABLEGETVARFORMAT Function
TABLEGETVARFORMAT (table <, cols>) ;
This function is supported by the IML procedure and the iml action.
The TableGetVarFormat function returns a row vector that contains the formats of the specified columns. Blank strings are returned for columns that do not have formats.
The function takes the following input arguments:
- table
specifies an existing table.
- cols
specifies the columns of the table. The cols argument can be a numeric vector of column numbers (such as {2 4 7}) or a character vector of names (such as {"X" "Y"}). If this argument is omitted, the formats for all columns are returned.
The following statements create a table from the Sashelp.Cars data. The TableGetVarFormat function retrieves the formats for four columns, and the names are shown in Figure 412. A blank space is displayed for each variable that does not have a format.
tbl = TableCreateFromDataSet("Sashelp", "Cars");
colNames = {"MSRP" "Invoice" "EngineSize" "Weight"};
formats = TableGetVarFormat(tbl, colNames);
print formats[colname=colNames];
Figure 412: Column Formats
| formats | |||
|---|---|---|---|
| MSRP | Invoice | EngineSize | Weight |
| DOLLAR8. | DOLLAR8. | ||