SAS Macro Programming Made Easy, Third Edition
296 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris

SAS Macro Programming Made Easy, Third Edition , livre ebook

-

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris
Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus
296 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus

Description

This book provides beginners with a thorough foundation in SAS macro programming.


The macro facility is a popular part of SAS. Macro programming is a required skill for many SAS programming jobs, and the SAS Advanced Programming Certification Exam tests macro processing concepts. Whether you're looking to become certified, land a job, or increase your skills, you'll benefit from SAS Macro Programming Made Easy, Third Edition.


By following Michele Burlew's examples and step-by-step instructions, you'll be able to rapidly perform repetitive programming tasks, to pass information between programming steps more easily, and to make your programming easier to read.


Updated for SAS 9.4, this book teaches you the elements of the macro facility (macro variables, macro programs, macro language), how to write a macro program, techniques for macro programming, tips on using the macro facility, how the macro facility fits into SAS, and about the interfaces between the macro facility and other components of SAS.


Beginning macro programmers will learn to write SAS macro programs quickly and efficiently. More experienced programmers will find this book useful to refresh their conceptual knowledge and expand on their macro programming skills. Ultimately, any user interested in automating their programs—including analysts, programmers, and report writers—will find Michele Burlew's book an excellent tutorial.


Sujets

Informations

Publié par
Date de parution 16 juin 2014
Nombre de lectures 2
EAN13 9781629591513
Langue English
Poids de l'ouvrage 5 Mo

Informations légales : prix de location à la page 0,0145€. Cette information est donnée uniquement à titre indicatif conformément à la législation en vigueur.

Extrait

SAS Macro Programming Made Easy
Third Edition
Michele M. Burlew

support.sas.com/bookstore
The correct bibliographic citation for this manual is as follows: Burlew, Michele M. 2014. SAS Macro Programming Made Easy, Third Edition . Cary, NC: SAS Institute Inc.
SAS Macro Programming Made Easy, Third Edition
Copyright 2014, SAS Institute Inc., Cary, NC, USA
ISBN 978-1-62959-151-3
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 scanning, uploading, and distribution of this book via the Internet or any other means without the permission of the publisher is illegal and punishable by law. Please purchase only authorized electronic editions and do not participate in or encourage electronic piracy of copyrighted materials. 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 private expense and is provided with RESTRICTED RIGHTS to the United States Government. Use, duplication or disclosure of the Software by the United States Government is subject to the license terms of this Agreement pursuant to, as applicable, FAR 12.212, DFAR 227.7202-1(a), DFAR 227.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 FAR 52.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 be affixed 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, North Carolina 27513-2414.
June 2014
SAS provides a complete selection of books and electronic products to help customers use SAS software to its fullest potential. For more information about our offerings, visit support.sas.com/bookstore 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 trademarks of their respective companies.
Contents
About This Book
About The Author
Acknowledgments
Part 1: Understanding the Concepts and Features of Macro Programming
Chapter 1 Introduction
What Is the SAS Macro Facility?
What Are the Advantages of the SAS Macro Facility?
Where Can the SAS Macro Facility Be Used?
Examples of the SAS Macro Facility
Chapter 2 Mechanics of Macro Processing
Introduction
The Vocabulary of SAS Processing
SAS Processing without Macro Activity
Understanding Tokens
Tokenizing a SAS Program
Comparing Macro Language Processing and SAS Language Processing
Processing a SAS Program That Contains Macro Language
Chapter 3 Macro Variables
Introduction
Basic Concepts of Macro Variables
Referencing Macro Variables
Understanding Macro Variable Resolution and the Use of Single and Double Quotation Marks
Displaying Macro Variable Values
Using the %PUT Statement
Displaying Macro Variable Values As They Resolve by Enabling the SYMBOLGEN System Option
Understanding Automatic Macro Variables
Understanding User-Defined Macro Variables
Creating Macro Variables with the %LET Statement
Combining Macro Variables with Text
Placing Text before a Macro Variable Reference
Placing Text after a Macro Variable Reference
Concatenating Permanent SAS Data Set Names and Catalog Names with Macro Variables
Referencing Macro Variables Indirectly
Chapter 4 Macro Programs
Introduction
Creating Macro Programs
Executing a Macro Program
Displaying Notes about Macro Program Compilation in the SAS Log
Displaying Messages about Macro Program Processing in the SAS Log
Using MPRINT to Display the SAS Statements Submitted by a Macro Program
Using the MLOGIC Option to Trace Execution of a Macro Program
Passing Values to a Macro Program through Macro Parameters
Specifying Positional Parameters in Macro Programs
Specifying Keyword Parameters in Macro Programs
Specifying Mixed Parameter Lists in Macro Programs
Defining a Macro Program That Can Accept a Varying Number of Parameter Values
Chapter 5 Understanding Macro Symbol Tables and the Processing of Macro Programs
Understanding Macro Symbol Tables
Understanding the Global Macro Symbol Table
Understanding Local Macro Symbol Tables
Working with Global Macro Variables and Local Macro Variables
Defining the Domain of a Macro Variable by Using the %GLOBAL or %LOCAL Macro Language Statements
Processing of Macro Programs
How a Macro Program Is Compiled
How a Macro Program Executes
Chapter 6 Macro Language Functions
Introduction
Macro Character Functions
Macro Evaluation Functions
Macro Quoting Functions
Macro Variable Attribute Functions
Other Macro Functions
SAS Supplied Autocall Macro Programs Used Like Functions
Chapter 7 Macro Expressions and Macro Programming Statements
Introduction
Macro Language Statements
Constructing Macro Expressions
Understanding Arithmetic Expressions
Understanding Logical Expressions
Understanding the IN Operator As Used in Macro Language Statements
Conditional Processing with the Macro Language
Iterative Processing with the Macro Language
Writing Iterative %DO Loops in the Macro Language
Conditional Iteration with %DO %UNTIL
Conditional Iteration with %DO %WHILE
Branching in Macro Processing
Chapter 8 Masking Special Characters and Mnemonic Operators
Introduction
Why Are Quoting Functions Called Quoting Functions?
Illustrating the Need for Macro Quoting Functions
Describing the Commonly Used Macro Quoting Functions
Understanding How Macro Quoting Functions Work
Applying Macro Quoting Functions
Specifying Macro Program Parameters That Contain Special Characters or Mnemonic Operators
Unmasking Text and the %UNQUOTE Function
Using Quoting Versions of Macro Character Functions and Autocall Macro Programs
Chapter 9 Interfaces to the Macro Facility
Introduction
Understanding DATA Step Interfaces to the Macro Facility
Understanding the SYMGET Function
Understanding the SYMPUT and SYMPUTX Call Routines
Understanding the CALL EXECUTE Routine
Understanding the RESOLVE Function
Using Macro Facility Features in PROC SQL
Creating and Updating Macro Variables with PROC SQL
Using the Macro Variables Created by PROC SQL
Displaying Macro Option Settings with PROC SQL and Dictionary Tables
Part 2: Applying Your Knowledge of Macro Programming
Chapter 10 Storing and Reusing Macro Programs
Introduction
Saving Macro Programs with the Autocall Facility
Creating an Autocall Library
Making Autocall Libraries Available to Your Programs
Maintaining Access to the Autocall Macro Programs That Ship with SAS
Using the Autocall Facility under UNIX and z/OS Systems
Saving Macro Programs with the Stored Compiled Macro Facility
Setting SAS Options to Create Stored Compiled Macro Programs
Creating Stored Compiled Macro Programs
Saving and Retrieving the Source Code of a Stored Compiled Macro Program
Encrypting a Stored Compiled Macro Program
Resolving Macro Program References When Using the Autocall Facility and the Stored Compiled Macro Facility
Chapter 11 Building a Library of Utilities
Introduction
Writing a Macro Program to Behave Like a Function
Programming Routine Tasks
Chapter 12 Debugging Macro Programming and Adding Error Checking to Macro Programs
Introduction
Understanding the Types of Errors That Can Occur in Macro Programming
Minimizing Errors in Developing SAS Programs That Contain Macro Language
Categorizing and Checking for Common Problems in Macro Programming
Understanding the Tools That Can Debug Macro Programming
Using SAS System Options to Debug Macro Programming
Using Macro Language Statements to Debug Macro Programming
Using Macro Functions to Debug Macro Programming
Using Automatic Macro Variables to Debug Macro Programming
Examples of Solving Errors in Macro Programming
Improving Your Macro Programming by Including Error Checking
Chapter 13 A Stepwise Method for Writing Macro Programs
Introduction
Building a Macro Program in Four Steps
Applying the Four Steps to an Example
Step 1: Write, test, and debug the SAS program(s) that you want the macro program to build
Step 2: Remove hard-coded programming constants from the program(s) in Step 1 and replace these constants with macro variables
Step 3: Create macro program(s) from the program(s) in Step 2
Step 4: Refine and generalize the macro program(s) in Step 3 by adding macro language statements like %IF-%THEN and %DO groups
Executin

  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents