04-21-2016 08:22 AM
After following the steps of creating ODBC Server using dsn with sql server authentication and defining ODBC server and library in SAS SMC given authentication domain in server manager i am able to connect to the database(MS Sql Server).
I am now trying to register the views which are there in the database by right click on the library and register tables. I have 5 views in the database schema when i am trying to register i am able to see only one view out of five.
I kindly request to help me with this as it is urgent.
Thanks and Regards,
04-21-2016 09:05 PM
How long are the view names you can't see? EG will not show view or table names greater than 32 characters long. Special characters may cause problems also
04-22-2016 12:04 AM
I Have two views which are of 32 long named and 3 more than that. I am trying to register in SAS SMC i am not using SAs EG. Will that be a problem in SAS SMC also??
Unfortunately in two views i am not able to see the one which is lesser than the one which i can see
04-22-2016 12:28 AM
Yes, registering in SMC won't work either.
There are a couple of workarounds:
04-22-2016 12:45 AM
I Also have a doubt that if the names are exceeding 32 character, is there any other way to extract and register them? if yes please explain in detail or give me steps so that i can follow.
Thanks & Regards,
04-22-2016 06:08 AM
I'm not aware of any other workarounds you can try. If you want to try creating a SAS view then here is some example code to use:
proc sql noprint; connect to odbc (noprompt = "server=MySQLServer;DRIVER=SQL Server Native Client 10.0;Trusted Connection=yes;DATABASE=MyDatabase;" ) ; create view sasuser.Short_Name as select * from connection to odbc (SELECT * FROM [MyDatabase].[MySchema].[My_Very_Long_Table_Name_Longer_Than_32_Characters] ) ; disconnect from odbc; quit;
If you think these are not very satisfactory workarounds then I am in total agreement!
04-22-2016 06:21 AM
Thank you Kiwi.
How can i Convert a character Coloumn Year which values 2004, 2005, 2006 etc into a date Year format in EG? same for Month('Feb') to Date format 'Feb' also??
Tnaks & Regards,
04-23-2016 04:55 PM