Including Saved Queries


When you save a query, references in the query to tables are saved as two-level names ( libref.filename). If you try to include a saved query that specifies a libref that is not currently assigned, or tables that have been moved or deleted, then the SQL Query Window will inform you that the tables cannot be found.

click to expand

If the tables are available in another library, or if you want to run the query against different tables, then select Yes . The Include Query Tablename Edit window appears (probably with different names than in this example).

click to expand

If the tables exist in another library, then select that library from the Table Sources list, and then select the tables from the Available Tables list.

If you want to run the query against different tables, then select the library that contains the tables from the Table Sources list, then select the tables from the Available Tables list. The tables must have identical structures to the tables on which the query was built.

This feature enables you to create a query that can be used on any identically structured table. For example, you could create a query on a table containing March sales data, and then use that query on a table containing April sales data. Remember that, to be prompted for a new table for the query, the original table on which the query was created must not be available in the SQL Query Window session. By moving the March table from, for example, the CUR_MON (Current Month) library, and moving the April table into the CUR_MON library, you would be prompted to supply the table for the query.

See "Saving Queries" on page 32 for more information about creating and saving queries.




SAS 9.1 SQL Query Window. Users Guide
SAS 9.1 SQL Query Window: Users Guide
ISBN: 1590472098
EAN: 2147483647
Year: 2004
Pages: 54
Authors: SAS Institute

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net