DATA Step, Macro, Functions and more

re: Warning Message

Accepted Solution Solved
Reply
Regular Contributor
Posts: 222
Accepted Solution

re: Warning Message

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.


Accepted Solutions
Solution
‎07-03-2015 09:29 AM
Super User
Super User
Posts: 7,401

Re: re: Warning Message

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


All Replies
Solution
‎07-03-2015 09:29 AM
Super User
Super User
Posts: 7,401

Re: re: Warning Message

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.

Valued Guide
Posts: 858

Re: re: Warning Message

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

Regular Contributor
Posts: 222

Re: re: Warning Message

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 197 views
  • 3 likes
  • 3 in conversation