do i=1 to 3;
IF ITEM=1 THEN itematt&i=1;
180: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL may allow recovery of the LINE and COLUMN where
the error has occurred.
ERROR 180-322: Statement is not valid or it is used out of proper order.
MPRINT(MISQMATRIX): data qmatrix;
MPRINT(MISQMATRIX): set qmatrix;
MPRINT(MISQMATRIX): IF ITEM=1 THEN itematt1-itematt3=1 ;
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.QMATRIX may be incomplete. When this step was stopped there were 0
observations and 4 variables.
WARNING: Data set WORK.QMATRIX was not replaced because this step was stopped.
Curious how this post fits into the Statistical Procedures forum?
Suggest you get rid of the macro and get your standalone SAS DATA step working before making it more flexible with macro language elements. Substitute constants (or if absolutely necessary use static macro variables).