Chapter Contents |
Previous |
Next |
SAS SQL Query Window User's Guide |
The SQL
Query Window has
File
,
Tools
,
View
,
and
Profile
pull-down menus (PMENUs).
If your monitor supports the use of a mouse, you can also display the
most frequently used
Tools
and
View
items from the pop-up
menu. Press the right-most mouse button on UNIX, OS/2, and Windows, or the
option key and the mouse button on the Macintosh. Some items in a menu may
be "greyed out," which means that they cannot be selected until you have performed
some other action.
If three periods follow a menu item, another window will appear if you select the item. If an arrow (→) follows a menu item, another menu will appear if you select the item.
Only SQL Query Window-specific menu items are discussed here. For SAS menu items, see your SAS System documentation.
File PMENU |
Save Query
displays a menu
from which you can select these options:
Save as QUERY to include later
Save as SOURCE entry
Save as External file...
The query is stored on the local host even if you are connected to a
remote session through SAS/CONNECT software.
List/Include Saved Queries...
displays a list of
the queries that you have previously saved in the profile catalog with which
the Query Window was invoked. You can also display a list of queries that
were saved in other catalogs. If the Query Window was invoked without a profile,
the default profile catalog is SASUSER.PROFILE.
Create Table from Query Results...
enables you to
create a PROC SQL table, which is a SAS data file, and to save the results
of your query into it. If SAS/CONNECT software
is licensed at your site and you select this item when you are connected to
a remote session, you can choose to download the results of your query into
a local SAS data file, or create the table on the remote side.
Create View of Query
enables you to create a PROC SQL view that contains
the SQL syntax of your query. The PROC SQL view can be read by any SAS procedure
as if the view were a SAS data file. When you specify the view in a PROC
or DATA step, the query is processed and returns current data from the queried
table(s) to your report. If SAS/CONNECT software
is licensed at your site and you select this item when you are connected to
a remote session, the view will be created on the remote side.
View PMENU |
Columns...
enables you to:
Where Conditions for Subset...
enables you to use a Where expression
to read a subset of the data in a table or tables by specifying the conditions
that the selected data must meet.
Distinct
removes duplicate
rows from your query output.
Order By...
enables you to select
columns or column expressions to specify the order by which you want the output
sorted.
Group(s) for Summary Functions...
enables you to specify groups of
column values to which a function is to be applied.
Having Condition for Group...
enables you to build or modify a Having
expression. A Having expression specifies a condition (or conditions) for
each group that is included in the query. You specify the group in a Group
By clause. If no Group By clause is specified, the rows in a table or a subset
of the table are evaluated as one group.
Tables...
enables you to
select the table(s) from which you want to retrieve data. This is the first
step in the query-building process. If you have already started building your
query, use the
Tables...
item to:
Join Type...
enables you to use inner joins or outer joins to join
tables when you have selected two tables for the query.
Tools PMENU |
Run Query
displays a menu
from which you can select these options:
Run Immediate
Design a Report
Begin with default report...
Name a predefined report...
Use definition from last report
Design a Report
for your
current query.
Show Query
displays the PROC SQL syntax of your query. You can choose this item
at any time during the query-building process.
Preview Window...
displays your query in a PREVIEW window. You can
edit the query syntax in this window and save it to a file. Changes that you
make in the PREVIEW window are not carried over to the current query in the
SQL Query Window.
Switch Access Mode
enables you to specify whether you are going to query SAS data sets
(including SAS data files and SAS data views) or tables from a database management
system. You can change the access mode at any time during an SQL Query Window
session. Changing access modes resets the query and displays the tables that
are available for that access mode.
Depending upon your operating system and the SAS/ACCESS products that have been installed at your site, you can select one of the following access modes:
Switch to New Profile
resets the query and enables you to change to a profile that was previously
created and stored.
Reset
deletes your current
query from the Query Window and returns you to the Tables window to begin
a new query.
Report Options...
enables you to specify the beginning page number,
title, and subtitles for the report.
Profile PMENU |
Set Preferences...
enables
you to create a profile entry.
Show Current Preferences...
displays the preference
settings that are in effect for your current SQL Query Window session.
Update Preferences...
enables you
to update the preference settings for any SQL Query Window profile.
Pop-up Menu |
Many of the PMENU items can also be selected from the pop-up menu:
See Query Window Menus for the ways in which you can invoke the pop-up menu.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.