col Function (GPL)
Syntax
col(source(<source name>), name("variable name"), <type>, <function>)
<source name>. A data source previously defined by
a SOURCE
statement.
"variable name". The name of the variable in the data source.
<type>. A data type or measurement level. If no type is specified, the variable is assumed to be continuous.
<function>. One or more valid functions. These are optional.
Description
Extracts a column of data from a data source. This is used for creating variables from the data.
Examples
DATA: age = col(source(mydata), name("age"))
DATA: gender = col(source(mydata), name("gender"), unit.category())
DATA: date = col(source(mydata), name("date"), unit.time(), format("M/d/yyyy"))
Valid Types
unit.category. Specifies a categorical variable.
unit.time. Specifies a date variable. You will often need
to specify the date format if using this type. Note:
In IBM® SPSS® Statistics,
dates from a userSource
are passed to GPL as numeric
values and are specified as continuous variables. Therefore, you should
not use this type with a userSource
.See the
topic format Function (GPL) for more information.