BookmarkSubscribeRSS Feed
bhca60
Quartz | Level 8

Keep getting an error when doing WHERE clause (I tried single quotes, double quotes, semi-colons, commas - still getting errors):

 

23         proc sql;
24         create table PPP
25         as select
26         a.pid,
27         a.pcpNPI format=20. as pcpNPI2,
28         from TABLEf as A
29         inner join num1 as B
30        on a.pid=b.pid
31         where a.pcpNPI2 in ('444444444';
                                          _
                                          79
ERROR 79-322: Expecting a ).
5 REPLIES 5
Tom
Super User Tom
Super User

I would try doing what the error message says and add in the closing parenthesis required when using the IN operator.

bhca60
Quartz | Level 8
There were parentheses on it but i thin becuase its separates by a semi-colon it's not reading it.
Tom
Super User Tom
Super User

@bhca60 wrote:
There were parentheses on it but i thin becuase its separates by a semi-colon it's not reading it.

Huh?  Semicolon marks the END of the STATEMENT.  If you have a list of values for the IN operator you can use a space or a comma (or a combination).

where age in (10,12,13)
where age in (14 15 16)
where name in ('Alfred' 'Alice')
Kurt_Bremser
Super User

 


@bhca60 wrote:
There were parentheses on it but i thin becuase its separates by a semi-colon it's not reading it.

Then you did not post the complete log, something we request again and again and again. Please do so in the future.

PaigeMiller
Diamond | Level 26
where a.pcpNPI2 in ('444444444';


SAS will always report an error when you have mis-matched or un-matched parentheses. So the error message tells you that SAS is expecting a parenthesis.

 

Isn't this what you really want?

 

where a.pcpNPI2 in ('444444444');

  

--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 5 replies
  • 484 views
  • 2 likes
  • 4 in conversation