Reputation: 41
I have a .sql file which contains information about a database. This database has exactly 8 tables. I would like to essentially import the contents of these 8 tables into SAS and create .sas7bdat SAS datasets.
Is there a quick/easy way to do this directly? I apologize in advance for my lack of database knowledge!
Upvotes: 4
Views: 2117
Reputation: 21264
Open the .SQL file with your favourite text editor.
You'll see the Create Table
and Insert
code. You can move those into a PROC SQL
step. You may need some minor changes to the code, but should be relatively straight forward, if you have 8 tables it's doable but a little bit of work.
Otherwise you can do as others have mentioned and create a SQL DB.
Upvotes: 2
Reputation: 2946
You have to query the sql database and then forward all the results to sas.
That's by far the simplest way.
You just need to setup sql and sas like you normally would and write a program that would copy the contents. It should be easy for a programer that worked with databases.
Upvotes: 0
Reputation: 1269493
Use the database and connect to it:
proc sql
, but there are other ways you can access them.Upvotes: 0