Hi,
I'm getting this syntax error; can someone please help me to fix this
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, (, ',', ANSIMISS, AS, CROSS, EXCEPT, FULL, GROUP, HAVING,
INNER, INTERSECT, JOIN, LEFT, NATURAL, NOMISS, ORDER, OUTER, RIGHT, UNION, WHERE.
ERROR 200-322: The symbol is not recognized and will be ignored.
Thanks
There is no reference to WORK.HSOPRD_CLAIM_ITEM so this error must be thrown by some code which you don't show us.
The error is clear though: You reference a table WORK.HSOPRD_CLAIM_ITEM somewhere which doesn't exist.
For debugging:
1. Start a new SAS session
2. Investigate and resolve the very first WARNING or ERROR you get in your code. Don't care about later Errors as they might just be a consequence of the first Error.
Fix the Error. Start a new SAS session, fix the next Error if any, ...etc.
You will have to post the log (with the code that provoked the error) for anyone to be able to answer that.
Sorry, I've managed to fix the previous error.
Now I got this;
from hsoprd.claim /*as clm*/
192
193 /* inner join hsoprd.provider as prv
194 on clm.service_provider_id = prv.service_provider_id*/
195 inner join hsoprd.voucher as vch
196 on clm.voucher_id = vch.voucher_id
197 /* inner join hsoprd.client as clt
198 on clm.client_detail_id = clt.client_detail_id*/
199 /* inner join hsoprd.site as site
200 on clm.site_detail_id = site.site_detail_id*/
201 /* inner join hsoprd.practitioner as prc
202 on clm.practitioner_detail_id = prc.practitioner_detail_id*/
203 left join hsoprd.device as ldvc
204 on clm.left_device_id = ldvc.device_id
205 left join hsoprd.device as rdvc
206 on clm.right_device_id = rdvc.device_id
207
208 where clm.claim_detail_status = 'Approved'
209 /* and clm.date_of_payment >= &tdSDate
210 and clm.date_of_payment < &tdEdate*/
211 order by clm.claim_date_of_service
212 ;
ERROR: File WORK.HSOPRD_CLAIM_ITEM.DATA does not exist.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
213 /*disconnect from teradata;*/
214 quit;
Thanks
There is no reference to WORK.HSOPRD_CLAIM_ITEM so this error must be thrown by some code which you don't show us.
The error is clear though: You reference a table WORK.HSOPRD_CLAIM_ITEM somewhere which doesn't exist.
For debugging:
1. Start a new SAS session
2. Investigate and resolve the very first WARNING or ERROR you get in your code. Don't care about later Errors as they might just be a consequence of the first Error.
Fix the Error. Start a new SAS session, fix the next Error if any, ...etc.
Syntax error is back in my code.... not sure where is the error...
, case
125 when clm.item_number in (&Fittings)
126 and clm.item_number not in (631,636,641,651,656,661,761,771,821,826,831)
127 and
128 (
129 (cast(clm.Claim_Date_Of_Service as date) - cast(clm.Left_Fitting_Date as date) < 7
__ __
22 22
202 202
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, ), *, **, +, ',', -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN,
CONTAINS, EQ, EQT, GE, GET, GT, GTT, IN, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
130 and )
_
22
200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,
a missing value, (, +, -, BTRIM, CALCULATED, CASE, EXISTS, INPUT, NOT, PUT, SUBSTRING, TRANSLATE, USER, ^, ~.
ERROR 200-322: The symbol is not recognized and will be ignored.
131 cast(clm.Claim_Date_Of_Service as date) - cast(clm.Left_Fitting_Date as date) >= 0)
__ __
22 22
202 202
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, ), *, **, +, ',', -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN,
CONTAINS, EQ, EQT, GE, GET, GT, GTT, IN, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
132 or
133 (cast(clm.Claim_Date_Of_Service as date) - cast(clm.Right_Fitting_Date as date) < 7
__ __
22 22
202 202
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, ), *, **, +, ',', -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN,
CONTAINS, EQ, EQT, GE, GET, GT, GTT, IN, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
134 and )
_
22
200
4 The SAS System 22:24 Monday, November 28, 2022
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,
a missing value, (, +, -, BTRIM, CALCULATED, CASE, EXISTS, INPUT, NOT, PUT, SUBSTRING, TRANSLATE, USER, ^, ~.
ERROR 200-322: The symbol is not recognized and will be ignored.
135 cast(clm.Claim_Date_Of_Service as date) - cast(clm.Right_Fitting_Date as date) >= 0)
__ __
22 22
202 202
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, ), *, **, +, ',', -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN,
CONTAINS, EQ, EQT, GE, GET, GT, GTT, IN, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
136 )
137 then 'Y'
138 else
139 ''
140 end as DOSlt7DOF
cast() is not SAS SQL syntax
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 16. Read more here about why you should contribute and what is in it for you!
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.