hi, when i run the below code, i have some syntax error. please help me to compile them without error. /****************************************************************************************************/ /* Check missing LOS 1 */ /****************************************************************************************************/ %macro Check_LOS; %do x=1 %to &Month.; data M&x; set &FieldFileAppnd.; if (month=(1+&x) and los=2); run; %create_list(M&x, agent_code, A&x, 2); %put &&A.&x.; proc print data=&FieldFileAppnd.; var agent_code club month los rank status; where agent_code in (&&A&x); run; data L&x; set &FieldFileAppnd.; if agent_code in (&&A&x); if month=&x and los=0; run; proc print data=L&x; var agent_code club month los rank status; run; %end; %mend; %Check_LOS; %macro LOS_Merge; data LOS_Merge; set %do x=1 %to &Month.; L&x %end;; run; /*%end;*/ %mend; %LOS_Merge; proc sort data=LOS_Merge; by agent_code month los; run; proc print data=LOS_Merge; var agent_code club month los rank status; run; /* Check missing LOS 1 - Join to Field File to pull other fields */ proc sql; create table LOS_Check as select a.agent_code, a.club, a.month, a.los, a.rank, a.status, b.agent_code from &FieldFileAppnd. as a, LOS_Merge as b where a.agent_code=b.agent_code; quit; proc sort data=LOS_Check; by agent_code month; run; title1 'Check missing LOS 1'; proc print data=LOS_Check; run; proc export data=LOS_Check outfile="&Dir.\FFIssues" dbms=xlsx replace; run; Error: SYMBOLGEN: Macro variable X resolves to 8 NOTE 137-205: Line generated by the invoked macro "CHECK_LOS". 38 proc print data=&FieldFileAppnd.; var agent_code club month los rank status; where 38 ! agent_code in (&&A&x); run; data L&x; set &FieldFileAppnd.; if agent_code in - 22 38 ! (&&A&x); if month=&x and los=0; run; proc print data=L&x; var agent_code club ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant, a missing value. NOTE: Line generated by the invoked macro "CHECK_LOS". 38 proc print data=&FieldFileAppnd.; var agent_code club month los rank status; where 38 ! agent_code in (&&A&x); run; data L&x; set &FieldFileAppnd.; if agent_code in - 76 38 ! (&&A&x); if month=&x and los=0; run; proc print data=L&x; var agent_code club ERROR 76-322: Syntax error, statement will be ignored. SYMBOLGEN: Macro variable A8 resolves to MPRINT(CHECK_LOS): where agent_code in (); ERROR: Syntax error while parsing WHERE clause. MPRINT(CHECK_LOS): run;
... View more