Adds a column to a new SAS table
- contains the return code for the operation:
- is the identifier that was assigned when
the table was opened. If table-id is invalid,
the program halts. The SAS table must be opened with an open mode of NEW.
- is the name to assign to the new column.
The name must be a valid SAS name.
- specifies the data type of the new column:
- is the length of the new column. For a
character column, this value can be between 1 and 32,767. For a numeric column,
it can be between 3 and 8. On some systems, the minimum length can be 2.
- is the label for the new column. This is
a character string from 1 to 40 characters. If the label contains single
quotes, use two single quotes for each of these internal single quotes, or
surround the label with double quotes. Each set of two single quotes counts
as one character.
- is the format for the new column. This
must be a valid SAS format name. Formats can be either defined by the user
or supplied by SAS software. If not specified, SAS assigns a default format.
If type is
then a character format should be specified. Otherwise, a numeric format should
- is the informat for the new column. This
must be a valid SAS informat name. Informats can be either defined by the
user or supplied by SAS software. If not specified, SAS assigns a default
informat. If type is
then a character informat should be specified. Otherwise, a numeric informat
should be specified.
- The table must be opened in NEW
mode, or SCL halts the program.
existing SAS table in NEW mode creates a new table that overwrites the old
table. When the table is closed after using NEWVAR, the SAS table is created
with zero rows. If the column name matches a column name that was defined
for the table by a previous NEWVAR function, the new definition overrides
the previous definition.
Open a new SAS table, MYDATA, in NEW mode, and then
add the column AGE, which is numeric, and NAME, which is character. AGE has
a length of 8, and NAME has a length of 20. The label of NAME is set to
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.