06-20-2015 02:20 PM
Essentially what I have is a .sql file that contains information about a database. This database is supposed to have exactly 8 tables in it.
All I want to do is to output the contents (tables) of this .sql file into 8 .sas7bdat files so I am able to create a library within SAS and query each of these 8 tables. Is this possible?
I hope this makes sense and I'm sorry for my lack of database knowledg
06-21-2015 04:28 PM
Most probably it is an SQL dump. It contains essentially SQL statements (create table, insert into...).
If you put the contents of the file inside a PROC SQL; and QUIT; you have some chances that you can run it.
But also possible, that you have to edit this code.
A "supported way" to import such a file is to import it with a native tool (Oracle and maybe MySQL and PostgreSQL support this), then access that database with the appropriate SAS Access engine. Or make an export to a text file.
06-22-2015 03:42 AM
What form of your original data is it ? TEXT CSV files ?
If so , you need sophisticated SAS Programming skill to transform these SQL statement into SAS Data Step . Like something :
infile 'c:\temp\a.csv' dsd truncover;
input sid : $20. price tran_date : yymmdd10.;
06-22-2015 03:52 AM
I think he's got SQL source that creates tables from code, much like a data step with cards;