BookmarkSubscribeRSS Feed
Miracle
Barite | Level 11

Dear All,
Could you please to point out what have I done wrong given the following errors? 

Thanking you in advance.

ERROR: Required operator not found in expression: &sub eq
ERROR: The macro REPEAT will stop executing.

ods output LSMeans=LSM_all_&param
SliceDiffs=SDiff_all_&param;
proc mixed data=inds;
%if &sub ne %then by &byvar;
where PARNAM1C="&param" and 1<=vis<=13;
class id resp tx sex vis / ref=first;
model chg=resp tx sex resp*vis / s ddfm=kenwardroger;
lsmeans resp*vis / cl;
repeated vis / subject=id type=&cov;
slice resp*VIS / sliceby=vis pdiff cl;
run;
ods output close;
1 REPLY 1
PaigeMiller
Diamond | Level 26

Macro variable &SUB does not exist. You also need two semi-colons on this line:

 

%if &sub ne %then by &byvar;;

One ends the %IF and one ends the BY

 

From now on, if you hare having problems with MACRO code, please use 

 

options mprint symbogen mlogic;

at the start of your program.


From now on, do not show us parts of the log disconnected from the code. Show us the LOG from PROC MIXED (or whatever PROC you are using) including the code and ERRORs/WARNINGs in the order they appear in the LOG, without modification, and without you selecting certain parts of the log of PROC MIXED (or whatever PROC you are using) to show us and not showing us other parts.

 

 

--
Paige Miller

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 769 views
  • 1 like
  • 2 in conversation