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

hi,

i have the following error problem and would like someone help with it.

19         Data Run_dates;

20         Mrg = 1;

21         Run_Model_Date = &Last_Month;

                            _

                            22

WARNING: Apparent symbolic reference LAST_MONTH not resolved.

22         Run_Date = &First_Month;

                      _

                      22

WARNING: Apparent symbolic reference FIRST_MONTH not resolved.

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,

              a missing value, INPUT, PUT. 

23         do While (Run_Date <= Run_Model_Date);

24            Output;

25             Run_Date = intnx("MONTH", Run_Date , 1, 'END');

26         end;

27         Format Run_Date date9.;

28         Keep Mrg Run_date;

29         run;

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

A thing like &name is a symbolic reference in SAS. Symbolic references are replaced by their values when the program is executed. Thus, to run your program you must first define &Last_Month and &First_Month with statements :

%let First_Month='01JAN2012'd;

%let Last_Month='31DEC2012'd;

PG

PG

View solution in original post

2 REPLIES 2
PGStats
Opal | Level 21

A thing like &name is a symbolic reference in SAS. Symbolic references are replaced by their values when the program is executed. Thus, to run your program you must first define &Last_Month and &First_Month with statements :

%let First_Month='01JAN2012'd;

%let Last_Month='31DEC2012'd;

PG

PG
Mathe
Calcite | Level 5

thanks very much. it did work.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 1771 views
  • 0 likes
  • 2 in conversation