Using SAS Tables |
There are other SCL functions that you can use to perform operations on SAS tables. The tasks that you can perform, along with the function to use, are as follows:
To copy a table, use the COPY function. By default, if the target file already exists, the COPY function replaces that file without warning. To avoid unintentionally overwriting existing files, your program should use the EXIST function to determine whether the target file exists before executing the COPY function. (You can use COPY with a WHERE clause to create a new table that contains a subset of the rows in the original table.)
To create a new table, use the OPEN function with the N option. (The table must be closed and then reopened in UPDATE mode if the program will update it). Then, use NEWVAR to create columns.
To enable users to create a new table interactively, use the NEW function.
To enable users to create a new table interactively from an external file, use the IMPORT function or the IMPORT wizard.
To delete a table, use the DELETE function. (The table must be closed).
To rename a table, use the RENAME function. (The table must be closed.)
To sort a table, use the SORT function. (The table must be open in UPDATE mode.)
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.