Hopefully, someone can help me with a macro question. Here’s a
stripped-down version of the program:
*** Specify a set of years;
%LET A = 1997; %*Set start year;
%LET B = %EVAL(&A +1);
%LET C = %EVAL(&A +2);
%LET D = %EVAL(&A +3);
%LET E = %EVAL(&A +4);
%LET F = %EVAL(&A +5);
%DO X=&E %TO &F;
DATA T&X; INFILE TAP&X; INPUT
@10 GRDT&X 2. @17 LVLT&X 2. @19 STBL&X $1. @20 SPC_CODE $3.
@24 BILIND 1. @29 LEPCD 1. @72 SID 8. @166 RPR&X 2.
@635 ACCOM 1. @698 UNT&X 4.;
%IF RPR&X < 25 %THEN Q&X=1; %ELSE Q&X=2;
PROC PRINT DATA=T&X (OBS=5);
The larger program can be run for 6 years or fewer and requires numerous
references to variables with a year suffix (e.g., unt2001, unt2002). The
objective is to update those references easily. The program runs fine
without the %IF statement. However, once that statement is inserted, I get
the following error message:
Line generated by the invoked macro "RDCTAP".
Syntax error, expecting one of the following: !, !!, &, *, **, +, -, /, LE,
LT, MAX, MIN, NE, NG, NL, OR, =, |, ||, ~=.<, <=, <>, =, >, ><, >=, AND, EQ,
Curiously, if I alter the statement to IF, THEN, ELSE without the %, it runs
correctly. Does anyone know why? Also, many thanks to Ian Whitlock and Ron
Fehd for their help with a previous macro question.
Send and receive Hotmail on your mobile device: http://mobile.msn.com