Chapter Contents |
Previous |
Next |
NEW |
Category: | SAS Table |
Syntax | |
Details | |
Examples | |
Example 1: Creating a SAS Table from a Model Table | |
Example 2: Creating a SAS Table from a User Definition | |
See Also |
Syntax |
CALL NEW(table-name,model-table,num-row, display-window); |
('')
is specified
for table-name, then the DATAn naming convention is used to create a table in the USER library.
Type: Character
''
)
as a placeholder if you do not want to specify a model table.
Type: Character
'0'
, then the value is a negative
number. All columns in all rows initially contain missing values. The value
for num-row cannot be a missing value.
Type: Character
'Y' |
displays the NEW window to allow editing of the column names and attributes before the new SAS table is created. (This is the default.) |
'N' |
does not display the NEW window. The column definitions in the new SAS table will be an exact replica of those in the model table. A value must also be supplied for model-table. |
Type: Character
Details |
NEW creates a new blank SAS table. However, it does not replace an existing table.
By default, the routine opens the NEW window to enable a user to interactively define the names and attributes of the columns in the new SAS table. The NEW window that this routine opens is the same as the window that is displayed when the NEW= option is used with the PROC FSEDIT or PROC FSVIEW statement.
You can specify model-table so that all the names and attributes of the model are automatically copied to the new table. (Only the column names and column attributes of the model table are copied, not the values that it contains.) When you specify a model table, you can use display-window to bypass the NEW window and create the new table with the same column names and attributes as the model table. Open the NEW window only if you want to enable users to alter the column names and attributes before the new table is created.
Use num-row to specify how many blank rows to create for the new SAS table. All columns in all rows of the new table initially contain missing values.
Examples |
Create a new SAS table with a name that the user supplies in the field for the window variable TABLE. Before attempting to create the table, determine whether a SAS table with the specified name already exists. If so, issue a message on the application window's message line. The new table is modeled after the existing table MODEL.A, and the user is not given the opportunity to modify the column definitions (the NEW window is not opened). The new table is created with ten blank rows.
if (exist(table)) then _msg_='SAS table '||table||' already exists.'; else do; call new(table,'model.a',10,'n'); _msg_='SAS table '||table||' has been created.'; end;
Create a new SAS table with a name that the user supplies in the field for the window variable TABLE. These statements display the NEW window for the user to define the columns in the table. No model table is used.
if (exist(table)) then _msg_='SAS table '||table||' already exists.'; else do; call new(table,' ',1,'y'); _msg_='SAS table '||table||' has been created.'; end;
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.