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

Hello I am getting an oracle error which I have never seen before, saying I'm missing a right parathesis? I checked a few times to see where it should be and can not seem to see.

 

 

 

ERROR: ORACLE prepare error: ORA-00907: missing right parenthesis. SQL statement: select distinct P.mbr_id, P.ENRL_DT,
       P.PGM_CATGY_TYP_ID, P.PGM_TYP_ID, P.MBR_PGM_STS_TYP_ID, P.MBR_PGM_STS_RSN_TYP_ID, P.End_DT, P.MBR_PGM_ID from
       STG_HSR.MBR_PGM P where P.ENRL_DT is not null and P.MBR_PGM_STS_RSN_TYP_ID =81 and P.MBR_PGM_STS_TYP_ID =05 and alt_pol_nbr
       in ('X05951','005951','00005951', '000X05951','0X05951','000005951',
       'X06163','006163','00006163','000X06163','0X06163','000006163',
       'X00181','0X00181','000X00181','000181','00000181','000000181', '36000','036000','00036000','000036000', '360000', 'X06754',
       '006754','00006754','000X06754','0X06754','000006754', 'X06764', '006764','00006764','000X06764','0X06764','000006764',
       'X06029', '006029','00006029','000X06029','0X06029','000006029', 'X07015',
       '007015','00007015','000X07015','0X07015','000007015', 'X08427', '008427','00008427','000X08427','0X08427','000008427',
       'X08401','008401','00008401','000X08401','0X08401','000008401',
       'X08426','008426','00008426','000X08426','0X08426','000008426', 'X08434','008434','00008434','000X08434',
       '0X08434','000008434', 'X09211','009211','00009211','000X09211','0X09211','000009211',
       'X09227’,’009227’,’00009227’,’000X09211’,’0X09227’,’000009227’,     
       ‘X09228’,’009228’,’00009228’,’000X09228’,’0X09228’,’000009228’,     
       'X09229’,’009229’,’00009229’,’000X09229’,’0X09229’,’000009229’).

1 ACCEPTED SOLUTION

Accepted Solutions
Quentin
Super User

In the last three lines of your list of quoted items, a number of the items have curly quote marks, also known as "smart quotes," rather than straight quote marks, e.g. red quotes below:

 

   'X09227,009227,00009227,000X09211,0X09227,000009227,     

 

This can happen sometimes if you type code into a word processor, or copy code from a word document or PDF.  Curly quotes are bad for code. 

 

I would open the code in your favorite SAS code editor, replace them with straight quote marks, and try again.

View solution in original post

1 REPLY 1
Quentin
Super User

In the last three lines of your list of quoted items, a number of the items have curly quote marks, also known as "smart quotes," rather than straight quote marks, e.g. red quotes below:

 

   'X09227,009227,00009227,000X09211,0X09227,000009227,     

 

This can happen sometimes if you type code into a word processor, or copy code from a word document or PDF.  Curly quotes are bad for code. 

 

I would open the code in your favorite SAS code editor, replace them with straight quote marks, and try again.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1 reply
  • 1509 views
  • 0 likes
  • 2 in conversation