hi all. Due to @Reeza, recomendation im opening this thread. I am new at sas and having some issues with %IF %ELSE conditions, I am trying to write a macro to execute some code on the when the last date, on a data set, is from "today - 1" but whe i run the macro it keep giving the error "Required operator not found in expression" /* +++++++++ Variables*/ rsubmit; proc sql; select max(offer_Date) into :valDateSales from qwer ; quit; proc sql; select max(offer_Date) into :valDateOffers from asdf; quit; %let maxDateSales= %sysfunc(substrn(&valDateSales.,1,9)); %let maxDateOffers= %sysfunc(substrn(&valDateOffers.,1,9)); endrsubmit; /* +++++++++ MACRO*/ %macro Continuity(MaxDateSales, MaxDateOffers);
%Let yesterday = %eval(%sysfunc(today())-1);
%if ("&MaxDateSales."d eq "&yesterday."d)%then %do;
%if ("&MaxDateOffers."d eq "&yesterday."d)) %then %do;
%export_to_Drive(ds=workunx.X, outf_name=ASDF..csv)
%export_to_Drive(ds=workunx.Y, outf_name=qwer.csv)
%export_to_ftp(dsn=workunx.x,outfile_name=asdf..csv));
%export_to_ftp(dsn=workunx.Y ,outfile_name=qwer..csv));
%successMailing();
%put "succes statement";
%end;
%else %do;
%failMailing();
%end
%else %do;
%failMailing();
%put "fail statement";
%end;
%mend; /*++++++LOG 693 %Continuity(MaxDateSales=&MaxDateSales., MaxDateOffers=&MaxDateOffers.);
MLOGIC(CONTINUITY): Beginning execution.
SYMBOLGEN: Macro variable MAXDATESALES resolves to 20806
SYMBOLGEN: Macro variable MAXDATEOFFERS resolves to 20806
MLOGIC(CONTINUITY): Parameter MAXDATESALES has value 20806
MLOGIC(CONTINUITY): Parameter MAXDATEOFFERS has value 20806
MLOGIC(CONTINUITY): %LET (variable name is YESTERDAY)
SYMBOLGEN: Macro variable MAXDATESALES resolves to 20806
SYMBOLGEN: Macro variable YESTERDAY resolves to 20806
MLOGIC(CONTINUITY): %IF condition ("&MaxDateSales."d eq "&yesterday."d) is TRUE
SYMBOLGEN: Macro variable MAXDATEOFFERS resolves to 20806
SYMBOLGEN: Macro variable YESTERDAY resolves to 20806
ERROR: Required operator not found in expression: ("&MaxDateOffers."d eq "&yesterday."d))
ERROR: The macro CONTINUITY will stop executing.
MLOGIC(CONTINUITY): Ending execution.
NOTE: Remote submit to A complete. well as i have said, i am new at SAS so please, any help will be appreciated.
... View more