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

I am trying to make a filter in SAS EG using the Filter Data tab and the prompt date. I get the error below. Not sure why.

 

1 ;*';*";*/;quit;run;
2 OPTIONS PAGENO=MIN;
3 %LET DateRange_max = 31Dec2022;
4 %LET DateRange_min_label = November 01, 2021;
5 %LET DateRange_min = 01Nov2021;
6 %LET DateRange_max_label = December 31, 2022;

7 PROC SQL NOEXEC;
8 SELECT t2.CIN,
9 t2.Month,
10 t2.Year,
11 t2.DATE,
12 /* October */
13 (Month( intnx('month', "&DateRange_min"d, 11, 'end'))) FORMAT=Z2. AS October,
14 t2.Age_Group,
15 t2.Elig
16 FROM WORK.NO_DUP t2
17 WHERE t2.DATE BETWEEN &DateRange_min AND &DateRange_max;
NOTE: Line generated by the macro variable "DATERANGE_MIN".
17 01Nov2021
_______
22
76
ERROR 22-322: Syntax error, expecting one of the following: !!, *, **, +, -, /, AND, ||.

ERROR 76-322: Syntax error, statement will be ignored.

18 QUIT;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

19 %SYMDEL DateRange_max_label;
20 %SYMDEL DateRange_min_label;
21 %SYMDEL DateRange_min;
22 %SYMDEL DateRange_max;
23
24 QUIT; RUN;

 

 

 

ralizadeh_0-1683849688922.png

 

ralizadeh_1-1683849751686.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ralizadeh
Obsidian | Level 7

Found why it wasn't working. I did not check off "Generate filter for a prompt value". Now it is working! 😀

 

ralizadeh_0-1683850171748.png

 

View solution in original post

1 REPLY 1
ralizadeh
Obsidian | Level 7

Found why it wasn't working. I did not check off "Generate filter for a prompt value". Now it is working! 😀

 

ralizadeh_0-1683850171748.png

 

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
  • 1 reply
  • 466 views
  • 0 likes
  • 1 in conversation