Index
Special Characters
/NOSECURE option
error message 426
/SECURE option
error message 426
/SOURCE option
error message 425, 426
. (period)
creating, to follow resolved text 35
. (period) delimiter 13
& (ampersand)
indirect macro variable references and
37
& (ampersand) delimiter 4
% (percent sign)
with %STR and %NRSTR functions 88
% (percent) delimiter 4
%* macro comment statement 304
%ABORT statement 302
error message 423, 424, 427
%BQUOTE and %NRBQUOTE functions
260
%BQUOTE function 91
examples 91
%BY statement
error message 401
%CMPRES and %QCMPRES autocall
macros 179
%COMPSTOR autocall macro 181
%COPY statement 306
error message 424, 425
%DATATYP autocall macro 181
%DISPLAY statement 307
error message 406, 408, 410, 411, 412
%DO %UNTIL loop
error message 413
%DO %UNTIL statement 311
%DO %WHILE loop
error message 413
%DO %WHILE statement 312
%DO groups
ending 313
%DO loop
error message 405, 408
%DO loops
generating repetitive pieces of text 12
%DO statement 308
error message 398, 399, 401, 402, 403,
404
%DO, iterative statement 309
%ELSE statement
error message 398, 399
%END statement 313
error message 398, 399
%EVAL function 261
error message 393, 395, 397, 403, 405
%GLOBAL statement 314
error message 398, 427
%GO
error message 407
%GOTO statement 316
destination of 321
error message 399, 400, 407
%IF statement
error message 395, 398, 399, 403
%IF-%THEN/%ELSE statement 317
%INCLUDE statement 4
%INDEX function 263
%INPUT statement 320
text entered in response to 199
warning message 433
%KVERIFY autocall macro 182
%label statement 321
%LEFT autocall macro 183
%LENGTH function 263
%LET statement 322
error message 418, 419
%LIST statement 4
%LOCAL statement 323
error message 399, 427
%LOWCASE and %QLOWCASE
autocall macros 184
%MACRO statement 325
error message 397
PARMBUFF option 329
SECURE option 330
SOURCE option 330
STORE option 330
487
with keyword parameters 329
with positional parameters 328
%MEND statement 331
error message 397
warning message 430, 431
%NRBQUOTE function 91, 264
%NRQUOTE function 264
%NRSTR function 87, 265
examples 90
unmatched quotation marks and
parentheses 88
%PUT statement 332
error message 428
tracking problems with 140
%QCMPRES autocall macro 185
%QLEFT autocall macro 185
%QLOWCASE autocall macro 186
%QSCAN function 265
%QSUBSTR function 265
%QSYSFUNC function 266
error message 415, 416, 418, 420
warning message 433
%QTRIM autocall macro 187
%QUOTE and %NRQUOTE functions
266
%QUPCASE function 267
%RETURN statement 335
%RUN statement 4
%SCAN and %QSCAN functions 268
%STR and %NRSTR functions 272
%STR function 87
examples 89
percent signs with 88
unmatched quotation marks and
parentheses 88
%SUBSTR and %QSUBSTR functions
275
%SUPERQ function 277
entering macro keywords 95
examples 93
preventing warning messages 94
%SYMDEL statement 336
warning message 434
%SYMEXIST function 278
%SYMGLOBL function 279
%SYMLOCAL function 280
%SYSCALL statement 336
error message 416, 418, 420, 422
RANUNI CALL routine with 338
%SYSEVALF
error message 416
%SYSEVALF function 281
error message 417, 420
%SYSEXEC statement 338
%SYSFUNC and %QSYSFUNC
functions 283
%SYSFUNC function
error message 415, 416, 418, 420
formatting values produced by 285
functions and arguments for 439
portable functions with 150
warning message 433
%SYSGET function 287
warning message 432
%SYSLPUT statement 339
error message 422, 423
%SYSMACDELETE statement 341
warning message 435
%SYSMACEXEC function 288
%SYSMACEXIST function 288
%SYSMEXECDEPTH function 288
%SYSMEXECNAME function 290
%SYSMSTORECLEAR statement 342
warning message 435
%SYSPROD function 291
%SYSRC autocall macro 187
%SYSRPUT statement 342
checking return code values on remote
host 113
error message 413, 418, 419
with SAS/CONNECT interfaces 113
%THEN statement
error message 399, 406
warning message 433
%TO statement
error message 402
%TRIM and %QTRIM autocall macro
192
%UNQUOTE function 292
%UPCASE and %QUPCASE functions
293
%VERIFY autocall macro 194
%WINDOW statement 345
error message 406, 408, 411, 412
A
aborting macros 302
ampersand (&) delimiter 4
ampersands
indirect macro variable references and
37
application welcome window 350
arguments
left-aligning 183, 185
arithmetic expressions 73
defining 74
evaluating 74, 76
evaluating with floating-point arithmetic
281
evaluating with integer arithmetic 261
operands and operators 75
488 Index
assigning macro variables 54
autocall facility 115
macro definition errors 133
naming macros and external files for
156
troubleshooting 132
autocall feature 359
autocall libraries 115, 116
catalogs as 117
directories as 117
location of 382
member names 117
on different hosts 116
saving macros in 116
searching for member not found earlier
378
specification errors 133
autocall macros 14, 171
calling 118
displaying source location in log 357
filenames for 134
list of 172
names for 134
required system options for 172
storing 120
storing centrally 148
supplied by SAS 120
automatic evaluation 159
automatic macro variables 14, 24, 167
by category 25
defined by macro processor 24
displaying in log 334
host-specific values 151
list of 167
prefixes 167
read and write status of 24
B
batch jobs
name of 214
black hole problem 128
blanks
compressing multiple 179, 185
maintaining leading blanks 273
protecting from being compiled as text
273
removing from macro variables 245
removing leading and trailing 179, 183,
185
trimming trailing blanks 187, 192
C
CALL EXECUTE routine 237
example of common problem with 106
example of incorrect use 105
timing details 105
CALL routines
invoking 336
CALL SYMDEL routine 239
CALL SYMPUT routine 240
formatting rules for assigning character
values 243
formatting rules for assigning numeric
values 243
referencing a value before it is available
242
scope and 65, 242
with complete DATA step and empty
local symbol table 70
with complete DATA step and
nonempty local symbol table 66
with incomplete DATA step 68
with SYSPBUFF and empty local
symbol table 71
CALL SYMPUTN routine 244
CALL SYMPUTX routine 245
calling autocall macros 118
calling macros 9, 39
calling stored compiled macros 120
case changes 184, 186, 293
case sensitivity 12, 116
catalogs
as autocall libraries 117
libref for catalog containing stored
compiled macros 384
searching for stored compiled macros
380
centrally storing autocall macros 148
character functions 161
character operands
comparing in logical expressions 79
character strings
passing to SAS programs 219, 386
substring of 275
character values
formatting rules for assigning 243
character width value 200
characters
locating 263
translating 286
CMDMAC system option 354
code
conditionally generating SAS code 12
generating SAS code using macros 9
column values
storing in declared macro variables 298
command line
error message 408
warning message 433
command style macros 145
Index 489
command-style macros
invoking 354
comments 10, 304
compilation
note on size and number of instructions
360
compilation functions 83
compilation quoting functions 164
compiled items 40
compiled macros
executing 42
compiled stored macro
error message 421, 422
compiler 17
compiling macro definitions 40, 119
compressing blanks 179, 185
condition codes 200
conditional execution 238
conditional processing 317
conditionally generating SAS code 12
constant text 9
CPU
number available to SAS 218
customized windows 345
application welcome window 350
D
damaged data sets 206
data files
name of file most recently created 214
data sets
confirming existence of 286
creating macro variables and assigning
values from 244
damaged 206
determining number of variables and
observations in 285, 286
libref and name of most recently created
206
retrieving variable values previously
assigned from 253
DATA step
assigning values to macro variables 240
functions in 108
interacting with macro facility during
execution 104
passing values into a parameter list 239
resolving text expressions during
execution 249
returning value of macro variable,
during execution 252
DATA step compiler 17
macro resolution problems during
compilation 131
DATA step interfaces 104, 170
CALL EXECUTE routine timing details
105
example of common problem with
CALL EXECUTE routine 106
listed by category and use 104
using CALL EXECUTE routine
incorrectly 105
data type 181
dates
execution date for SAS job or session
203, 204
execution day for SAS job or session
205
formatting current date in a TITLE
statement 285
day of the week
for execution of SAS jobs or sessions
205
debugging 122
autocall facility 132
autocall library specifications 133
autocall macro definition errors 133
black hole problem 128
common macro problems 123
developing bug-free macros 123
developing macros in layered approach
122
displaying information about stored
compiled macros 134
encountering errors 122
examining generated SAS statements
137
examining macro variable resolution
139
expression evaluation 135
file and macro names for autocall 134
macro functions 128
macro variable resolution 125
macro variable scope 126
nesting information generated by
MLOGICNEST 137
nesting information generated by
MPRINTNEST 138
open code recursion 127
storing MPRINT output in external file
138
techniques for 136
timing issues 130
tracing flow of execution 136
tracing generated statements for 375
tracing macro execution for 372
tracing resolution of macro variable
references 385
tracking %PUT statement problems
140
tracking system option problems 136
490 Index
troubleshooting macros 123
unresolved macros 128
warning messages and 122
defining macros 9, 39
delete macro variable
warning message 434
delimiters 4
delimiting macro variable names within
text 34
for IN operator 369
period as 13
delta character 99
DES= option
error message 414
device type
%INCLUDE file 212
directories
as autocall libraries 117
directory
%INCLUDE file 213
double quotation marks 8
dummy macro
error message 410
dummy macros 41, 128
E
eaual sign
error message 402
efficient macros
See macros, efficient
encoding
for SAS sessions 207
ENCODING= system option
warning message 436
error conditions
%SYSRC mnemonics for 187
error messages 124, 393
text of last message generated in log
211
error return codes 209
error types 122
errors
debugging and 122
evaluation functions 162
executing compiled macros 42
execution errors 122
execution functions 84
execution, tracing flow of 136
existence of data sets 286
existence of macro variables 251, 278
exits
providing in a large macro 316
expression
error message 403
expressions
See also macro expressions
generating indirect macro variable
references with 36
troubleshooting evaluation problems
135
external files
naming for autocall facility 156
routing MPRINT output to 368, 377
storing MPRINT output in 138
F
fields overlapped
warning message 431
filename
%INCLUDE file 213
FILENAME statement
return code from 212
fileref
%INCLUDE file 213
filerefs
limiting to eight characters 276
verifying 194
floating-point evaluation 281
floating-point operands
evaluating 77
floating-point values
comparing in logical expressions 78
flow of execution, tracing 136
forcing local macro variables 61
functions
See also macro functions
See also macro quoting functions
assigning results to macro variables 146
executing 283
for use with %SYSFUNC function 439
in DATA step and macro facility 108
portable 150
user-written 283
G
global macro variables 8, 24, 49, 50
creating 63, 314
creating in macro definitions 315
creating, based on value of local
variables 65
indicating whether macro variables are
global 256
returning values as numeric 255
with same name as a local variable 324
global symbol table 50
deleting variables from 239, 336
graphics device 205
group name
error message 411
Index 491
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset