thanks, I changed the syntax to this and still it does not run.
%macro MISQMATRIX;
%let num_skills=3;
DATA Q_MATRIX_WR;
set QMatrix;
array skills(&num_skills);
do i=1 to &num_skills;
IF question=1 THEN skills1=1 skills2=1 skills3=1;
ELSE
skills(i)=1- skills(i);
END;
drop i;
run;
%mend;
ERROR:
NOTE 137-205: Line generated by the invoked macro "MISQMATRIX".
1 DATA Q_MATRIX_WR; set QMatrix; array skills(&num_skills); do i=1 to &num_skills; IF
1 ! question=1 THEN skills1=1 skills2=1 skills3=1; ELSE skills(i)=1- skills(i); END; drop i;
-------
22
1 ! run;
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, -, /, ;, <, <=,
<>, =, >, ><, >=, AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, ^=,
|, ||, ~=.
MPRINT(MISQMATRIX): do i=1 to 3;
NOTE 137-205: Line generated by the invoked macro "MISQMATRIX".
1 DATA Q_MATRIX_WR; set QMatrix; array skills(&num_skills); do i=1 to &num_skills; IF
1 ! question=1 THEN skills1=1 skills2=1 skills3=1; ELSE skills(i)=1- skills(i); END; drop i;
-------
22
1 ! run;
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, -, /, ;, <, <=,
<>, =, >, ><, >=, AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, ^=,
|, ||, ~=.
MPRINT(MISQMATRIX): IF question=1 THEN skills1=1 skills2=1 skills3=1 ;
MPRINT(MISQMATRIX): ELSE skills(i)=1- skills(i);
MPRINT(MISQMATRIX): END;
MPRINT(MISQMATRIX): drop i;
MPRINT(MISQMATRIX): run;
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.Q_MATRIX_WR may be incomplete. When this step was stopped there were
0 observations and 4 variables.