Query and Reporting |
You can create a table from a query using the SQL Editor window or the Query window.
In all operating environments, you can create SAS tables and views. In z/OS, you can also create DB2 tables. In some cases you must be granted certain access or privileges to create new tables. If you do not have these privileges, contact your SAS Support Consultant or database administrator.
To create a table from your query results, run your query, then return to the Query window by selecting Close from the File menu. Follow the instructions in one of the following two sections, depending on which type of table you want to create.
Creating a New SAS Table or View |
Follow these steps to create a new SAS table or view from your query results:
Follow this selection path from the Query window:Tools Create Table SASThe Create SAS Table/View window appears.
In the Name field, type the name of the table or view. Use a two-level name in the form libref.table-name if you want to store the table or view permanently.
Select Table or View. Table creates a SAS data file; View creates a PROC SQL view.
When you select OK, the query is processed and a window verifies the SAS table's creation, as shown in the following display.
SAS Table/View Creation Status Window
Select View to display the new SAS table, or select Goback to return to the Query window.
Creating a New DB2 Table (z/OS Only) |
In z/OS, to save the results of your query to a DB2 table, do the following:
Follow this selection path from the Query window:Tools Create Table DB2The Create DB2 Table window appears.
Select OK SAS/ASSIST software verifies whether or not the table exists; if it does, you are prompted to append or replace it. The new table is created, and its authorization ID is automatically set to your userid.
Note: If you plan to use DB2 data in several SAS programs, you usually get better SAS performance if you save the DB2 data to a SAS table or SAS view.
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.