SAS 9.2 SQL Query Window User's Guide
Original Publication Date: 2009-Dec-31
Included in the Prior Art Database: 2015-Sep-18
SAS Institute Inc.
Page 01 of 108
SAS® 9.2 SQL Query Window
Page 02 of 108
The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2009. SAS ® 9.2 SQL Query Window User's Guide. Cary, NC: SAS Institute Inc.
SAS® 9.2 SQL Query Window User's Guide
Copyright © 2009, SAS Institute Inc., Cary, NC, USA
All rights reserved. Produced in the United States of America.
For a hard-copy book: No part of this publication can 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.
For a Web download or e-book: Your use of this publication shall be governed by the terms established by the vendor at the time you acquire this publication.
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 electronic book, February 2009
1st printing, March 2009
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 35
Designing and Saving a Report 37
Creating Summary Reports 43
Counting and Grouping Data Automatically 45
Summarizing Groups of Data 50
Subsetting Groups of Data with the HAVING Condition 54
Using the Automatic Lookup Feature 56
Creating and Using Outer Joins 64
4 Customizing Your Session and Using Advanced Features 69 Setting Your Profile 69
Switching to Another Profile 77
Handling Missing Values 78
Defining a Format Outside the SQL Query Window 78
Changing Access Modes 81
Using SAS Data Sets to Store System Tables Information 84
Handling Embedded Blanks in Column Names 84
Including Saved Queries 85
4 Recommended Reading 87 Recommended Reading 87
Page 04 of 108
Page 05 of 10...