The SQL Procedure |
See also: | column-modifier |
Featured in: | Creating a Table and Inserting Data into It |
column data-type <column-modifier <... column-modifier>> |
Arguments |
is a column name.
is described in column-modifier.
is one of the following data types:
indicates a character column with a column width of width. The default column width is eight characters.
indicates an integer column.
indicates a floating-point column with a column width of width and ndec decimal places.
indicates a floating-point column.
indicates a date column.
Details |
SAS supports many but not all of the data types that SQL-based databases support.
For all the numeric data types (INTEGER, SMALLINT, DECIMAL, NUMERIC, FLOAT, REAL, DOUBLE PRECISION, and DATE), the SQL procedure defaults to the SAS data type NUMERIC. The width and ndec arguments are ignored; PROC SQL creates all numeric columns with the maximum precision allowed by SAS. If you want to create numeric columns that use less storage space, then use the LENGTH statement in the DATA step. The various numeric data type names, along with the width and ndec arguments, are included for compatibility with other SQL software.
For the character data types (CHARACTER and VARCHAR), the SQL procedure defaults to the SAS data type CHARACTER. The width argument is honored.
The CHARACTER, INTEGER, and DECIMAL data types can be abbreviated to CHAR, INT, and DEC, respectively.
A column that is declared with DATE is a SAS numeric variable with a date informat or format. You can use any of the column-modifiers to set the appropriate attributes for the column that is being defined. See SAS Language Reference: Dictionary for more information on dates.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.