The Data Table

Using the Query Window

You can use the Query window to reduce the number of variables that you load into the data table. You can also use the Query window to bring more than one data set into the data table, as well as write SQL queries to filter the data.

Opening a New Query

You can use the Query window to bring selected columns of data from one or more SAS data sets into the data table. The Query window opens a view of the data set that cannot be edited. You can, however, save the view as a SAS data set that you can edit. To save the view as a SAS data set, select File arrow Save As By SAS Name ...

SQL QUERY TABLES Window

Figure 2.4: SQL QUERY TABLES Window

Select File arrow Open With New Query ... to open the SQL QUERY TABLES window. Select one or more tables to use in your query and click on the right arrow.

Click OK to display the SQL QUERY COLUMNS window. Select the columns that you want to include in the query and click on the right arrow.

SQL QUERY COLUMNS Window

Figure 2.5: SQL QUERY COLUMNS Window

Select File arrow Close to exit the Query window and open the data view into the Analyst data table.

The query is added as a node to your project tree, and the selected columns are brought into the data table. The name of the query node is generated by Analyst in the form QUERYnnnn.

Caution: If you select the Analyst window while in the Query window, the resulting query is not returned to Analyst.

Saving and Opening an Existing Query

Once you have used the Query window to create views of SAS data, you can bring these views into Analyst.

To create a query to use later, prepare your query in the Query window, and select File arrow Save Query arrow Save as QUERY to Include later in the SQL QUERY COLUMNS window. Select the SAS library, catalog, and library member name.

To open a saved query in Analyst, select File arrow Open With Existing Query ... The Open with Existing Query window searches for saved queries in all available SAS libraries.

Open with Existing Query Window

Figure 2.6: Open with Existing Query Window

You can also use the Query window to apply an SQL query to your data. Refer to the Query window documentation for more information.

Previous | Next | Top of Page