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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.