BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
twildone
Pyrite | Level 9

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.

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

View solution in original post

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Steelers_In_DC
Barite | Level 11

Right, I think the fix to that is delete &dn1,.  I like those kind of fixes.

twildone
Pyrite | Level 9

Thanks RW9 & Mark Johnson....your explanation and suggestion was very helpful and resolved theproblem...I removed the &dn1 and fixed everything...thanks once again.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 3 replies
  • 1387 views
  • 4 likes
  • 3 in conversation