Performing Interactive SQL Queries: Course Notes
Performing Interactive SQL Queries: Course Notes
Instructor-based Training
Performing Interactive
SQL Queries
Course Notes
The SAS System is an integrated system of software providing complete control over data access,
management, analysis, and presentation. Base SAS software is the foundation of the SAS System.
Products within the SAS System include SAS/ACCESS , SAS/AF , SAS/ASSIST , SAS/CALC ,
SAS/CONNECT , SAS/CPE , SAS/DMI , SAS/EIS , SAS/ENGLISH , SAS/ETS , SAS/FSP ,
SAS/GRAPH , SAS/IMAGE , SAS/IML , SAS/IMS-DL/I , SAS/INSIGHT , SAS/LAB ,
SAS/NVISION , SAS/OR , SAS/PH-Clinical , SAS/QC , SAS/REPLAY-CICS , SAS/SESSION ,
SAS/SHARE , SAS/SPECTRAVIEW , SAS/STAT , SAS/TOOLKIT , SAS/TRADER ,
SAS/TUTOR , SAS/BUDGET , SAS/DB2 , SAS/FINANCE , SAS/GEO , SAS/GIS ,
SAS/PH-Kinetics , SAS/SHARE*NET , and SAS/SQL-DS software. Other SAS Institute products are
SYSTEM 2000 Data Management Software, with basic SYSTEM 2000, CREATE , Multi-User , QueX ,
Screen Writer , and CICS interface software; InfoTap software; NeoVisuals software; JMP , JMP IN ,
and JMP Serve software; SAS/RTERM software; the SAS/C Compiler and the SAS/CX Compiler;
Video Reality software; VisualSpace software; and Emulus software. MultiVendor Architecture and
MVA are trademarks of SAS Institute Inc. SAS Institute also offers SAS Consulting , SAS Video
Productions , Ambassador Select , and On-Site Ambassador services. Authorline , Books by UsersSM,
the Encore Series , JMPer Cable , Observations , SAS Communications , SAS Training , SAS Views ,
the SASware Ballot , and SelecText documentation are published by SAS Institute Inc. The SAS Video
Productions logo and the Books By Users SAS Institute’s Author Service logo are registered service marks
and the Helplus logo, the SelecText logo, the SAS Online Samples logo, the Video Reality logo, the Quality
Partner logo, and The Encore Series logo are trademarks of SAS Institute Inc. All trademarks above are
registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA
registration.
The Institute is a private company devoted to the support and further development of its software and related
services.
Other brand and product names are registered trademarks or trademarks of their respective companies.
Copyright 1995 by SAS Institute Inc., Cary, NC 27513, USA. All rights reserved. Printed in the United
States of America. No part of this publication may be reproduced, stored in a retrieval system, or
transmitted, in any form or by any means, electronic, mechanical, photocopying, or otherwise, without the
prior written permission of the publisher, SAS Institute Inc.
ISBN 1-55544-593-4
120495
Table of Contents
Course Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
General Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Course Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
iv Table of Contents
120495
120495
For Your Information v
Course Description
Performing Interactive SQL Queries Course Notes teaches you how to use the SQL Query
window to perform ad hoc queries interactively, join data sets, and create SQL views. The
course contains workshop exercises and is designed to be taught in approximately four
hours. It is not offered publicly; it is available for on-site presentation only.
vi For Your Information
120495
Prerequisites
Before selecting this course, you should
General Conventions
This section explains the various conventions used in presenting text, SAS language
syntax, and examples in this book.
Typographical Conventions
You will see several type styles in this book. This list explains the meaning of each style:
roman is the standard type style used for most text in this book.
UPPERCASE ROMAN is used for SAS statements, variable names, and other SAS
language elements when they appear in the text.
box indicates push buttons and other items that you select.
Mouse Conventions
The number of buttons on mouse devices varies. On mouse devices with two or three
buttons, one button makes selections and one displays pop-up menus. Because the
locations of these buttons vary, this book references them as the mouse select button or the
mouse menu button. If you use a mouse device, you can determine which button executes
which action by trying them.
menu button
select button
120495
General Conventions
Syntax Conventions
The general forms of SAS statements and commands shown in this book include only that
part of the syntax actually taught in the course. For complete syntax, see the appropriate
SAS reference guide.
PROC and CHART are in uppercase bold because they are SAS keywords.
DATA= is in uppercase to indicate that it must be spelled as shown.
SAS-data-set is in italic because it represents a value that you supply. In this case, the
value must be the name of a SAS data set.
HBAR and VBAR are in uppercase bold because they are SAS keywords. They are
separated by a vertical bar to indicate they are mutually exclusive; you can choose one
or the other.
chart-variables is in italic because it represents a value or values that you supply.
</ options> represents optional syntax specific to the HBAR and VBAR statements.
The angle brackets enclose the slash as well as options because if no options are
specified you do not include the slash.
RUN is in uppercase bold because it is a SAS keyword.
120495
For Your Information ix
Course Objectives
After completing this course, you should be able to
join tables
120495
120495
Chapter 1
120495
120495
Getting Started 3
120495
Introduction
The SQL Query window is an easy-to-use point-and-click interface to query data and
produce reports. You can access data from native SAS data sets and some database
management systems, and create SAS data sets for future use.
SAS/ASSIST software
the QUERY command
the EXECCMD routine in Screen Control Language.
Benefits
The SQL Query window is easy to use because you can query data without writing code or
learning code syntax. The SQL Query window enables you to
120495
Accessing the SQL Query Window
You can access the SQL Query window from the Report Writing Menu or Data
Management Menu in SAS/ASSIST software.
Select REPORT WRITING to access the Report Writing Menu from the Primary Menu in
SAS/ASSIST.
120495
Accessing the SQL Query Window
Assign a libref to point SAS to the location of your data. Select Setup to access the
Setup Selections window.
120495
Accessing the SQL Query Window
Type company in the Libref: field and . in the Name of the SAS data library:
field to indicate the directory from which SAS is invoked.
120495
Selecting a Table
By default, only the tables in the SASUSER library are displayed in the Available Tables
list box. To display tables stored in other libraries, select the appropriate libref from the
Table Sources list box.
Selecting a Table
Example: Create a query that selects the columns IDNUM, JOBCODE, SEX, and
SALARY from the data set COMPANY.PAYROLL and displays the data
in a report.
After selecting COMPANY from the Table Sources list box, all of the tables stored in the
COMPANY SAS data library appear in the Available Tables list box.
14 Chapter 1 SQL Query Window
120495
Selecting a Table
To move COMPANY.PAYROLL from the Available Tables list box to the Selected
Tables list box, select
COMPANY.PAYROLL
or double-click on COMPANY.PAYROLL.
Selecting a Table
Selecting Columns
The SQL QUERY COLUMNS window displays all of the columns available for the
selected tables.
<,COUNT(*) > is a summary function that counts the number of rows returned by
a query.
120495
Selecting Columns
To move IDNUM, JOBCODE, SEX, and SALARY to the Selected Columns list box,
select
Selecting Columns
The order in which the columns are selected determines their order in the report. To
change the column order once the columns are in the Selected Columns list, select the
desired column and then select Move Before or Move After .
120495
Building a Simple Query 17
Selecting Columns
Click on the mouse menu button anywhere in the SQL QUERY COLUMNS window to
display a list of actions.
120495
Selecting Columns
Another pop-up menu appears.
Selecting Design a Report from the pop-up menu extracts the selected data and
branches to the REPORT procedure, which offers more advanced report writing
capabilities.
120495
Building a Simple Query 19
Selecting Columns
The report is displayed in the OUTPUT window.
Output Report
20 Chapter 1 SQL Query Window
120495
Selecting Columns
Select File End to return to the SQL QUERY COLUMNS window.
Building a Column
Example: Select the columns IDNUM , JOBCODE , SEX , and SALARY from the
COMPANY.PAYROLL table. Label the SALARY column as Annual
Salary. Compute the monthly salary by dividing the SALARY column
by 12. Name the computed column MSALARY and format the column with
the DOLLAR12. format.
Labeling a Column
22 Chapter 1 SQL Query Window
120495
Building a Column
Type Annual Salary in the Label: field. Select OK to close the window.
Specifying a Label
120495
Building a Simple Query 23
Building a Column
Select Build a Column to create the monthly salary column.
120495
Building a Column
Select SALARY to begin the expression.
Building a Column
A list of operators appears.
Selecting an Operator
120495
Building a Column
Select <CONSTANT enter value> to divide salary by 12.
Select OK .
120495
Building a Simple Query 27
Building a Column
Select Column Attributes from the BUILD A COLUMN EXPRESSION window to
assign an alias, label, and format.
120495
Building a Column
Type
Building a Column
Select
dollar OK OK OK
Choosing a Format
120495
Building a Column
Select Run Query Run Immediate from the pop-up menu to create the report.
Building a Column
The report is displayed in the OUTPUT window.
120495
Formatting a Column
To add a format to the salary column,
1. select SALARY from the Selected Columns list box
2. select Column Formats
3. type DOLLAR7. in the Format= field
4. select OK .
Specifying a Format
Use the horizontal scroll bar in the Selected Columns list box to see the FORMAT=
option.
120495
Building a Simple Query 33
Subsetting Data
Example: Display only flight attendants (job codes FA1, FA2, and FA3) and mechanics
(job codes ME1, ME2, and ME3) who make less than $50,000 annually.
Selecting an Action
120495
Subsetting Data
Select SALARY from the Available Columns list box to start building the expression
SALARY LT 50000.
Subsetting Data
A list of operators automatically appears.
Selecting an Operator
120495
Subsetting Data
To specify the constant value of 50000,
Subsetting Data
Subset the data for flight attendants and mechanics.
The AND operator is chosen because both expressions must be true to include the row in
the report.
Selecting an Operator
38 Chapter 1 SQL Query Window
120495
Subsetting Data
To build the JOBCODE IN (’FA1’ ’FA2’ ’FA3’ ’ME1’ ’ME2’ ’ME3’) expression, select
Subsetting Data
The WHERE expression is now complete.
120495
Subsetting Data
Select Run Query Run Immediate from the pop-up menu.
Subsetted Report
Selecting an Action
Select Order By . . . from the pop-up menu to display the report in sorted order by
JOBCODE.
You can order the report from the pull-down menu by selecting
Locals Order By . . . .
42 Chapter 1 SQL Query Window
120495
Ordering the Report
To order the report by JOBCODE, select
To change the sort order to descending, select the column in the Selected Columns
list box, then select Descending Order .
44 Chapter 1 SQL Query Window
120495
Ordering the Report
From the pop-up menu, select Run query Run Immediate to execute the query.
The ordered report is displayed.
Exercises
1.1 Accessing Your Data
Invoke the SQL Query window and assign the libref COMPANY to the workshop
SAS data library.
Run a query that displays all columns and rows in the COMPANY.STAFF table.
120495
1.3 Summarizing and Joining Tables
Objectives
After completing this section, you should be able to
join tables
Summary Reports
Example: Create a report that displays the average and maximum salary for flight
attendants and mechanics.
To remove IDNUM, SEX, SALARY, and MSALARY from the Selected Columns list
box, select
Removing Columns
120495
Summary Reports
To calculate the maximum and average salary select,
Selecting Columns
120495
Summarizing and Joining Tables 49
Summary Reports
Select the first SALARY from the Selected Columns list. Then select
Summary Functions AVG to request the average be generated for the first SALARY
column.
Select the second SALARY from the Selected Columns list. Then select
Summary Functions MAX to request the maximum be generated for the second
SALARY column.
120495
Summary Reports
Select Run Query Run Immediate .
A window opens requesting information on how the summary functions AVG and MAX
are to be interpreted in the query.
Select AUTOGROUP because JOBCODE is the only column that is not used in a summary
function and summaries for each JOBCODE are requested.
120495
Summarizing and Joining Tables 51
Summary Reports
Select Yes to retain the GROUP BY criterion after the query is run.
120495
Summary Reports
The summary report is displayed in the OUTPUT window.
Grouped Report
You can eliminate the date and page number from the report by turning off the DATE and
NUMBER SAS system options. To access SAS system options, select Globals from
the menu bar. Then select Global options SAS options from the pull-down
menus.
120495
Setting SAS Options
A filled box beside the option indicates the option is currently in effect. To toggle the
option on or off, select the option. Select DATE to turn the DATE option off. Select
NUMBER to turn the NUMBER option off.
Close the OPTIONS window by selecting Edit End from the menu bar or pop-up
menu.
Options changed here are global and affect all other output generated in your SAS
session.
120495
Summarizing and Joining Tables 55
Specifying Titles
To specify titles for the report, select
Specifying Titles
120495
Specifying Titles
Type
Specifying Titles
Select
1. Edit End from the menu bar or pop-up menu to close the TITLES window
2. Run Query Run Immediate to create the report.
120495
Summarizing and Joining Tables 57
Specifying Titles
The report is displayed in the OUTPUT window.
Final Report
120495
Resetting the QUERY Window
Example: Reset the QUERY window to begin a new query.
When resetting the query, any SAS system or global option (such as titles or dates)
remains in effect.
60 Chapter 1 SQL Query Window
120495
Joining Tables
Example: Create a report that contains the columns IDNUM, FNAME, LNAME,
JOBCODE, and SALARY for flight attendants and pilots. Prompt the user
whether to run the report for males or females.
When several columns from different tables need to be placed side by side in a report, an
SQL join can be used. The data needed for this example can be found in
COMPANY.STAFF and COMPANY.PAYROLL.
Joining Tables
Select
120495
Joining Tables
All the columns available from each table are listed in the Available Columns list box.
Column Listing
120495
Summarizing and Joining Tables 63
Joining Tables
Select
1. IDNUM , FNAME , LNAME , JOBCODE , and SALARY from the Available Columns list
box
2. to move the columns to the Selected Columns list box.
Selecting Columns
64 Chapter 1 SQL Query Window
120495
Joining Tables
Select Run Query Run Immediate to execute the query.
Joining Tables
A window is displayed warning that joining tables without a WHERE clause can produce a
large amount of data. Typically, when two or more tables are joined, the tables will
contain a common column or key to ensure that the corresponding data from both tables
are matched correctly. In this example the column IDNUM is used as the key.
66 Chapter 1 SQL Query Window
120495
Joining Tables
If the WHERE clause is omitted, all combinations of rows from all tables are matched.
For example, if tables ONE and TWO listed below are joined without a WHERE clause,
the result is a Cartesian product (all possible combinations of rows).
X A Y B X A Y B
1 a 2 x 2 b 2 x
1 a 3 y
1 a 5 v
2 b 2 x
2 b 3 y
2 b 5 v
4 d 2 x
4 d 3 y
4 d 5 v
Joining Tables
The IDNUM column appears in both COMPANY.STAFF and COMPANY.PAYROLL
and can be used to join the two tables. To build the appropriate WHERE clause, select
1. PAYROLL.IDNUM EQ STAFF.IDNUM
2. Operators AND
3. PAYROLL.JOBCODE IN LOOKUP distinct values FA1 , FA2 , FA3 ,
PT1 , PT2 , and PT3 OK
4. Operators AND
5. PAYROLL.SEX EQ <PROMPT at run-time>
120495
Joining Tables
The prompt string is a text string that appears when the query executes to help the user
enter the correct information. Type Please Enter M or F in the Prompt String:
field.
Joining Tables
Notice the &PROMPT1 variable in the WHERE clause. &PROMPT1 is replaced with the
value supplied at run time (either M or F).
120495
Joining Tables
Select Run Query Run Immediate to execute the query.
The Prompt window appears and requests a value. Type F in the Prompt window.
Prompt Window
Select OK .
120495
Summarizing and Joining Tables 71
Joining Tables
The result of the query is displayed in the OUTPUT window.
Final Report
120495
Viewing Query Code
All the clauses that make up the query can be viewed at any time by selecting
Show Query . . . .
You can view the query from the pull-down menus by selecting
Actions Show Query . . . .
120495
Summarizing and Joining Tables 73
Example: Save the current query in the COMPANY.PROFILE catalog, and specify
the entry name COMBINED and an appropriate description.
Select Save Query Save as QUERY to Include later . . . to save the query
for later use.
74 Chapter 1 SQL Query Window
120495
Saving Your Query
Queries are stored as entries in a SAS catalog. A SAS catalog entry is referenced with a
four-level naming convention, libref.catalog.entry-name.entry-type. When saving a query,
you must specify the libref.catalog.entry-name. The entry-type of QUERY is added
automatically.
The default storage location is the SASUSER.PROFILE catalog. You can specify a
different storage location using the Library , Catalog Name , and
Entry Name pushbuttons.
Type
A saved query can only be executed from within the QUERY window. To access
or execute a query from outside of the QUERY window, save the query as a
SOURCE entry in a catalog or in an external file.
76 Chapter 1 SQL Query Window
120495
Saving Your Query
Example: Save the current query in the external file named /dept/edu/student/join.sas.
External filenames and the window in which you specify them vary among
operating systems.
78 Chapter 1 SQL Query Window
120495
Including a Saved Query
Example: Include the saved query COMPANY.PROFILE.COMBINED.QUERY and
display it in the SQL QUERY window.
Including a Query
120495
Summarizing and Joining Tables 79
Selecting a Library
80 Chapter 1 SQL Query Window
120495
Including a Saved Query
Select
Including a Query
120495
Including a Saved Query
Select Actions Show Query . . . to view the query.
Query Code
120495
Summarizing and Joining Tables 83
Exercises
1.4 Joining Tables
Create a report that displays the name and birthday of each employee. The report
should include the FNAME and LNAME columns from the COMPANY.STAFF table
and the BIRTH column from the COMPANY.PAYROLL table. The two tables
should be joined where the values of IDNUM are equal.
a. Alter the previous query so that the user can provide a last name at run time to
subset the report for a particular employee. Alter the WHERE expression in your
query to check where LNAME equals a run-time prompt.
b. Execute the query and request a report for UPCHURCH. Then generate reports for
other employees (such as BOYCE, WOOD, or DEAN).
84 Chapter 1 SQL Query Window
120495
1.4 SQL Views
Objectives
After completing this section, you should be able to
Creating a View
An SQL view
120495
Creating a View
Since the query had ‘‘Prompt at Run Time’’ as part of the WHERE expression, a
prompt box appears. Type M in the prompt field. Select OK to close the window.
Creating a View
A message displays in the SQL QUERY window confirming the creation of the view
COMPANY.FA_PT.
Creation Confirmation
120495
Exiting the Query Window
Select File Exit to begin the exit process.
120495
Exiting the Query Window
Select Main menu to return to the SAS/ASSIST Primary Menu.
Returning to SAS/ASSIST
120495
SQL Views 91
120495
Using an SQL View
Select High resolution . . . if SAS/GRAPH software is installed and your device
supports high resolution graphics. Otherwise, select Low resolution . . . .
Graphics Window
120495
SQL Views 93
120495
Using an SQL View
Select Simple from the Horizontal Bar Charts window.
120495
Using an SQL View
Select
1. Bar values:
2. Mean from the list of statistics
3. Analysis variable: SALARY
4. OK to close the Bar/Slice Values window.
Specifying Statistics
120495
Exercises
1.6 Saving a Query
a. Edit the query created in the previous exercise to remove the run-time prompt.
b. Save the new query as a QUERY catalog entry to include later. Store your query
in SASUSER.PROFILE.BDAY.QUERY.
Create a view named SASUSER.BDAYVIEW using the query created in the previous
exercise.
120495
Solutions to Exercises 99
120495
Solutions
1.2 Creating a Simple Query
Select
Select
1. * STAFF * <all columns> from the Available Columns list box in the
SQL QUERY COLUMNS window
2. to add these columns to the Selected Columns list box.
1. Select Actions Run Query Run Immediate from the menu bar
at the top of the SQL QUERY COLUMNS window.
2. Examine the OUTPUT window to see the report.
3. Select File End from the menu bar in the OUTPUT window to return to
the SQL QUERY COLUMNS window. You can also press the END
function key.
120495
Solutions to Exercises 101
Solutions
1.3 Subsetting and Ordering a Query
a. Reset the query by selecting
1. Actions Reset from the SQL QUERY COLUMNS window
2. OK to verify that you want to clear everything.
b. Specify the COMPANY.FREQ data set.
Select
1. COMPANY from the Table Sources list box in the SQL QUERY TABLES
window
2. COMPANY.FREQ in the Available Tables list box
3. to add this table to the Selected Tables list box
4. OK .
Select
120495
Solutions
1.3 Subsetting and Ordering a Query (continued)
b. (continued)
Construct a WHERE clause to include only passengers who traveled more
than 55,000 miles.
Select
1. Locals Where Conditions . . .
2. FREQ.MILETRAV from the Available Columns list box in the WHERE
EXPRESSION window
3. GE in the pop-up window that opens
4. <CONSTANT enter value> from the Available Columns list box and
type 55000 in the field
5. OK
6. OK to close the WHERE EXPRESSION window.
Execute the query. Examine the output and then close the OUTPUT
window.
Execute the query. Examine the output generated and then close the
OUTPUT window.
d. Create a column that corresponds to the bonus points remaining for each
passenger.
1. Select Build a Column in the SQL QUERY COLUMNS window.
2. Select FREQ.PTSEARND from the Available Columns list box.
3. Select in the pop-up window.
4. Select FREQ.PTSUSED from the Available Columns list box.
5. Select Column Attributes .
6. Type ptsrmng in the Alias Name field and Points Remaining in the
Label field.
7. Select OK twice.
Execute the query. Examine the output and close the OUTPUT window.
Solutions
1.4 Joining Tables
Select
1. STAFF.IDNUM
2. EQ in the pop-up window
3. SCHEDULE.IDNUM
4. OK to close the WHERE EXPRESSION window.
120495
Solutions
1.5 Prompting for Information
a. Edit the WHERE clause.
Select
1. Locals Where Conditions . . . .
2. Operators and AND .
3. LNAME , EQ , and PROMPT at <run-time > . Type employee last
name and select OK in the Enter a String for this Prompt window.
4. OK to close the WHERE EXPRESSION window.
b. Execute the query.
1. Select Actions Run Query Run Immediate .
2. Type UPCHURCH for the last name in the window that opens and select
OK .
3. Examine the report and select File End to return to the SQL
QUERY COLUMNS window.
1.6 Saving a Query
a. Edit the WHERE clause and remove the two prompts at run time.
Select
1. Locals Where Conditions . . .
2. UNDO four times to remove this part of the WHERE clause: AND
STAFF.LNAME EQ &PROMPT1
3. OK to specify the modified WHERE clause.
b. Save the query.
1. Select File Save Query
Save as QUERY to Include later .
2. Type bday in the Entry Name field.
3. Type a description in the Enter a description for query field.
4. Select OK to save the query (PROC SQL statements) as the
SASUSER.PROFILE.BDAY.QUERY SAS file.
120495
Solutions to Exercises 105
Solutions
1.7 Creating a View
1. Select File Create View of Query . . . .
2. Select next to the Library field.
3. Select SASUSER OK to confirm your choice of library.
4. Type BDAYVIEW in the View field.
5. Select OK to create the view (a dynamic file containing the joined tables).
106 Chapter 1 SQL Query Window
120495
120495
Index
& I
&PROMPT1 variable including saved queries 78-82
WHERE clause 69
J
A joining tables 60-71
accessing data Cartesian product 66
SQL Query window 5 SQL join 60
adding titles 55-57 WHERE clause 65-70
TITLES window 56
AVG function 49-50
L
B labeling columns 21-22
libraries
bar charts selecting 12
SQL views 92-97
M
C MAX function 49-50
Cartesian product moving columns 16
joining tables 66
columns
creating 23-31 N
formatting 29, 32 NUMBER option 53-54
labeling 21-22
moving 16
selecting 15-20 O
creating
ordering reports 41-44
columns 23-31
OUTPUT window 19
SQL views 85-87
SQL views, WHERE expressions 86
summary reports 47-52 P
WHERE expressions 33-40
prompt string
queries 68
D
data Q
accessing 5
sorting 41-44 queries
subsetting 33-40 executing 17
DATE option 53-54 including 78-82
prompt string 68
resetting 58-59
E saving 74-77
query code
executing queries 17 viewing 72-73
QUERY Window
F resetting 58-59
formatting columns 29
FORMAT= option 32 R
reports
G ordering 41-44
resetting queries 58-59
graphics
SQL views 91-97
GROUP BY clause 50
108 Index
120495
S
SAS options
setting 53-54
saving queries 74-77
SOURCE entries 75
selecting
columns 15-20
libraries 12
tables 12-14
setting SAS options 53-54
sorting data 41-44
SQL QUERY COLUMNS window 15
SQL QUERY window 73
accessing 6-10
SQL views
bar charts 92-97
creating 85-87
graphics 91-97
subsetting data 33-40
summary reports
creating 47-52
T
tables
joining 60-71
selecting 12-14
titles
adding 55-57
TITLES window
adding titles 56
V
viewing query code 72-73
W
WHERE clause
&PROMPT1 variable 69
joining tables 65-70
WHERE expressions
creating 33-40
creating SQL views 86