DATA Step, Macro, Functions and more

SAS macro query

Accepted Solution Solved
Reply
Frequent Contributor
Frequent Contributor
Posts: 78
Accepted Solution

SAS macro query

[ Edited ]

I got this error: WARNING: Apparent symbolic reference T1 not resolved.

May i know how to solve the below codes? Thanks.

 


%LET RUNDATE ='11NOV2017'D;

 

DATA _NULL_;
IF INTCK('DAY',&RUNDATE,TODAY()) GE 7 THEN &T1="T1"; ELSE &T1="T2";
RUN;

 

%PUT T1=&T1;

 


Accepted Solutions
Solution
‎11-13-2017 01:15 AM
Esteemed Advisor
Posts: 5,481

Re: SAS macro query

Maybe you want something like:

 

%LET RUNDATE ='11NOV2017'D;

DATA _NULL_;
IF INTCK('DAY', &RUNDATE., TODAY()) GE 7 
    THEN call symputx("T1", "T1"); 
    ELSE call symputx("T1", "T2");
RUN;
 

%PUT T1=&T1;
PG

View solution in original post


All Replies
Super Contributor
Posts: 271

Re: SAS macro query

As you have defined RUNDATE macro variable, similarly you need to define T1

 

For example

%LET T1=COL1;

Solution
‎11-13-2017 01:15 AM
Esteemed Advisor
Posts: 5,481

Re: SAS macro query

Maybe you want something like:

 

%LET RUNDATE ='11NOV2017'D;

DATA _NULL_;
IF INTCK('DAY', &RUNDATE., TODAY()) GE 7 
    THEN call symputx("T1", "T1"); 
    ELSE call symputx("T1", "T2");
RUN;
 

%PUT T1=&T1;
PG
☑ This topic is solved.

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

Discussion stats
  • 2 replies
  • 152 views
  • 0 likes
  • 3 in conversation