Hi...I have a macro that I run but keep getting a warning message. The macro does run and produce the output but I would like to resolve the error message. I tried using %Let dn1=&dn1 but that didn't work...any sugestions...thanks
%LET Eff_Date1=20150722;
%LET Exp_Date1=99999999;
%LET load_date=20150722;
%LET OldDin=02414716;
%LET fil1=chocolate;
DATA PRNS;
LENGTH PRN $ 8;
INPUT PRN $;
DATALINES;
02429659
%MACRO INSERTS(Eff_Date,Exp_Date,Prn,Dn,fil);
PROC SQL NOPRINT;
CREATE TABLE mydata AS
SELECT
PLAN.ID,
PLAN.PRN,
PLAN.EX_EFF_DATE,
PLAN.EX_EXP_DATE,
PLAN.APPLICATION_DATE
FROM FPIN.PLAN
WHERE
( PLAN.FLAG = "Y" )
AND
( PLAN.OVERRIDE = 99 )
AND
( PLAN.PRN = "&Prn" )
AND
( PLAN.EX_EXP_DATE ^= 99999999)
AND
(( PLAN.EX_EFF_DATE <= &Exp_Date )
AND
( PLAN.EX_EXP_DATE >= &Eff_Date ))
;
PROC SORT DATA=mydata;
BY ID PRN EX_EFF_DATE EX_EXP_DATE APPLICATION_DATE;
RUN;
%MEND INSERTS;
%INSERTS(&Eff_Date1, &Exp_Date1, &OldPrn, &Dn1, &fil1);
LOG OUTPUT:
32 %MEND INSERTS;
633
634 %INSERTS(&Eff_Date1, &Exp_Date1, &OldPrn, &Dn1, &fil1);
WARNING: Apparent symbolic reference DN1 not resolved.
Its not an error. What it is telling you is that nowhere in the code you have posted is a macro variable called DN1 created or given a value, hence when you use that in &DN1. the macro compiler has nothing to replace that reference with, so the warning is there to inform of that case.
Why are these even in your macro call though as &DN. is not used in the macro, nor is &FIL. so they are irrelevant and can be removed, and then you would get rid of the warning about &DN1. as well.
Its not an error. What it is telling you is that nowhere in the code you have posted is a macro variable called DN1 created or given a value, hence when you use that in &DN1. the macro compiler has nothing to replace that reference with, so the warning is there to inform of that case.
Why are these even in your macro call though as &DN. is not used in the macro, nor is &FIL. so they are irrelevant and can be removed, and then you would get rid of the warning about &DN1. as well.
Right, I think the fix to that is delete &dn1,. I like those kind of fixes.
Thanks RW9 & Mark Johnson....your explanation and suggestion was very helpful and resolved theproblem...I removed the &dn1 and fixed everything...thanks once again.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.