Doing More with SAS/ASSIST® 9.1 the Correct Bibliographic Citation for This Manual Is As Follows: SAS Institute Inc
Total Page:16
File Type:pdf, Size:1020Kb
Doing More With SAS/ASSIST® 9.1 The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2004. Doing More With SAS/ASSIST ® 9.1. Cary, NC: SAS Institute Inc. Doing More With SAS/ASSIST® 9.1 Copyright © 2004, SAS Institute Inc., Cary, NC, USA ISBN 1-59047-206-3 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/publishing 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. Contents Chapter 1 R Introduction 1 Overview 1 Typographical Conventions 1 Using SAS/ASSIST Software with This Document 2 Chapter 2 R Common Interface Features in SAS/ASSIST Software 7 Introduction 7 SAS/ASSIST Software Structure 7 Backing Out and Exiting SAS/ASSIST Software 8 Moving Between SAS/ASSIST Windows and SAS Windows 8 Returning to SAS/ASSIST Windows from the Output Window 9 Using the Command Line in SAS/ASSIST Software 10 Using ? to Display Choices 11 Additional Interface Items 12 Chapter 3 R Doing More with Data Management 15 Introduction 15 Converting a Character column to a Numeric column 15 Combining Data Using a Cartesian Product Match Merge 22 Creating a Format 28 Altering the Properties of a SAS Table 30 Transporting SAS Files Across Operating Environments 34 Transposing a Table 37 Chapter 4 R Doing More with Report Writing 43 Introduction 43 Limiting the Number of Rows for a Report 43 Adding More than Four Titles to a Report 47 Doing More with Tabular Reports 49 Chapter 5 R Doing More with the Report Engine 61 Introduction 61 Opening and Using the Report Engine Window 62 Modifying a Report Using the Cmd Field 65 Modifying a Report’s Column Order, Headers, and Formats 66 Modifying a Report with Usages 68 Using the Column Information Window 70 Choosing a Different Report Type 72 Inserting Date and Time Stamps in Titles and Footnotes 74 Additional Report Engine Options 75 Saving Reports 77 Opening an Existing Report 82 iv Selecting Other Data 83 Editing a Graph Interactively 83 Chapter 6 R Doing More with Graphics 85 Introduction 86 Additional Information 86 Doing More with Bar Charts 86 Doing More with Pie Charts 98 Doing More with Plots 106 Doing More with Maps 110 Changing the Background Color for Graphs 115 Chapter 7 R Doing More with Data Analysis 119 Introduction 119 Generating a One-way Frequency Table 119 Performing a Linear Regression 121 Performing an Analysis of Variance 127 Chapter 8 R Doing More with Remote Connect 135 Introduction 135 Assigning Librefs on Remote SAS Sessions 135 Setting Up SAS/ASSIST Tasks On Remote Data 137 Remote Configuration Management 140 Chapter 9 R Doing More with Results 143 Chapter Overview 143 Doing More with the Result Manager 143 Saving Source Code to an External File 149 Browsing an External File 150 Creating and Executing a Script File 152 Chapter 10 R Query and Reporting 155 Introduction to Query and Reporting 156 Additional Information 156 Querying Data 156 Opening the Query Window 157 Opening and Using the Select Window 159 Building a Query 169 Creating New Tables 183 Joining Tables 185 Query and Reporting Setup Options 201 Chapter 11 R Using the SQL Editor 203 Overview 203 Opening the SQL Editor Window 204 Entering SQL Statements Directly 204 Creating Template SQL Programs 206 v Using the Enhanced SQL Editor 209 Running an SQL Query and Customizing the Output 213 Saving SQL Code or Output 215 Chapter 12 R Doing More with Setup 217 Introduction 217 File Management Items 218 Environment Items 219 Information items 221 Profiles items 221 Using the Catalog Search Path 222 Using Logon and Logoff Exits and an Alternate Main Menu 223 Appendix 1 R Tasks Menu Reference 227 Introduction 227 Appendix 2 R Customizing SAS/ASSIST Software 239 Introduction 239 Setting User Profile Options 239 Creating an Alternate Menu Bar 241 Appendix 3 R Batch Processing with the Result Manager (z/OS Only) 245 Introduction 245 General Batch Processing Information Under z/OS 245 Submitting Batch Jobs 246 Customizing the JCL Program 248 Customizing the Batch Program Window 250 Appendix 4 R Migrating from QMF to SAS/ASSIST Software 253 Introduction 253 Generating a QMF Export Procedure 253 Exporting Queries from QMF 255 Importing QMF Queries into Query and Reporting 255 Alternate Method to Import Queries 257 Appendix 5 R Recommended Reading 259 Recommended Reading 259 Glossary 261 Index 269 vi 1 CHAPTER 1 Introduction Overview 1 Typographical Conventions 1 Using SAS/ASSIST Software with This Document 2 Removing the Date and Time Stamp from Your Output 2 Disabling the Save Changes Dialog Box 2 Creating the SAS/ASSIST Sample Tables 3 Creating the AIRLINE Sample Tables 3 Overview This document extends the concepts presented in Getting Started with SAS/ASSIST, providing additional details on the features and capabilities of SAS/ASSIST software. Additionally, features of SAS/ASSIST software not covered in Getting Started with SAS/ASSIST are introduced in this document. Readers of this document should be familiar with the concepts presented in Getting Started with SAS/ASSIST, and should have installed, at minimum, base SAS software, SAS/ASSIST software, and SAS/FSP software. To perform the graphics tasks, users should have SAS/GRAPH software installed. To perform tasks that access or create DB2 files, or files from other database management system (DBMS) vendors, users should have installed SAS/ACCESS software and the SAS/ACCESS interface to their desired DBMS. The illustrations and examples from this document were taken from SAS/ASSIST 9.1 under the Microsoft Windows operating environment. Your screens might look different from the illustrations in this document. Typographical Conventions Following is a description of the typographical conventions used in this document: italic Used for new terms. monospace Used to indicate items in windows or on menus, or items that the user types into the system. 2 Using SAS/ASSIST Software with This Document R Chapter 1 Performing the tasks in this document occasionally requires you to make a series of window and menu selections. Where appropriate, these series are indicated with a selection path. For example, Tasks s Graphics s Maps In this case, you would select Tasks from the current window, then select Graphics from the resulting pull-down menu, and then select Maps from the resulting cascading menu. In this document the word task refers to anything you can do with SAS/ASSIST that involves manipulating, reporting, analyzing, and presenting data. SAS/ASSIST tasks can be saved and recalled. These tasks are distinguished from other things you can do with SAS/ASSIST software, such as setup actions and utility actions. Thus, creating a listing report is a SAS/ASSIST task, but generating the graphics test pattern is not. A task window is a SAS/ASSIST window that is the starting point for performing a task. Examples of task windows include the List a Table window and the Bar Charts window. Using SAS/ASSIST Software with This Document For the examples in this document, we disabled the date and time stamp from all output, and we disabled the Save Changes dialog box that appears by default when you exit a task window. We also use the same sample tables that were used in Getting Started with SAS/ASSIST. For convenience, we have reprinted here the instructions for disabling the date and time stamp, disabling the Save Changes dialog box, and creating the SAS/ASSIST sample tables and the AIRLINE sample tables. Removing the Date and Time Stamp from Your Output To remove the date and time stamp from your output, follow this selection path from the SAS/ASSIST WorkPlace menu or any task window menu bar: Edit s Page Headers Deselect Print current date. Note: This option is not applicable to graphics output and is not available on graphics task windows. Also, the date and time stamp are disabled for the duration of the current SAS session; they will be enabled the next time you invoke SAS. R Disabling the Save Changes Dialog Box To disable the Save Changes dialog box, the SAS/ASSIST user profile option Confirm changes is set to No. To set this option, do the following: 1 Follow this selection path: Tasks s Setup s Profiles s User The User Profile window appears. 2 In the Value field for the Confirm changes option, type no and press ENTER. Introduction R Creating the AIRLINE Sample Tables 3 3 Follow this selection path to save the profile change: File s Close If you do not set this option to No, you are presented with a Save Changes dialog box every time you exit a task window.