Chapter 2: Examples


Setting up the Environment

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 site's SAS Support Consultant 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
Tools Query
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
Profile Set Preferences

Select the right arrow next to Data Restrictions to display the Data Restrictions for Profile window.

click to expand

Select SAMPLE from the Table Source list. Select Add entire Table Source to preferences from the pop-up menu that appears.

click to expand

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.

click to expand

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
Tools Switch to New Profile

Select the right arrow next to the Profile Name field to display a list of profiles.

click to expand

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" on page 73 for more information about the SQL Query Window user profile.




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