SAS Certified Specialist Prep Guide: Base

2y ago
14 Views
2 Downloads
5.81 MB
434 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Sabrina Baez
Transcription

The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2019. SAS Certified Specialist Prep Guide: Base ProgrammingUsing SAS 9.4. Cary, NC: SAS Institute Inc.SAS Certified Specialist Prep Guide: Base Programming Using SAS 9.4Copyright 2019, SAS Institute Inc., Cary, NC, USAISBN 978-1-64295-179-0 (Hard copy)ISBN 978-1-64295-176-9 (Epub)ISBN 978-1-64295-177-6 (Mobi)ISBN 978-1-64295-178-3 (PDF)All Rights Reserved. Produced in the United States of America.For a hard copy book: 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.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 thispublication.The scanning, uploading, and distribution of this book via the Internet or any other means without the permission of the publisher is illegal andpunishable by law. Please purchase only authorized electronic editions and do not participate in or encourage electronic piracy of copyrightedmaterials. Your support of others' rights is appreciated.U.S. Government License Rights; Restricted Rights: The Software and its documentation is commercial computer software developed at privateexpense and is provided with RESTRICTED RIGHTS to the United States Government. Use, duplication, or disclosure of the Software by theUnited States Government is subject to the license terms of this Agreement pursuant to, as applicable, FAR 12.212, DFAR 227.7202-1(a), DFAR227.7202-3(a), and DFAR 227.7202-4, and, to the extent required under U.S. federal law, the minimum restricted rights as set out in FAR52.227-19 (DEC 2007). If FAR 52.227-19 is applicable, this provision serves as notice under clause (c) thereof and no other notice is required to beaffixed to the Software or documentation. The Government’s rights in Software and documentation shall be only those set forth in this Agreement.SAS Institute Inc., SAS Campus Drive, Cary, NC 27513-2414February 2019SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and othercountries. indicates USA registration.Other brand and product names are trademarks of their respective companies.P1:certsppg

ContentsHow to Prepare for the Exam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viiAccessibility Features of the Prep Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiPART 1SAS Certified Specialist Prep Guide1Chapter 1 Setting Up Practice Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Accessing Your Practice Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Chapter 2 Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6The Basics of the SAS Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6SAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Referencing SAS Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Chapter Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22Chapter 3 Accessing Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25SAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Viewing SAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Chapter Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Chapter 4 Creating SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33Referencing an External Data File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34The IMPORT Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35Reading and Verifying Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42Using the Imported Data in a DATA Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44Reading a Single SAS Data Set to Create Another . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45Reading Microsoft Excel Data with the XLSX Engine . . . . . . . . . . . . . . . . . . . . . . . . . 47Creating Excel Worksheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53Writing Observations Explicitly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54Chapter Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Chapter 5 Identifying and Correcting SAS Language Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . 59Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59Correcting Common Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61Chapter Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72Chapter 6 Creating Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75Creating a Basic Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76Selecting Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77Identifying Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78Sorting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86Generating Column Totals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88Specifying Titles and Footnotes in Procedure Output . . . . . . . . . . . . . . . . . . . . . . . . . . 95Assigning Descriptive Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100Using Permanently Assigned Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103Chapter Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

iv ContentsChapter 7 Understanding DATA Step Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109How SAS Processes Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109Compilation Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112Execution Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115Debugging a DATA Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120Testing Your Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125Chapter Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126Chapter 8 BY-Group Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129Preprocessing Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130FIRST. and LAST. DATA Step Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131Chapter Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137Chapter 9 Creating and Managing Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141Creating Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142Modifying Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146Specifying Lengths for Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149Subsetting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151Transposing Variables into Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158Using SAS Macro Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164Chapter Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170Chapter 10 Combining SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175How to Prepare Your Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176Methods of Combining SAS Data Sets: The Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . 177One-to-One Reading: Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178Concatenating: Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182Match-Merging: Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184Match-Merge Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188Renaming Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194Excluding Unmatched Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196Chapter Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198Chapter 11 Processing Data with DO Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207The Basics of DO Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207Constructing DO Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212Nesting DO Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215Iteratively Processing Observations from a Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . 217Conditionally Executing DO Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218Chapter Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220Chapter 12 SAS Formats and Informats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225Applying SAS Formats and Informats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225The FORMAT Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229Defining a Unique Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231Associating User-Defined Formats with Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233Chapter Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238Chapter 13 SAS Date, Time, and Datetime Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241SAS Date and Time Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241Reading Dates and Times with Informats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243Example: Using Dates and Times in Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247Displaying Date and Time Values with Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248Chapter Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251

ContentsvChapter 14 Using Functions to Manipulate Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253The Basics of SAS Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254SAS Functions Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255Converting Data with Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256Manipulating SAS Date Values with Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263Modifying Character Values with Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277Modifying Numeric Values with Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300Nesting SAS Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303Chapter Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304Chapter 15 Producing Descriptive Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307The MEANS Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307The FREQ Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317Chapter Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331Chapter 16 Creating Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335The Output Delivery System (ODS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336Creating HTML Output with ODS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338Creating PDF Output with ODS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347Creating RTF Output with ODS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352Creating EXCEL Output with ODS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354The EXPORT Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356Chapter Quiz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359PART 2Workbook363Chapter 17 Practice Programming Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365Scenario 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366Scenario 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366Scenario 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367Scenario 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368Scenario 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368Scenario 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369Scenario 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370Scenario 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371Scenario 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372Scenario 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373PART 3Quiz Answer Keys and Scenario Solutions375Appendix 1 Chapter Quiz Answer Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377Chapter 2: Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377Chapter 3: Accessing Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378Chapter 4: Creating SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379Chapter 5: Identifying and Correcting SAS Language Errors . . . . . . . . . . . . . . . . . . . 380Chapter 6: Creating Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381Chapter 7: Understanding DATA Step Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383Chapter 8: BY-Group Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384Chapter 9: Creating and Managing Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384Chapter 10: Combining SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386Chapter 11: Processing Data with DO Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387

vi ContentsChapter 12: SAS Formats and Informats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388Chapter 13: SAS Date, Time, and Datetime Values . . . . . . . . . . . . . . . . . . . . . . . . . . . 389Chapter 14: Using Functions to Manipulate Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390Chapter 15: Producing Descriptive Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390Chapter 16: Creating Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391Appendix 2 Programming Scenario Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393Scenario 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394Scenario 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395Scenario 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396Scenario 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398Scenario 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401Scenario 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402Scenario 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404Scenario 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405Scenario 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407Scenario 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411

viiHow to Prepare for the ExamRequirements and DetailsRequirementsTo complete examples in this book, you must have access to SAS windowingenvironment, SAS Enterprise Guide, or SAS Studio.Exam Objectives and Updates to This BookThe current exam objectives and a list of any updates to this book are available atwww.sas.com/certify. Exam objectives are subject to change.Take a Practice ExamPractice exams are available for purchase through SAS and Pearson VUE. For moreinformation about practice exams, see www.sas.com/base programmer cert.Registering for the ExamTo register for the SAS 9.4 Base Programming – Performance-Based Exam, see the SASGlobal Certification website at www.sas.com/certify.Additional Resources for Learning SAS ProgrammingFrom SAS SoftwareHelp SAS 9: Select Help ð SAS Help and Documentation. SAS Enterprise Guide: Select Help ð SAS EnterpriseGuide Help. SAS Studio: Select the Help iconDocumentation. SAS 9: Select Help ð SAS Help and Documentation. SAS Enterprise Guide: Access online documentation on theweb. SAS Studio: Select the Help iconand then click Help.

viii How to Prepare for the ExamOn the WebBase SAS itiescommunities.sas.comKnowledge Basesupport.sas.com/notesLearning Centerwww.sas.com and click Learn. Then selectGet Started with SAS.SAS ation.sas.comSAS Global Academic Programwww.sas.com and click Learn. Then selectFor Students and Educators.SAS OnDemandsupport.sas.com/ondemand/Syntax Quick Reference ainingTechnical Supportsupport.sas.com. Then select TechnicalSupport.Syntax ConventionsIn this book, SAS syntax looks like this example:DATA output-SAS-data-set(DROP variables(s) KEEP variables(s));SET SAS-data-set options ;BY variable(s);RUN;Here are the conventions that are used in the example: DATA, DROP , KEEP , SET, BY, and RUN are in uppercase bold because theymust be spelled as shown. output-SAS-data-set, variable(s), SAS-data-set, and options are in italics becauseeach represents a value that you supply. options is enclosed in angle brackets because it is optional syntax.

Syntax Conventions ixDROP and KEEP are separated by a vertical bar ( ) to indicate that they aremutually exclusive.The example syntax that is shown in this book includes only what you need to know inorder to prepare for the certification exam. For complete syntax, see the appropriate SASreference guide.

x How to Prepare for the Exam

xiAccessibility Features of thePrep GuideOverviewThe SAS Certified Specialist Prep Guide: Base Programming Using SAS 9.4 is a testpreparation document that uses the following environments and products: SAS windowing environment SAS Enterprise Guide SAS Studio or SAS University EditionAccessibility Documentation HelpThe following table contains accessibility information for the listed products:Accessibility Documentation LinksProduct or EnvironmentWhere to Find AccessibilityDocumentationBase SAS (Microsoft Windows, UNIX, andz/OS)support.sas.com/baseaccessSAS Enterprise /index.htmlSAS Studiosupport.sas.com/studioaccessDocumentation FormatContact accessibility@sas.com if you need this document in an alternative digitalformat.

xii Accessibility Features of the Prep Guide

1Part 1SAS Certified Specialist PrepGuideChapter 1Setting Up Practice Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Chapter 2Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Chapter 3Accessing Your Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Chapter 4Creating SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33Chapter 5Identifying and Correcting SAS Language Errors . . . . . . . . . . . . . . . . . 59Chapter 6Creating Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75Chapter 7Understanding DATA Step Processing . . . . . . . . . . . . . . . . . . . . . . . . . . 109Chapter 8BY-Group Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129Chapter 9Creating and Managing Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141Chapter 10Combining SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175Chapter 11Processing Data with DO Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207Chapter 12SAS Formats and Informats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

2Chapter 13SAS Date, Time, and Datetime Values . . . . . . . . . . . . . . . . . . . . . . . . . . . 241Chapter 14Using Functions to Manipulate Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253Chapter 15Producing Descriptive Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307Chapter 16Creating Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335

3Chapter 1Setting Up Practice DataAccessing Your Practice Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Practice Data ZIP File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Accessing Your Practice DataRequirementsTo complete examples in this book, you must have access to SAS Studio, SASEnterprise Guide, or the SAS windowing environment.Practice Data ZIP FileThe ZIP file includes SAS data sets, Microsoft Excel workbooks (.xlsx), CSV files(.csv), and TXT files (.txt) that are used in examples in this book. To access these filesand create your practice data, follow the instructions below.Instructions1. Navigate to ata/base-guidepractice-data.zip, download and save the practice data ZIP file.2. Unzip the file and save it to a location that is accessible to SAS.3. Open the cre8data.sas program in the SAS environment of your choice. SAS Studio: In the Navigation pane, expand Files and Folders and then navigateto the Cert folder within the practice-data folder. SAS Enterprise Guide: In the Servers list, expand Servers ð Local ð Files, andthen navigate to the Cert folder in the practice-data folder. SAS windowing environment: Click File ð Open Program, and then navigateto the Cert folder in the practice-data folder.4. In the Path macro variable, replace /folders/myfolders with the path to theCert folder and run the program.%let path /folders/myfolders/cert;

4Chapter 1 Setting Up Practice DataImportant: The location that you specify for the Path macro variable and thelocation of your downloaded SAS programs should be the same location.Otherwise, the cre8data.sas program cannot create the practice data.Your practice data is now created and ready for you to use.TIPWhen you end your SAS session, the Path macro variable in thecre8data.sas program is reset. To avoid having to rerun cre8data.sas everytime, run the libname.sas program from the Cert folder to restore the libraries.

5Chapter 2Basic ConceptsGetting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6The Basics of the SAS Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6SAS Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Global Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6DATA Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6PROC Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7SAS Program Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Processing SAS Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Log Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Results of Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9SAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Predefined SAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Defining Libraries . . . . . . .

Prep Guide Overview The SAS Certified Specialist Prep Guide: Base Programming Using SAS 9.4 is a test preparation document that uses the following environments and products: SAS windowing environment SAS Enterprise Guide SAS Studio or SAS University Edition Accessibility Documentation Help

Related Documents:

POStERallows manual ordering and automated re-ordering on re-execution pgm1.sas pgm2.sas pgm3.sas pgm4.sas pgm5.sas pgm6.sas pgm7.sas pgm8.sas pgm9.sas pgm10.sas pgm1.sas pgm2.sas pgm3.sas pgm4.sas pgm5.sas pgm6.sas pgm7.sas pgm8.sas pgm9.sas pgm10.sas 65 min 45 min 144% 100%

SAS OLAP Cubes SAS Add-In for Microsoft Office SAS Data Integration Studio SAS Enterprise Guide SAS Enterprise Miner SAS Forecast Studio SAS Information Map Studio SAS Management Console SAS Model Manager SAS OLAP Cube Studio SAS Workflow Studio JMP Other SAS analytics and solutions Third-party Data

Both SAS SUPER 100 and SAS SUPER 180 are identified by the “SAS SUPER” logo on the right side of the instrument. The SAS SUPER 180 air sampler is recognizable by the SAS SUPER 180 logo that appears on the display when the operator turns on the unit. Rev. 9 Pg. 7File Size: 1MBPage Count: 40Explore furtherOperating Instructions for the SAS Super 180www.usmslab.comOPERATING INSTRUCTIONS AND MAINTENANCE MANUALassetcloud.roccommerce.netAir samplers, SAS Super DUO 360 VWRuk.vwr.comMAS-100 NT Manual PDF Calibration Microsoft Windowswww.scribd.com“SAS SUPER 100/180”, “DUO SAS SUPER 360”, “SAS .archive-resources.coleparmer Recommended to you b

Both SAS SUPER 100 and SAS SUPER 180 are identified by the “SAS SUPER 100” logo on the right side of the instrument. International pbi S.p.AIn « Sas Super 100/180, Duo Sas 360, Sas Isolator » September 2006 Rev. 5 8 The SAS SUPER 180 air sampler is recognisable by the SAS SUPER 180 logo that appears on the display when the .File Size: 1019KB

Jan 17, 2018 · SAS is an extremely large and complex software program with many different components. We primarily use Base SAS, SAS/STAT, SAS/ACCESS, and maybe bits and pieces of other components such as SAS/IML. SAS University Edition and SAS OnDemand both use SAS Studio. SAS Studio is an interface to the SAS

SAS Stored Process. A SAS Stored Process is merely a SAS program that is registered in the SAS Metadata. SAS Stored Processes can be run from many other SAS BI applications such as the SAS Add-in for Microsoft Office, SAS Information Delivery Portal, SAS Web

LSI (SATA) Embedded SATA RAID LSI Embedded MegaRaid Intel VROC LSI (SAS) MegaRAID SAS 8880EM2 MegaRAID SAS 9280-8E MegaRAID SAS 9285CV-8e MegaRAID SAS 9286CV-8e LSI 9200-8e SAS IME on 53C1064E D2507 LSI RAID 0/1 SAS 4P LSI RAID 0/1 SAS 8P RAID Ctrl SAS 6G 0/1 (D2607) D2516 RAID 5/6 SAS based on

Autodesk AutoCAD Architecture 2017 Fundamentals 3-1. Lesson 3 . Floor Plans . The floor plan is central to any architectural drawing. In the first exercise, we convert an AutoCAD 2D floor plan to 3D. In the remaining exercises, we work in 3D. Exercise 3-1: Going from a 2D to 3D Floor plan Drawing Name: New . Estimated Time: 45 minutes