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.
HI @cbrotz Did you notice the erroneous comma
t1.createdate >= "&Start_Date"d, and t
Here is a screen shot of the error:
HI @cbrotz Did you notice the erroneous comma
t1.createdate >= "&Start_Date"d, and t
No I did not. An hour later....Thank you very much. It ran fine now. 🙂
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.
Ready to level-up your skills? Choose your own adventure.