SAS 9.1 SQL Ouery Window Users Guide
Original Publication Date: 2004-Dec-31
Included in the Prior Art Database: 2015-Sep-19
SAS Institute Inc.
Page 01 of 108
SQL Query Window
Page 02 of 108
The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2004. SAS ® 9.1 SQL Query Window User's Guide. Cary, NC: SAS Institute Inc.
SAS® 9.1 SQL Query Window User's Guide
Copyright © 2004, SAS Institute Inc., Cary, NC, USA
All rights reserved. Produced 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.
U.S. Government Restricted Rights Notice. Use, duplication, or disclosure of this software and related documentation by the U.S. government is subject to the Agreement with SAS Institute and the restrictions set forth in FAR 52.227-19 Commercial Computer Software-Restricted Rights (June 1987).
SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513.
1st printing, January 2004
SAS Publishing provides a complete selection of books and electronic products to help customers use SAS software to its fullest potential. For more information about our e-books, e-learning products, CDs, and hard-copy books, visit the SAS Publishing Web site at support.sas.com/pubs or call 1-800-727-3228.
SAS® and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.
Other brand and product names are registered trademarks or trademarks of their respective companies.
Page 03 of 108
4 An Overview of the SQL Query Window 1
Invoking the SQL Query Window 2
Query Window Menus 3
4 Examples 9
Setting Up the Environment 10
Performing Simple Queries 14
Sorting Your Output 22
Building Calculated Columns 25
Building and Adding Tables 29
Joining Matching Data 30
Saving Queries 32
Using Parentheses and Other Operators 36
Designing and Saving a Report 38
Creating Summary Reports 45
Counting and Grouping Data Automatically 47
Summarizing Groups of Data 52
Subsetting Groups of Data with the HAVING Condition 56
Using the Automatic Lookup Feature 58
Creating and Using Outer Joins 66
4 Customizing Your Session and Using Advanced Features 73 Setting Your Profile 73
Switching to Another Profile 82
Handling Missing Values 82
Defining a Format Outside the SQL Query Window 83
Changing Access Modes 85
Using SAS Data Sets to Store System Tables Information 88
Handling Embedded Blanks in Column Names 89
Including Saved Queries 89
4 Recommended Reading 93 Recommended Reading 93
Page 04 of 108
Page 05 of 108
C H A P T E R
An Overview of the SQL Query Window
Invoking the SQL Query Window 2 Query Window Menus 3
File Menu 3
Save Query 3
List/Include Saved Queries 4 Create Table from Query Results 4 Create View of Query 4