Hello everyone! I'm counting total number of distinct values from all columns from various tables. What I've come across is that some of the column name matches that of SAS' Reserve Words. So the questions is simple, how can I query based on these words; i.e. add, tran, user, etc. Sample of error msg is: ERROR: CLI describe error: [SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Incorrect syntax near the keyword 'ADD'. PROC SQL; CREATE TABLE Dist_Val_ADD AS SELECT "ADD" AS Column_Name, COUNT(DISTINCT ADD) as Num_Dist_Values FORMAT COMMA10. FROM CONN.&TBLNM. ; QUIT; I've also tried: COUNT(DISTINCT CATS("A.",ADD)) as Num_Dist_Values FORMAT COMMA10. COUNT(DISTINCT CATS("[",ADD.,"]")) as Num_Dist_Values FORMAT COMMA10. COUNT(DISTINCT CATS("'",ADD,"'N")) as Num_Dist_Values FORMAT COMMA10. COUNT(DISTINCT CATS("'",ADD,"'")) as Num_Dist_Values FORMAT COMMA10. COUNT(DISTINCT CATS('"',ADD,'"')) as Num_Dist_Values FORMAT COMMA10. All have failed and resulted in the same error msg. The table is in SQL Server, but may have other table in other platforms. Any other suggestions???
... View more