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

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, ^, ^=, |, ||, ~, ~=.

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
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.

--
Paige Miller

View solution in original post

3 REPLIES 3
ybz12003
Rhodochrosite | Level 12

The error was marked underlying the comma between (88,99).

PaigeMiller
Diamond | Level 26
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.

--
Paige Miller
ybz12003
Rhodochrosite | Level 12
Thank you so much!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 630 views
  • 0 likes
  • 2 in conversation