Chapter Contents

Previous

Next
SAS SQL Query Window User's Guide

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, the Query window will inform you that the tables cannot be found.

[IMAGE]

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

[IMAGE]

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

If you want to run the query against different tables, select the library containing the tables from the list of Table Sources, then select the tables from the list of Available Tables. 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 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 for more information on creating and saving queries.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.