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: Call for Content

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 600 views
  • 0 likes
  • 2 in conversation