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

I have a request to set up a program using date prompts in SAS EG.  I am looking to see why I am getting the following error when I try and compare a date in the file to the date in the prompt.  Thanks in advance for your help.

 

proc sql;
31 create table WORK.REPORT_1_TEMP as
32 select datepart (t1.createdate) as createdate format=date9.,
33 t1.createdate as createdate1,
34 t1.companyid,
35 t3.name,
36 t3.attention,
37 t3.emailaddress,
38 (Case
39 WHEN t1.filingtypeenum = 1 THEN '2290 Filing'
40 WHEN t1.filingtypeenum = 2 THEN 'Amended 2290'
41 WHEN t1.filingtypeenum = 3 THEN '8849'
42 WHEN t1.filingtypeenum = 4 THEN 'VIN Correction'
43 ELSE '' END) AS FilingType,
44 t1.taxwizardstepenum
45 from onl2290.taxfiling t1, onl2290.companygroupcompanylevel t2, onl2290.companygroup t3
46 where (t1.companyid = t2.companyid and t2.companygroupid = t3.id) and (t1.taxwizardstepenum in (7,22)
47 and t1.createdate >= "&Start_Date"d, and t1.createdate <= "&End_Date"d ) and t1.returnstatusenum = 1 and t3.name not
_
22
200
47 ! contains '_top' and
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, ), *, **, +, -, /, <, <=, <>, =, >, >=, AND, EQ, EQT, GE,
GET, GT, GTT, LE, LET, LT, LTT, NE, NET, NOT, OR, ^, ^=, |, ||, ~, ~=.

ERROR 200-322: The symbol is not recognized and will be ignored.

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

HI @cbrotz  Did you notice the erroneous comma 

 t1.createdate >= "&Start_Date"d, and t

View solution in original post

3 REPLIES 3
cbrotz
Pyrite | Level 9

Here is a screen shot of the error:

 

cbrotz_0-1590000740770.png

 

novinosrin
Tourmaline | Level 20

HI @cbrotz  Did you notice the erroneous comma 

 t1.createdate >= "&Start_Date"d, and t

cbrotz
Pyrite | Level 9

No I did not.  An hour later....Thank you very much.  It ran fine now. 🙂

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 990 views
  • 1 like
  • 2 in conversation