1 / 24

Transferring VMS SAS/SPSS Data to UNIX

Transferring VMS SAS/SPSS Data to UNIX. Jeff Hayes Social Science Computing Co-op February 26, 1999. Problem. SAS and SPSS data sets are stored in binary Binary representations differ across operating systems (VMS and UNIX). Don’t forget….

natan
Download Presentation

Transferring VMS SAS/SPSS Data to UNIX

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Transferring VMS SAS/SPSS Data to UNIX Jeff Hayes Social Science Computing Co-op February 26, 1999

  2. Problem • SAS and SPSS data sets are stored in binary • Binary representations differ across operating systems (VMS and UNIX)

  3. Don’t forget… • About your files on VMS tapes. Files stored as SAS or SPSS data sets on tape need to be transported • For SPSS, data sets need to be based on SPSS version 4 or later

  4. Steps to transfer data • Exporting the data set(s) on VMS (Run some descriptives!) • FTPing the data to UNIX • SPSS portable files as ASCII • SAS transport files as binary • Importing the data set(s) on UNIX (Re-run the descriptives and check the data!)

  5. UNIX disk allocations • Most users have only one account on UNIX • /home - limited to 100 MB. Intended for mail and program files • /aux - limit varies 200-500 MB. (See consultant.) Intended to hold user data files • /temp/fivedays - limited by usage (disk is 4 GB)

  6. Use compressed files on UNIX • Compressed files can greatly reduce the amount of disk space your files take up • SAS and SPSS can read compressed transportable files directly. See: • SSCC How to… #1 How to Write/Read UNIX Compressed SAS Data Sets Directly • SSCC Publication 7-7 Using SPSS on UNIX

  7. Translation tools • SSCC has two utilities that can read the SPSS/SAS transportable files and write files for many different software packages, e.g. Stata, Limdep, and Excel. • Stat/Transfer (WinCenter, available to any PC in Social Science building) • DBMS/Copy (UNIX, X windows required for graphical interface)

  8. SPSS: Exporting data • Use a GET command to identify the data set you wish to transfer • Use an EXPORT command to create the portable file. (Recommend .por extension) • Run descriptive statistics for verifying data transfer’s success

  9. SPSS: FTP the data • Login to UNIX and get to the directory where you want the data to end up • Start FTP (ftp eagle) and login to Eagle • get staffdisk2:[100041.spss]gss7296.por gss7296.por • When completed, type “quit” to exit FTP

  10. SPSS: Importing data • Use an IMPORT command to read the portable file on UNIX • If you wish, you can use a SAVE command to create a SPSS system file • Re-run the descriptive statistics to compare to results on VMS

  11. SPSS: Conclusions • Consider keeping your data in a SPSS portable file. It’s easy to read in SPSS on UNIX or a PC. It can also be transferred to another package, such as Stata, using Stat/Transfer or DBMS/Copy • When transferring SPSS portable files, use FTP in ASCII mode (default between VMS and UNIX)

  12. SAS: Exporting data I: Libnames • Use a LIBNAME statement with the xport engine and the cc=none option to identify the transport file to be created • libname moveout xport “staffdisk:[100041.sas]gss.xpt” cc=none;

  13. SAS: Exporting data I: Libnames • Use a LIBNAME statement to identify the directory containing the SAS data set to be exported • libname movein “staffdisk2:[100041.sas]”;

  14. SAS: Exporting data II: PROC COPY • Use PROC COPY to create a transport file from a SAS system file or library • proc copy in=movein out=moveout; select gss7296;

  15. SAS: Exporting data II: PROC COPY • The SELECT subcommand copies only the file named to the transport file • Omitting the SELECT subcommand will create a transport file containing all of the SAS data sets in the specified directory. PLEASE DON’T. Such a file can be too large. Use SSCC How to… #7 How to Write a Macro to Transport SAS Data Sets from VMS to UNIX to transfer many files.

  16. SAS: FTP the data • Login to UNIX and get to the directory where you want the data to end up • Start FTP (ftp eagle) and login to Eagle • Type binary to specify that the transport file will be transferred in binary mode • get staffdisk2:[100041.sas]gss7296.xpt gss7296.xpt • When completed, type “quit” to exit FTP

  17. SAS: Importing data I: Libnames • Use a LIBNAME statement with the xport engine to identify the transport file to be read • libname moveout xport “/aux/j/jhayes/sas/gss7296.xpt”;

  18. SAS: Importing data I: Libnames • Use a LIBNAME statement to identify the directory to save the imported SAS data set • libname movein “/aux/j/jhayes/sas”;

  19. SAS: Importing data II: PROC COPY • Use PROC COPY to create a SAS system file or library from a transport file • proc copy in=moveout out=movein; select gss7296; • The SELECT subcommand must refer to the exact name specified in the PROC COPY/SELECT on VMS

  20. SAS: Conclusions • FTP transport files in binary mode. (ASCII is the default between VMS and UNIX) • Consider keeping your data in a SAS transport file. They can be compressed and read directly by SAS. • SAS transport files can also be transferred to another package, such as Stata, using Stat/Transfer or DBMS/Copy

  21. SAS: New developments • Starting with version 7, SAS data sets (referred to as “tables”) will be platform independent • Watch SSCNews for an announcement that version 7 is available on VMS and UNIX with new SSCC publications available

  22. Clean-up and Back-up! • Get rid of out-of-date, unneeded files before you start this process • Please back-up intermediate (.por or .xpt) files or those you are not actively using to tape (4mm or 8mm) or CD and store them off-line

  23. Compress! Compress! Compress! • > compress gss7296.por reduces disk space used from 1,603,962 to 443,545 • > compress gss7296.xpt reduces disk space used from 5,648,960 to 565,812

  24. Good luck! • Problems? Send log files to consultant@ssc.wisc.edu or stop by during office hours • Contact consultant early to request SSCC staff assistance in transferring all VMS files to UNIX.

More Related