BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Harin_Jay
Calcite | Level 5

Hi 

 

I have a very basic code which I try to use to map the date ranges , yet majority of the time I get a symbolic reference error.

below is the code and i have added a screen shot on the error , 

Data check_1;
dateformob=(put(intnx('mon',"&SYSDATE."D,-1,'e'), date9.));
call symput('dateformob',put(intnx('mon',"&SYSDATE."D,-1,'e'), date9.));
rfd_dt=%SYSFUNC(today());
format rfd_dt date9.;
call symput('rfd_dt',%SYSFUNC(today()));
TIME_RANGE=intnx('month',today(),-6,'s');
call symput('TIME_RANGE',intnx('month',today(),-6,'s'));
format TIME_RANGE date9.;
YYMM=(put(intnx('mon',today(),-1,'e'), yymmn4.));
call symput('YYMM',put(intnx('mon',today(),-1,'e'), yymmn4.));
dt_=%SYSFUNC(today())-1;
format dt_ YYMMDDN8.;
dt= putn( dt_,vformat(dt_));
run;
%put &rfd_dt &TIME_RANGE &dateformob &YYMM &dt ;

 

Harin_Jay_0-1664787826868.png

If someone can help me resolve this would be great !! 

 

Thanks!! 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

Your %put statement refers to &dt. But the code you posted never creates &dt. It must come from other code not shown here that sometimes runs and sometimes doesn't run.

Also note, you use today() both with and without %SYSFUNC. Since all uses are in DATA step statements, omit %SYSFUNC when using today().

View solution in original post

3 REPLIES 3
Astounding
PROC Star

Your %put statement refers to &dt. But the code you posted never creates &dt. It must come from other code not shown here that sometimes runs and sometimes doesn't run.

Also note, you use today() both with and without %SYSFUNC. Since all uses are in DATA step statements, omit %SYSFUNC when using today().

Harin_Jay
Calcite | Level 5
thanks !!
PaigeMiller
Diamond | Level 26

In the code you show, &dt is never defined.

--
Paige Miller

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 561 views
  • 0 likes
  • 3 in conversation