Good book. It actually repeats macro references in 'SAS help' with some additions. So you can find all this information in 'SAS help' but I think that to have a book for your library is more convnient. It explains quite well how macro processor works behind the screen. This book contains more than e
SAS 9.2 Macro Language: Reference
โ Scribed by SAS Publishing
- Publisher
- SAS Publishing
- Year
- 2009
- Tongue
- English
- Leaves
- 385
- Edition
- 1
- Category
- Library
No coin nor oath required. For personal study only.
โฆ Synopsis
Explains how to increase the modularity, flexibility, and maintainability of your SAS code using the SAS macro facility. Provides complete information about macro language elements, interfaces between the SAS macro facility and other parts of SAS software, and macro processing in general.
โฆ Table of Contents
Contents......Page 4
New Automatic Macro Variables......Page 8
New Options for the %MACRO Statement......Page 9
Understanding and Using the Macro Facility......Page 10
Getting Started with the Macro Facility......Page 12
Replacing Text Strings Using Macro Variables......Page 13
Defining Macros......Page 14
Inserting Comments in Macros......Page 15
Passing Information into a Macro Using Parameters......Page 16
Conditionally Generating SAS Code......Page 17
Generating a Suffix for a Macro Variable Reference......Page 18
Other Features of the Macro Language......Page 19
Introduction to SAS Programs and Macro Processing......Page 20
How SAS Processes Statements without Macro Activity......Page 21
How SAS Processes Statements with Macro Activity......Page 23
Introduction to Macro Variables......Page 28
Macro Variables Defined by the Macro Processor......Page 29
Overview for Defining Macro Variables......Page 31
Creating Macro Variables and Assigning Values......Page 32
Macro Variable Reference......Page 34
Combining Macro Variable References with Text......Page 35
Delimiting Macro Variable Names within Text......Page 36
Displaying Macro Variable Values......Page 37
Generating a Series of Macro Variable References with a Single Macro Call......Page 38
Manipulating Macro Variable Values with Macro Functions......Page 39
Defining and Calling Macros......Page 42
How the Macro Processor Compiles a Macro Definition......Page 43
How the Macro Processor Executes a Compiled Macro......Page 45
Summary of Macro Processing......Page 50
Introduction to the Scopes of Macro Variables......Page 52
Global Macro Variables......Page 53
Local Macro Variables......Page 54
Writing the Contents of Symbol Tables to the SAS Log......Page 55
How Macro Variables Are Assigned and Resolved......Page 56
Changing the Values of Existing Macro Variables......Page 59
Creating Local Variables......Page 61
Forcing a Macro Variable to Be Local......Page 65
Creating Global Macro Variables......Page 68
Special Cases of Scope with the CALL SYMPUT Routine......Page 69
Example Using CALL SYMPUT with Complete DATA Step and a Nonempty Local Symbol Table......Page 70
Example Using CALL SYMPUT with an Incomplete DATA Step......Page 73
Example Using CALL SYMPUT with SYSPBUFF and an Empty Local Symbol Table......Page 75
Introduction to Macro Expressions......Page 78
Operands and Operators......Page 79
Evaluating Numeric Operands......Page 81
Evaluating Floating-Point Operands......Page 82
Comparing Floating-Point or Missing Values......Page 83
Comparing Character Operands in Logical Expressions......Page 84
Macro Quoting......Page 86
Understanding Why Macro Quoting Is Necessary......Page 87
Overview of Macro Quoting Functions......Page 88
Deciding When to Use a Macro Quoting Function and Which Function to Use......Page 89
Using %STR and %NRSTR Functions......Page 92
Using % Signs with %STR......Page 93
Examples Using %NRSTR......Page 94
Examples Using %BQUOTE......Page 96
Deciding How Much Text to Mask with a Macro Quoting Function......Page 97
Examples Using %SUPERQ......Page 98
Using the %SUPERQ Function to Enter Macro Keywords......Page 99
Summary of Macro Quoting Functions and the Characters They Mask......Page 101
Restoring the Significance of Symbols......Page 102
Example of Unquoting......Page 103
How Macro Quoting Works......Page 104
Example Using the %QSCAN Function......Page 105
Introduction to Interfaces with the Macro Facility......Page 108
CALL EXECUTE Routine Timing Details......Page 109
Example of Using CALL EXECUTE Incorrectly......Page 110
Example of Common Problem with CALL EXECUTE......Page 111
Using SAS Language Functions in the DATA Step and Macro Facility......Page 112
INTO Clause......Page 113
Using an SCL Program......Page 114
Referencing Macro Variables in Submit Blocks......Page 115
Example Using Macros in an SCL Program......Page 116
Example Using %SYSRPUT to Check the Value of a Return Code on a Remote Host......Page 117
Introduction to Storing and Reusing Macros......Page 120
Using Directories as Autocall Libraries......Page 121
Calling an Autocall Macro......Page 122
Overview of the Stored Compiled Macro Facility......Page 123
Storing Autocall Macros Supplied by SAS......Page 124
Calling a Stored Compiled Macro......Page 125
Developing Macros in a Layered Approach......Page 126
Developing Bug-free Macros......Page 127
Solving Common Macro Problems......Page 128
Solving Macro Variable Resolution Problems......Page 130
Solving Problems with Macro Variable Scope......Page 131
Solving Open Code Statement Recursion Problems......Page 132
Solving the "Black Hole" Macro Problem......Page 133
Resolving Timing Issues......Page 134
Resolving Macro Resolution Problems Occurring During DATA Step Compilation......Page 135
Fixing Autocall Library Specifications......Page 137
Fixing Autocall Macro Definition Errors......Page 138
Displaying Information about Stored Compiled Macros......Page 139
Solving Problems with Expression Evaluation......Page 140
Tracing the Flow of Execution with MLOGIC......Page 141
Examining the Generated SAS Statements with MPRINT......Page 142
Storing MPRINT Output in an External File......Page 143
Examining Macro Variable Resolution with SYMBOLGEN......Page 144
Using the %PUT Statement to Track Problems......Page 145
Keeping Efficiency in Perspective......Page 148
Use Macros Wisely......Page 149
Avoid Nested Macro Definitions......Page 150
Assign Function Results to Macro Variables......Page 151
Use the Stored Compiled Macro Facility......Page 152
Storing Only One Copy of a Long Macro Variable Value......Page 153
Using Portable SAS Language Functions with %SYSFUNC......Page 155
Using Automatic Variables with Host-Specific Values......Page 156
SYSPARM Details......Page 158
Macro Language Elements with System Dependencies......Page 159
Naming Macros and External Files for Use with the Autocall Facility......Page 160
Introduction to Macro Language Elements......Page 162
Using Macro Statements......Page 163
Using Macro Functions......Page 164
Macro Character Functions......Page 165
Macro Evaluation Functions......Page 166
Compilation Quoting Functions......Page 167
Quotation Marks and Parentheses without a Match......Page 168
Automatic Macro Variables......Page 169
Interfaces with the Macro Facility......Page 171
Overview of Provided Autocall Macros......Page 172
Using Autocall Macros......Page 173
Selected System Options Used in the Macro Facility......Page 174
Macro Language Dictionary......Page 176
AutoCall Macros......Page 178
Automatic Macro Variables......Page 192
DATA Step Call Routines for Macros......Page 218
DATA Step Functions for Macros......Page 228
Macro Functions......Page 238
SQL Clauses for Macros......Page 272
Macro Statements......Page 276
System Options for Macros......Page 322
Appendices......Page 352
Reserved Words......Page 354
List of Tokens......Page 356
Summary Descriptions and Syntax......Page 358
Recommended Reading......Page 362
Glossary......Page 364
Index......Page 370
๐ SIMILAR VOLUMES
Increase the modularity, flexibility, and maintainability of your SAS code with the SAS macro facility! This comprehensive reference provides complete descriptions of macro language features and of interfaces between the macro facility and other parts of SAS software. Chapters on debugging macros an
Provides comprehensive reference information for the Base SAS language, which is available in all operating environments that support SAS. This document is organized by data set options, formats, functions and CALL routines, informats, ARM macros, statements, system options, and component objects. T
SAS Component Language (SCL) provides the power and flexibility to build all types of applications, from simple programs to sophisticated systems. This reference guide shows you how to use SCL to build the real-world applications that your organization requires. For the novice applications developer
This manual provides you with a complete reference to all features of the SAS language that are not specific to an operating system. It contains data set options, formats and informats, functions and CALL routines, statements and system options, and more.