Sasã‚â® Macro Programming Made Easy by Michele M Burlew Pdf

ebook img

SAS Macro Programming Made Easy

445 Pages · 2006 · 6.41 MB · english

Preview SAS Macro Programming Made Easy

Praise from the Experts "Using SAS macros can provide functionality as well as flexibility within code. Reading Michele Burlew's book, SAS Macro Programming Made Easy,Second Edition, helps eliminate the 'fear factor' often associated with using macros, while offering valuable insight to programmers with a broad range of experience. "This book appeals to the less experienced SAS programmer by explaining how a macro works in an easy-to-understand way and offers insight on various programming techniques. Michele compares the use of the macro procedure to using an office assistant to perform repetitive tasks in a way that most can relate to. Experienced programmers will also find this second edition of SAS Macro Programming Made Easy a useful tool in better understanding the mechanics associated with macros. This book was easy to follow and provides an excellent reference for macro programmers." Suson vonLehmden Supervisor, System Analysis & Programming Research Computing Division RTI International "This second edition updates the classic macro book with SAS®9 features and new sections, making this excellent reference to the SAS macro language even better. Michele's friendly style is especially good for programmers who might be fearful of macro programming (like me!). "This book is filled with examples showing how to store and reuse macro programs, build a library of routines, debug macro programs, and a stepwise method for writing macro code. "The discussion of the autocall and compiled macro facilities is very well done. In this section, Michele gives examples of both of these facilities, explaining the advantages and disadvantages of each. As an added value, you may want to include the macros she presents in your own macro library. "Michele Burlew has added new material and brought her already excellent first edition up to date. This is a book that anyone who uses the macro facility needs to have in their collection." Dr. Ron Cody Professor (retired) Robert Wood Johnson Medical School "We all want a 'SAS programming assistant' to help us complete our jobs more quickly. In her book SAS Macro Programming Made Easy, Second Edition, Michele Burlew encourages us to take advantage of the SAS Macro Facility as our 'SAS programming assistant.' She demonstrates how macros can handle many of the SAS programming tasks that you presently spend a lot of time on. "The Macro 'newbie' will learn well from the logical progression of topics and the in- depth coverage of concepts. Both beginner and intermediate macro programmers will benefit from the behind-the-scenes explanations of how macro programs process, the debugging tools and tips (because unexpected results do happen), and the stepwise macro development method, which is a wonderful approach to maintain your sanity when writing macros. "Whether you read this book sequentially or jump right to topics you need to know, you will find this book to be a valuable resource." Marje Fecht Senior Partner Prowerk Consulting "Whether you are new to macro programming or at an intermediate level, this second edition of a first-time favorite, with its abundance of examples and helpful explanations, will show you how to shorten code, minimize repetitive tasks, and give you the tools to potentially make your programs dynamic in scope." Robert Francis, Ph.D. Contractor, NOVA Research Company SAS Macro ® Programming Made Easy Second Edition Michele M. Burlew The correct bibliographic citation for this manual is as follows: Burlew, Michele M. 2006. SAS® Macro Programming Made Easy, Second Edition. Cary, NC: SAS Institute Inc. SAS® Macro Programming Made Easy, Second Edition Copyright © 2006, SAS Institute Inc., Cary, NC, USA ISBN 978-1-59047-882-0 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. 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, December 2006 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. Contents Preface ix Acknowledgments xi Part 1 Understanding the Concepts and Features of Macro Programming 1 Chapter 1 Introduction 3 What Is the SAS Macro Facility? 4 What Are the Advantages of the SAS Macro Facility? 6 Where Can the SAS Macro Facility Be Used? 12 Examples of the SAS Macro Facility 13 Chapter 2 Mechanics of Macro Processing 23 Introduction 23 The Vocabulary of SAS Processing 24 SAS Processing without Macro Activity 25 Understanding Tokens 26 Tokenizing a SAS Program 28 Comparing Macro Language Processing and SAS Language Processing 29 Processing a SAS Program That Contains Macro Language 30 Chapter 3 Macro Variables 39 Introduction 40 Basic Concepts of Macro Variables 40 Referencing Macro Variables 42 Understanding Macro Variable Resolution and the Use of Single and Double Quotation Marks 44 Displaying Macro Variable Values 46 Understanding Automatic Macro Variables 52 iv Contents Understanding User-Defined Macro Variables 56 Combining Macro Variables with Text 59 Referencing Macro Variables Indirectly 65 Chapter 4 Macro Programs 73 Introduction 74 Creating Macro Programs 74 Executing a Macro Program 78 Displaying Notes about Macro Program Compilation in the SAS Log 80 Displaying Messages about Macro Program Processing in the SAS Log 82 Passing Values to a Macro Program through Macro Parameters 85 Chapter 5 Understanding Macro Symbol Tables and the Processing of Macro Programs 101 Introduction 102 Understanding Macro Symbol Tables 102 Processing of Macro Programs 122 Chapter 6 Macro Language Functions 133 Introduction 133 Macro Character Functions 134 Macro Evaluation Functions 138 Macro Quoting Functions 140 Macro Variable Attribute Functions 143 Other Macro Functions 147 SAS Supplied Autocall Macro Programs Used Like Functions 154 Chapter 7 Macro Expressions and Macro Programming Statements 159 Introduction 160 Macro Language Statements 160 Constructing Macro Expressions 163 Contents v Conditional Processing with the Macro Language 167 Iterative Processing with the Macro Language 177 Branching in Macro Processing 184 Chapter 8 Masking Special Characters and Mnemonic Operators 189 Introduction 190 Why Are Quoting Functions Called Quoting Functions? 191 Illustrating the Need for Macro Quoting Functions 191 Describing the Commonly Used Macro Quoting Functions 192 Understanding How Macro Quoting Functions Work 194 Applying Macro Quoting Functions 195 Specifying Macro Program Parameters That Contain Special Characters or Mnemonic Operators 203 Unmasking Text and the %UNQUOTE Function 213 Using Quoting Versions of Macro Character Functions and Autocall Macro Programs 214 Chapter 9 Interfaces to the Macro Facility 217 Introduction 218 Understanding DATA Step Interfaces to the Macro Facility 218 Using Macro Facility Features in PROC SQL 251 Using Macro Facility Features in SAS Component Language 262 Part 2 Applying Your Knowledge of Macro Programming 267 Chapter 10 Storing and Reusing Macro Programs 269 Introduction 270 Saving Macro Programs with the Autocall Facility 270 Saving Macro Programs with the Stored Compiled Macro Facility 278 Resolving Macro Program References When Using the Autocall Facility and the Stored Compiled Macro Facility 283 vi Contents Chapter 11 Building a Library of Utilities 285 Introduction 285 Writing a Macro Program to Behave Like a Function 286 Programming Routine Tasks 290 Chapter 12 Debugging Macro Programming and Adding Error Checking to Macro Programs 297 Introduction 298 Understanding the Types of Errors That Can Occur in Macro Programming 298 Minimizing Errors in Developing SAS Programs That Contain Macro Language 299 Categorizing and Checking for Common Problems in Macro Programming 299 Understanding the Tools That Can Debug Macro Programming 303 Examples of Solving Errors in Macro Programming 307 Improving Your Macro Programming by Including Error Checking 326 Chapter 13 A Stepwise Method for Writing Macro Programs 335 Introduction 336 Building a Macro Program in Four Steps 336 Applying the Four Steps to an Example 337 Part 3 Appendixes 369 Appendix A Abridged Macro Language Reference 371 Selected SAS Options Used with the Macro Facility 372 Automatic Macro Variables 373 Macro Functions 377 Macro Language Statements 381 PROC SQL Interface to the Macro Facility 386 SAS Functions and Routines That Interface with the Macro Facility 387 Contents vii Appendix B Reserved Words in the Macro Facility 391 Appendix C Sample Data Set 393 Appendix D Reference to Programs in This Book 399 Index 407

See more

Similar SAS Macro Programming Made Easy

  • most popular

    Most Popular

  • latest

    Latest upload

silvaelows1961.blogspot.com

Source: https://pdfdrive.to/pdfs/sas-macro-programming-made-easy

0 Response to "Sasã‚â® Macro Programming Made Easy by Michele M Burlew Pdf"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel