Example: tourism industry

Step-by-Step Programming with Base SAS Software

Step-by-Step Programming with base SAS Software . The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2001. Step-by-Step Programming with base SAS Software . Cary, NC: SAS Institute Inc. Step-by-Step Programming with base SAS Software Copyright 2001 by SAS Institute Inc., Cary, NC, USA. ISBN 978-1-58025-791-6. 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 this publication.

The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2001. Step-by-Step Programming with Base SAS® Software.Cary, NC: SAS Institute Inc.

Tags:

  Programming, With, Base, Step, Software, By step programming with base sas software, By step programming with base sas, 174 software

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Step-by-Step Programming with Base SAS Software

1 Step-by-Step Programming with base SAS Software . The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2001. Step-by-Step Programming with base SAS Software . Cary, NC: SAS Institute Inc. Step-by-Step Programming with base SAS Software Copyright 2001 by SAS Institute Inc., Cary, NC, USA. ISBN 978-1-58025-791-6. 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 this publication.

2 Government Restricted Rights Notice. Use, duplication, or disclosure of this Software and related documentation by the government is subject to the Agreement with SAS Institute and the restrictions set forth in FAR Commercial Computer Software -Restricted Rights (June 1987). SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513. February 2007. 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 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.

3 In the USA and other countries. indicates USA. registration. Other brand and product names are registered trademarks or trademarks of their respective companies. Contents PART 1 Introduction to the SAS System 1. Chapter 1 4 What Is the SAS System? 3. Introduction to the SAS System 3. Components of base SAS Software 4. Output Produced by the SAS System 8. Ways to Run SAS Programs 11. Running Programs in the SAS Windowing Environment 13. Review of SAS Tools 15. Learning More 16. PART 2 Getting Your Data into Shape 17. Chapter 2 4 Introduction to DATA step Processing 19. Introduction to DATA step Processing 20. The SAS Data Set: Your Key to the SAS System 20. How the DATA step Works: A Basic Introduction 26. Supplying Information to Create a SAS Data Set 33.

4 Review of SAS Tools 41. Learning More 41. Chapter 3 4 Starting with Raw Data: The Basics 43. Introduction to Raw Data 44. Examine the Structure of the Raw Data: Factors to Consider 44. Reading Unaligned Data 44. Reading Data That Is Aligned in Columns 47. Reading Data That Requires Special Instructions 50. Reading Unaligned Data with More Flexibility 53. Mixing Styles of Input 55. Review of SAS Tools 58. Learning More 59. Chapter 4 4 Starting with Raw Data: Beyond the Basics 61. Introduction to Beyond the Basics with Raw Data 61. Testing a Condition before Creating an Observation 62. Creating Multiple Observations from a Single Record 63. Reading Multiple Records to Create a Single Observation 67. Problem Solving: When an Input Record Unexpectedly Does Not Have Enough Values 74.

5 Review of SAS Tools 77. Learning More 79. iv Chapter 5 4 Starting with SAS Data Sets 81. Introduction to Starting with SAS Data Sets 81. Understanding the Basics 82. Input SAS Data Set for Examples 82. Reading Selected Observations 84. Reading Selected Variables 85. Creating More Than One Data Set in a Single DATA step 89. Using the DROP= and KEEP= Data Set Options for Efficiency 91. Review of SAS Tools 92. Learning More 93. PART 3 Basic Programming 95. Chapter 6 4 Understanding DATA step Processing 97. Introduction to DATA step Processing 97. Input SAS Data Set for Examples 97. Adding Information to a SAS Data Set 98. Defining Enough Storage Space for Variables 103. Conditionally Deleting an Observation 104. Review of SAS Tools 105. Learning More 105.

6 Chapter 7 4 Working with Numeric Variables 107. Introduction to Working with Numeric Variables 107. About Numeric Variables in SAS 108. Input SAS Data Set for Examples 108. Calculating with Numeric Variables 109. Comparing Numeric Variables 113. Storing Numeric Variables Efficiently 115. Review of SAS Tools 116. Learning More 117. Chapter 8 4 Working with Character Variables 119. Introduction to Working with Character Variables 119. Input SAS Data Set for Examples 120. Identifying Character Variables and Expressing Character Values 121. Setting the Length of Character Variables 122. Handling Missing Values 124. Creating New Character Values 127. Saving Storage Space by Treating Numbers as Characters 134. Review of SAS Tools 135. Learning More 136.

7 Chapter 9 4 Acting on Selected Observations 139. Introduction to Acting on Selected Observations 139. Input SAS Data Set for Examples 140. v Selecting Observations 141. Constructing Conditions 145. Comparing Characters 152. Review of SAS Tools 156. Learning More 157. Chapter 10 4 Creating Subsets of Observations 159. Introduction to Creating Subsets of Observations 159. Input SAS Data Set for Examples 160. Selecting Observations for a New SAS Data Set 161. Conditionally Writing Observations to One or More SAS Data Sets 164. Review of SAS Tools 170. Learning More 170. Chapter 11 4 Working with Grouped or Sorted Observations 173. Introduction to Working with Grouped or Sorted Observations 173. Input SAS Data Set for Examples 174. Working with Grouped Data 175.

8 Working with Sorted Data 181. Review of SAS Tools 185. Learning More 186. Chapter 12 4 Using More Than One Observation in a Calculation 187. Introduction to Using More Than One Observation in a Calculation 187. Input File and SAS Data Set for Examples 188. Accumulating a Total for an Entire Data Set 189. Obtaining a Total for Each BY Group 191. Writing to Separate Data Sets 193. Using a Value in a Later Observation 196. Review of SAS Tools 199. Learning More 200. Chapter 13 4 Finding Shortcuts in Programming 201. Introduction to Shortcuts 201. Input File and SAS Data Set 201. Performing More Than One Action in an IF-THEN Statement 202. Performing the Same Action for a Series of Variables 204. Review of SAS Tools 207. Learning More 209. Chapter 14 4 Working with Dates in the SAS System 211.

9 Introduction to Working with Dates 211. Understanding How SAS Handles Dates 212. Input File and SAS Data Set for Examples 213. Entering Dates 214. Displaying Dates 217. Using Dates in Calculations 221. vi Using SAS Date Functions 223. Comparing Durations and SAS Date Values 225. Review of SAS Tools 227. Learning More 228. PART 4 Combining SAS Data Sets 231. Chapter 15 4 Methods of Combining SAS Data Sets 233. Introduction to Combining SAS Data Sets 233. Definition of Concatenating 234. Definition of Interleaving 234. Definition of Merging 235. Definition of Updating 236. Definition of Modifying 237. Comparing Modifying, Merging, and Updating Data Sets 238. Learning More 239. Chapter 16 4 Concatenating SAS Data Sets 241. Introduction to Concatenating SAS Data Sets 241.

10 Concatenating Data Sets with the SET Statement 242. Concatenating Data Sets Using the APPEND Procedure 255. Choosing between the SET Statement and the APPEND Procedure 259. Review of SAS Tools 260. Learning More 260. Chapter 17 4 Interleaving SAS Data Sets 263. Introduction to Interleaving SAS Data Sets 263. Understanding BY-Group Processing Concepts 263. Interleaving Data Sets 264. Review of SAS Tools 267. Learning More 267. Chapter 18 4 Merging SAS Data Sets 269. Introduction to Merging SAS Data Sets 270. Understanding the MERGE Statement 270. One-to-One Merging 270. Match-Merging 276. Choosing between One-to-One Merging and Match-Merging 286. Review of SAS Tools 290. Learning More 290. Chapter 19 4 Updating SAS Data Sets 293. Introduction to Updating SAS Data Sets 293.


Related search queries