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

  • View
    212

  • Download
    0

Embed Size (px)

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

  • Transferring VMS SAS/SPSS Data to UNIXJeff HayesSocial Science Computing Co-opFebruary 26, 1999

  • ProblemSAS and SPSS data sets are stored in binaryBinary representations differ across operating systems (VMS and UNIX)

  • Dont forgetAbout your files on VMS tapes. Files stored as SAS or SPSS data sets on tape need to be transportedFor SPSS, data sets need to be based on SPSS version 4 or later

  • Steps to transfer dataExporting the data set(s) on VMS (Run some descriptives!)FTPing the data to UNIXSPSS portable files as ASCIISAS transport files as binaryImporting the data set(s) on UNIX (Re-run the descriptives and check the data!)

  • UNIX disk allocationsMost 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)

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

  • Translation toolsSSCC 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)

  • SPSS: Exporting dataUse a GET command to identify the data set you wish to transferUse an EXPORT command to create the portable file. (Recommend .por extension)Run descriptive statistics for verifying data transfers success

  • SPSS: FTP the dataLogin to UNIX and get to the directory where you want the data to end upStart FTP (ftp eagle) and login to Eagleget staffdisk2:[100041.spss]gss7296.por gss7296.porWhen completed, type quit to exit FTP

  • SPSS: Importing dataUse an IMPORT command to read the portable file on UNIXIf you wish, you can use a SAVE command to create a SPSS system fileRe-run the descriptive statistics to compare to results on VMS

  • SPSS: ConclusionsConsider keeping your data in a SPSS portable file. Its 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/CopyWhen transferring SPSS portable files, use FTP in ASCII mode (default between VMS and UNIX)

  • SAS: Exporting data I: LibnamesUse 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;

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

  • SAS: Exporting data II: PROC COPYUse PROC COPY to create a transport file from a SAS system file or libraryproc copy in=movein out=moveout; select gss7296;

  • SAS: Exporting data II: PROC COPYThe SELECT subcommand copies only the file named to the transport fileOmitting the SELECT subcommand will create a transport file containing all of the SAS data sets in the specified directory. PLEASE DONT. 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.

  • SAS: FTP the dataLogin to UNIX and get to the directory where you want the data to end upStart FTP (ftp eagle) and login to EagleType binary to specify that the transport file will be transferred in binary modeget staffdisk2:[100041.sas]gss7296.xpt gss7296.xptWhen completed, type quit to exit FTP

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

  • SAS: Importing data I: LibnamesUse a LIBNAME statement to identify the directory to save the imported SAS data setlibname movein /aux/j/jhayes/sas;

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

  • SAS: ConclusionsFTP 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

  • SAS: New developmentsStarting with version 7, SAS data sets (referred to as tables) will be platform independentWatch SSCNews for an announcement that version 7 is available on VMS and UNIX with new SSCC publications available

  • Clean-up and Back-up!Get rid of out-of-date, unneeded files before you start this processPlease 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

  • 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

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