Finding Data Citing data
DSS lab consultation schedule
*No appts. necessary during walk-in hrs.
Note: the DSS lab is open as long as Firestone is open, no appointments necessary to use the lab computers for your own analysis.
Converting SAS Files to Another Package
Converting SAS system and transport files to another format such as Stata or SPSS can be tricky. How you convert it depends on how the file was created and on what platform.
Additionally, a SAS file created on one platform (such as UNIX) cannot be used on another platform (such as Windows) without converting it. You can either use SAS to do this conversion, or you can use DBMS/Copy.
Always remember: any SAS file, regardless of how it was created, needs to be ftp'd in binary format! If you are using an ftp program such as WSFTP, be sure the binary button is checked. If you are using a command-line ftp client, be sure to give the "binary" command before transferring the file.
Determining how the file was created.
The first indication as to how the file was created is the extension or second part of the filename:
You should note that the extensions for the Transport files are not always used, so the file may be a transport file but not have the extensions listed above.
Converting SAS Data Files
If the file is a SAS data file, then your best course of action is to use DBMS/Copy to do the conversion. There is one caveat, though: if the file was created with the "compress=yes" option, then DBMS/Copy will not be able to do the conversion. You will have to re-create the file with the "compress=no" option. Here's how:
Converting SAS Transport Files
Converting a SAS Transport file can be even more tricky since there are several ways of creating them. If the file does not have one of the extensions listed above, then you will need to actually look at the first few lines ofthe file itself for information. There are two possibilities:
HEADER RECORD*******LIBRARY HEADER RECORD!!!!!!!000000000000000000000000000000 SAS SAS SASLIB 6.08 MVS 23JUN95:10:37:32 23JUN95:10:37:32 HEADER RECORD*******MEMBER HEADER RECORD!!!!!!!000000000000000001600000000140 HEADER RECORD*******DSCRPTR HEADER RECORD!!!!!!!000000000000000000000000000000
This indicates that this file was made using PROC COPY with either the XPORT or V5XPORT engines, or was created using PROC XCOPY. This is indicated by the "LIBRARY HEADER RECORD" in the first line. You can also see in the second line that it is version 6.08 and was created on the MVS operating system. Since this is a version 6.x file, the XPORT engine was used; if it were a version 5.x file, then the V5XPORT engine would be appropriate.
The other possibility is:
**COMPRESSED** **COMPRESSED** **COMPRESSED** **COMPRESSED** **COMPRESSED******** LIB CONTROL MVS::SP4.3.0 SAS6.08::D607WORK::TEMP::VAR COUNT 1::REC COUNT 10::RE C LEN8::1::SPAN CONTROL -1::120::2::40::NL::120::NAMEI:: :::::::: :::::::::::SPA N CONTROL 0::8::1::8::NL::8::A:::::SPAN CONTROL 0::8::1::8::NL::8::A ::::SPAN CO NTROL 0::8::1::8::NL::8::A0::::SPAN CONTROL 0::8::1::8::NL::8::A@::::SPAN CONTRO
This file was created using PROC CPORT, and, like the file above, is version 6.08 for MVS.
DBMS/Copy can convert either of these types of files, but it must have the proper file extension indicated above. Try changing the extension to the ones above and run DBMS/Copy on it. Every so often, though, things don't work as we would like and you may have to create a regular SAS data file and convert that.
PROC CPORT is often used to transport SAS files of different types, such as format libraries, SCL catalogs, and data files. You need to use PROC CIMPORT to convert them.
filename trans "path-and-filename-of-transport-file"; libname out "directory-for-SAS-data-file"; proc cimport data=out.filename infile=trans; run;