COLUMNS= Data Set Option

specifies the variable names and types for a CSV file.

Alias: COLS=
Applies to: Reading CSV files

Syntax

COLUMNS=(column-specification < ...column-specification>);

Required Argument

column-specification

is a name-value pair that specifies the column name and data type. For numeric data, specify double as the data type. For character data, specify 'char(length)'.

Default Any variables that are not named are assigned the name VARn.
Example
columns=(station='char(4)' obsdate='char(18)' tempf=double precip=double)

Details

Numeric variables use eight bytes. For character variables, if the byte length is not specified, then the default action is to use eight bytes. If the variable in the CSV file uses fewer bytes than the specified length, then the variable is padded with spaces up to the specified length. If the variable in the CSV file uses more bytes than the specified length, then the variable is truncated to the specified length.
If the variable name is not specified, then the variable is named automatically. Automatically named variables are named VARn, starting at 1. If the data type is not specified and cannot be determined, the variable is assigned as char(8).
Tip
Do not use a comma between each column specification. Enclose 'char(n)' in quotation marks.