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

Dear Communities,

 

I need to execute a PROC SQL on a table that has a dot in its name (i.e. esign.state is the table name).

I have registered a library that preserve table names with their original names.

LIBNAME DUW ODBC  DATAsrc=DUW  SCHEMA=gbox;
proc sql;
	create table Test_Q1 as 
		select * from duw.esign.state;
quit;

However, Enterprise Guide gives me the following error:

ERROR 22-322: Syntax error, expecting one of the following: a name, ;, (, ',', ANSIMISS, AS, CROSS, EXCEPT, FULL, GROUP, HAVING,
INNER, INTERSECT, JOIN, LEFT, NATURAL, NOMISS, ORDER, OUTER, RIGHT, UNION, WHERE.

ERROR 200-322: The symbol is not recognized and will be ignored.

Do you know any workaround so as to resolve the issue?

 

Thank you in advance,

Vasilios

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
5 REPLIES 5
Kurt_Bremser
Super User

Try

options validmemname=extend;

proc sql;
create table Test_Q1 as 
select * from duw.'esign.state'n;
quit;

You may have to take care of upper/lowercase inside the quotes.

vfarmak
Quartz | Level 8

Thank you very much @Kurt_Bremser 

with the solution you provided I found out that SAS has a limitation in terms of the number of characters that can host in a character column (32767).

 

Therefore, I need to find a way to manipulate the string and store in SAS.

 

Best Regards,

Vasilios

Kurt_Bremser
Super User

If the table in the DBMS has VARCHAR/CHAR fields that are too large for SAS, first cast them to a shorter length in a DBMS view, which you then use as source from SAS.

LinusH
Tourmaline | Level 20
Are you sure that the table actually has a dot in its name? In that case the DBA should be fired. Usually when I see a threee level name it's in the form of databse.schema.table. If so, you library reference should be directed to the schema, and then you could use a two level reference in your SQL.
Data never sleeps

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 5969 views
  • 1 like
  • 3 in conversation