How do I connect to tables through SAS?

Reply
New Contributor
Posts: 2

How do I connect to tables through SAS?

I feel really dumb writing this because I've been using SAS for 12 years and I love the language. I'm a statistician and recently moved into a new position at a new employer. Everything is done completely different here than I'm used to and am VERY confused. Boss doesn't know SAS and doesn't want to and also isn't completely computer literate either. I can code sql at slightly higher than beginner so I didn't think this job would be that bad. However, accessing those tables through SAS has driven me mad. I have been writing queries after queries in Access and it is so NOT EFFICIENT whatsoever (and don't even get me started on time consuming!). I need a bare bones/dumbed down version of how to access my tables through SAS. These tables change daily, so it's not like I can import them and make a library. I need to link to them somehow. I don't know databases very well and don't know any database lingo (ie. odbc, etc.). I also can't give any specifics about the database unless asked because I don't know where to look! It's that bad...I seriously need to start from scratch and can't find anything anywhere at the starting point I need (everything I've found assumes some sort of database knowledge). Thanks so much!

I would just like a table linker per se, so that I can use the tables whenever I please with proc sql. Thank you!

Super User
Super User
Posts: 6,500

Re: How do I connect to tables through SAS?

You mentioned ACCESS, perhaps it is as simple as pointing to the access database file?

libname xxx 'filename' ;

You will need to have SAS/ACCESS Interface to PC Files for that to work.  Run PROC SETINIT to see what you have.

New Contributor
Posts: 2

Re: How do I connect to tables through SAS?

Hi Tom,

In Access under Database Tools/Add-Ins I have an option (that was already installed when I got here) to use a table linker to our ODS. So whenever I need to reference a table, it makes me login and I choose the table I want. Then I can reference this table or use any fields I'd like in a query. So the issue I guess, is that I don't have a database in Access with the tables in it. I only pull tables in from the ODS, when I need them.

Super Contributor
Posts: 333

Re: How do I connect to tables through SAS?

Sounds like it is using ODBC or something similar to connect to backend database. But without further information its going to be hard to give specifics.  I would contact your company's helpdesk / IT department to find out what the back end database is (SQL Server, Oracle, etc..) and even how the access connects.

You might get a clue based on a proc setinit; run; that would give an idea of the SAS components that are installed (SAS/Access for Oracle, SAS/Access for PC file formation, etc ....).

Once those specifics are know the community here can better help you decipher the connection string you need to use. Thats usually the easy of the two parts.

EJ

Ask a Question
Discussion stats
  • 3 replies
  • 215 views
  • 0 likes
  • 3 in conversation