Hello everybody,
Is there any way to import a .bak file of SQL Server into SAS?
Thanks in advance.
IIRC it's usually a txt file that has the code to create the data set.
Open it as a text file using your favorite text editor (NotePad++ etc).
The code usually doesn't won't translate directly into SAS but the conversion to SAS SQL should be relatively straightforward.
Python can read it directly without converting.
You can use Python within SAS Viya so that's another option.
.bak files are often automatically created backups when a file is changed, so it is necessary to know how the orignal file is structured or what type it is. Then you'll know if you can use proc import or if you can write a data step according to the specifications.
If you don't want to use a direct connection with SAS/ACCESS (to RDBMS or via ODBC), then you are better off by exporting from SQL Server to a text-based format like csv, and reading with a data step.
Parsing a proprietary format will be very hard, if possible at all.
IIRC it's usually a txt file that has the code to create the data set.
Open it as a text file using your favorite text editor (NotePad++ etc).
The code usually doesn't won't translate directly into SAS but the conversion to SAS SQL should be relatively straightforward.
Python can read it directly without converting.
You can use Python within SAS Viya so that's another option.
I might be wrong, but I didn't know SAS created .bak files of any kind.
What is/was the file originally? Has someone changed the extension as part of a backup routine, or is this a file created by a SAS utility as part of an underlying backup routine?
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.