BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
king_aj
Obsidian | Level 7

I want to open the .sd2 file . please help me to open the file.Is there any way to convert it into .csv format .

Please convert the file into a format so that i can open it ms-excel.

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

This is something that you can do yourself, for free, with the SAS Universal Viewer.  And usually I would not offer this "conversion service" on the communities -- after all, this space is a place to learn, not to get other people to do your work for you.

 

However, there are a few tricks to it, and for the benefit of others who might be looking for the steps to accomplish this, I've done this for you and attached some screen shots.

 

How to convert an SD2 file (SAS Version 6 data set) to CSV without having SAS installed

 

First, download and install the SAS Universal Viewer, x86 edition (32-bit).  It's free, and the download location is on support.sas.comYou must get the 32-bit version (win), not the wx6 version, because only the 32-bit data providers can read the older SD2 files.

 

uv_dl.png

 

To install the product, expand the ZIP file to a temp folder and then run SETUP.EXE.  Note that if you already have SAS software installed, you might run into some roadblocks if the SAS you have is newer than the components supplied in the Universal Viewer.  But...if you have SAS already, you don't need to use this method in the first place.  New versions of SAS can read/convert SD2 files via the V6 library engine.

 

Next, start the SAS Universal Viewer.  The program should be available from the Start menu.

 

Once running, use File->Open->SAS Data Set to select your data set to open.  You will need to change the file filter from "*.sas7bdat" to "*.sd2" and navigate to the folder that contains your data.  The data set will open in the workspace.

 

uv_1.png

 

Just above the data rows you'll find (a bit hidden) the Table menu.  Select it, and then select Save As...

 

uv_2.png

 

From the file type options in the Save As menu, select CSV and name the output file.  (Default Save As option is XML...not sure how popular that is, but whatever...)

 

For large files it will take a few moments to produce the CSV file.  But when done, you can navigate to the CSV in Windows Explorer and open in Excel.

 

uv_3.png

The raw values should all come over okay, but anything that relies on a user-defined format might not have the display value you expect.  Also, numeric IDs (like the CASENUM value shown in this example) might require some reformatting in Excel to display as you want them to.

 

If you want to automate this process outside of the SAS Universal Viewer, you can use the SAS Local OLE DB Data Providers and VB Script or PowerShell.  I've got examples on my blog.  Remember for SD2 files you need the 32-bit versions of these components, which run just fine on your Windows 64-bit edition.

 

Finally, as an exceptional public service, I've attached the ACCIDENT.CSV file (in a zip, as it's 11MB uncompressed).  I say "exceptional" because I don't want this to set a precedent 🙂  Takeaway: SAS provides free tools for people who don't have SAS installed to get their data from SAS data sets.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

View solution in original post

39 REPLIES 39
ChrisHemedinger
Community Manager

If you don't have an installed version of SAS, you can use the SAS Universal Viewer to open your SAS data file and copy/export to another format.

 

Download is available here.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
king_aj
Obsidian | Level 7

I have never used SAS universal Viewer. Can anybody help me to change the attached accident.sd2 file to .csv format.(.sd2 to .csv)

ChrisHemedinger
Community Manager

This is something that you can do yourself, for free, with the SAS Universal Viewer.  And usually I would not offer this "conversion service" on the communities -- after all, this space is a place to learn, not to get other people to do your work for you.

 

However, there are a few tricks to it, and for the benefit of others who might be looking for the steps to accomplish this, I've done this for you and attached some screen shots.

 

How to convert an SD2 file (SAS Version 6 data set) to CSV without having SAS installed

 

First, download and install the SAS Universal Viewer, x86 edition (32-bit).  It's free, and the download location is on support.sas.comYou must get the 32-bit version (win), not the wx6 version, because only the 32-bit data providers can read the older SD2 files.

 

uv_dl.png

 

To install the product, expand the ZIP file to a temp folder and then run SETUP.EXE.  Note that if you already have SAS software installed, you might run into some roadblocks if the SAS you have is newer than the components supplied in the Universal Viewer.  But...if you have SAS already, you don't need to use this method in the first place.  New versions of SAS can read/convert SD2 files via the V6 library engine.

 

Next, start the SAS Universal Viewer.  The program should be available from the Start menu.

 

Once running, use File->Open->SAS Data Set to select your data set to open.  You will need to change the file filter from "*.sas7bdat" to "*.sd2" and navigate to the folder that contains your data.  The data set will open in the workspace.

 

uv_1.png

 

Just above the data rows you'll find (a bit hidden) the Table menu.  Select it, and then select Save As...

 

uv_2.png

 

From the file type options in the Save As menu, select CSV and name the output file.  (Default Save As option is XML...not sure how popular that is, but whatever...)

 

For large files it will take a few moments to produce the CSV file.  But when done, you can navigate to the CSV in Windows Explorer and open in Excel.

 

uv_3.png

The raw values should all come over okay, but anything that relies on a user-defined format might not have the display value you expect.  Also, numeric IDs (like the CASENUM value shown in this example) might require some reformatting in Excel to display as you want them to.

 

If you want to automate this process outside of the SAS Universal Viewer, you can use the SAS Local OLE DB Data Providers and VB Script or PowerShell.  I've got examples on my blog.  Remember for SD2 files you need the 32-bit versions of these components, which run just fine on your Windows 64-bit edition.

 

Finally, as an exceptional public service, I've attached the ACCIDENT.CSV file (in a zip, as it's 11MB uncompressed).  I say "exceptional" because I don't want this to set a precedent 🙂  Takeaway: SAS provides free tools for people who don't have SAS installed to get their data from SAS data sets.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
king_aj
Obsidian | Level 7

when i opened the accident.sd2 dataset in SAS universal viewer ,it gave the error "Unable to load the table ACCIDENT . one common cause is when table has an associated index which was not found".

ChrisHemedinger
Community Manager

I didn't have any problems with SAS UV 1.4, 32-bit.  The 64-bit version would not open it -- I got the helpful message that SD2 files are not supported in the 64-bit version.  Sort of makes sense, as SD2 files were last used in SAS V6, firmly in the 32-bit (if not 16-bit) era.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
king_aj
Obsidian | Level 7
The above file you attached is accident_csv.zip file of my accident.sd2 file??
ChrisHemedinger
Community Manager

Yes, that's what it is.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
king_aj
Obsidian | Level 7
thanks for helping me
king_aj
Obsidian | Level 7

can .SSD file is opened using SAS universal viewer??

ChrisHemedinger
Community Manager

Yes, but only with the 32-bit version of the SAS Universal Viewer -- 

 

Sorry @king_aj, scratch that.  I think the answer is No.  I misread your question and answered for SD2 files -- ssd01 (old-style Unix data sets) are not readable, at least in my tests.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
king_aj
Obsidian | Level 7

while opening the file gives error as shown in the image given below

IMG_20171027_000529.jpg

king_aj
Obsidian | Level 7

would you convert the attached files to .csv format? The files was not opened in SAS universal viewer ...please help...

king_aj
Obsidian | Level 7

sas univerasal viewer also gives errror in opening the .sd2 file

king_aj
Obsidian | Level 7

would you convert the attached files to .csv format? The files was not opened in SAS universal viewer ...please help @ChrisHemedinger

It is very helpful if someone converts the attached file to .csv.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 39 replies
  • 12121 views
  • 13 likes
  • 7 in conversation