![]() Chapter Contents |
![]() Previous |
![]() Next |
| MACEXPAND |
| Abbreviation: | MACX |
| Syntax | |
| Details | |
| Example |
Syntax |
| MACEXPAND line-num |
| Details |
The MACEXPAND command expands macro invocations and macro variables. The expansion is displayed in the debugger window. If the line does not contain a macro invocation or a macro variable reference, then the MACEXPAND command is ignored.
| Example |
In this example, the program contains the macro VALAMNT:
%macro valamnt(amount);
if amount <0 or amount >500 then
do;
erroron amount;
_msg_='Amount must be between $0 and $500.';
stop;
end;
else erroroff amount;
%mend valamnt;
Line 33 of the SCL program calls the macro:
%valamnt(amt)
After entering 250 into the Amount
control, enter in the debugger window:
DEBUG> macx 33The debugger window displays the following output:
AMOUNT $T0 = AMOUNT < 0 $T1 = AMOUNT > 500 $T2 = $T0 OR $T1 IF $T2 == 0 THEN #24 ERRORON(AMOUNT) _MSG_ = 'Amount must be between $0 and $500.' STOP JUMP #26 ERROROFF(AMOUNT)
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.