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

 

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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