Hello,
I have a statement shown in the Syntax error. Please advice how to fix it.
where c_ageyears<3 and ((bage_12<22 and bage_12 ^= (88,99)) or (bage_12>45))
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, ^, ^=, |, ||, ~, ~=.
bage_12 ^= (88,99)
will not work.
Try
bage_12 not in (88,99)
Please, in the future, show us the entire LOG for this data step, with nothing chopped out, in the order that it appears in the LOG, rather than a portion of the code and a portion of the log. When providing the LOG, copy it as text and then paste it into the window that appears when you click on the </> icon, to ensure that it will be formatted properly.
The error was marked underlying the comma between (88,99).
bage_12 ^= (88,99)
will not work.
Try
bage_12 not in (88,99)
Please, in the future, show us the entire LOG for this data step, with nothing chopped out, in the order that it appears in the LOG, rather than a portion of the code and a portion of the log. When providing the LOG, copy it as text and then paste it into the window that appears when you click on the </> icon, to ensure that it will be formatted properly.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.