Setting Up the Environment

Query Window Sample Data Library

To practice with the examples in this chapter, you will need to use the sample data library that is provided with the SQL Query Window.
Submit the following statement in the Program Editor to assign the SAMPLE libref to the sample library:
libname
sample 'sample library';
Consult your on-site SAS support personnel for the location of the sample library. Some of the examples require that you save files to the sample library. If you do not have write access to the sample library, you can save the files to another library of your choice, such as the SASUSER library.

Invoking the Query Window

For these examples, invoke the SQL Query Window by selecting Toolsthen selectQuery or by entering query in the command window or at the Command ===> prompt.
The SQL QUERY TABLES window appears. By default, the SASUSER libref is selected and the tables from that libref appear in the Available Tables list.

Changing Your Profile

In order to include the tables that are in the sample library in the Available Tables list, you must set your SQL Query Window profile to include the tables in the SAMPLE library. Select Profilethen selectSet Preferences.
Preference Settings for Profile window
Select the right arrow next to Data Restrictions to display the Data Restrictions for Profile window.
Data Restrictions for Profile window
Select SAMPLE from the Table Source list. Select Add entire Table Source to preferences from the pop-up menu that appears.
Data Restrictions for Profile window with pop-up menu
Select WORK from the Table Source list. Select Add entire Table Source to preferences from the pop-up menu.
Note: If you do not have write access to the SAMPLE library, then repeat the previous step for the SASUSER library.
Select OK to return to the Preference Settings for Profile window.
Select Save to save your new profile setting.
Name Catalog entry for Profile window
Type SAMPLE in the Entry Name field of the Name Catalog Entry for Profile window. Select OK.
Select Close in the Preference Settings for Profile window.
From the SQL QUERY TABLES window, select Toolsthen selectSwitch to New Profile.
Select the right arrow next to the Profile Name field to display a list of profiles.
List of profiles
In the Preference Profiles in Catalog window, select SASUSER from the Libraries list. Next, select PROFILE from the Catalogs list, and then select SAMPLE from the Profiles list. Select OK.
Select OK to return to the SQL QUERY TABLES window and to complete the switch to the new profile. The new profile displays only the tables that are in the sample library.
See Setting Your Profile for more information about the SQL Query Window user profile.