How to Use Stat/Transfer

The Stat/Transfer File Transfer Utility for Unix simplifies the transfer of statistical datasets between different programs used on the SSCC. Stat/Transfer provides a fast, reliable and automatic way of converting data from one program's data format into the format of another program. During the transfer, Stat/Transfer will automatically handle differing variable naming, missing value and value and variable labeling conventions.

This document provides a very brief introduction to the use of Stat/Transfer for SSCC users. More detailed documentation is provided in the Stat/Transfer User's Manual (PDF).

Getting Started

Stat/Transfer is installed on seldon only, due to licensing restrictions.

You have to login to seldon to run the Stat/Transfer program. If you try to use Stat/Transfer on some other computer in the SSCC, a message will be printed reminding you to use Stat/Transfer on seldon.

The command name used to run Stat/Transfer is quite simple: st

If you use "Stat/Transfer" as your program name, you will see

[abc123@seldon ~]$ Stat/Transfer
-bash: Stat/Transfer: No such file or directory

That's because "Stat/Transfer" is interpreted as the use of a program named "Transfer" in the subdirectory "Stat".

Start an interactive Stat/Transfer session by typing the command st with no other arguments:

[abc123@hardin ~]$ st

You'll see some startup information ending with the st> prompt (to which we type help):

Please type "help" for a brief syntax and format guide.

st> help

For further help type:

help commands    For help on the root Stat/Transfer commands
help copy        For help on copying one format to another
help formats     For help on the formats you can transfer
help set         For help on 'setting' options
help running     For help on running S/T from a shortcut or an OS prompt

Let's see which file formats are supported:

st> help formats

   Extension(s)       Tags   Formats 
   ============       ====   ======= 
        wk*;wr*        123   1-2-3 
        txt;csv      delim   ASCII File - Delimited 
            sts    stfixed   ASCII File - Fixed Format (S/T Schema) 
           stsd     stdata   S/T Schema with ASCII Data 
            fix  fixed-all   ASCII File - Fixed Format (All Schemas) 
            dbf      xbase   dBASE 
            rec        epi   Epi Info 
            xls      excel   Excel 
            xls     excel2   Excel Version 2 
            dat      gauss   Gauss 
            dat    gauss96   Gauss - Unix 
           htm*       html   HTML Table 
            jmp        jmp   JMP Version 4/5 
            jmp       jmp3   JMP ver. 3 
            lpj        lpj   LIMDEP for Windows 
            mat     matlab   Matlab Matrix 
     schema;sch    mineset   Mineset 
                     splus   S-Plus 
       dct;dict     osiris   OSIRIS 
             db    paradox   Paradox 
        wq?;wb?    quattro   Quattro Pro 
            sd2       sas2   SAS Data File - Windows/OS2 
            ssd    sas_dos   SAS PC/DOS 6.04 
          ssd01       sas1   SAS Data File- HP,IBM,SGI & SUN Unix 
          ssd04       sas4   SAS Data File - Dec Unix 
   sd7;sas7bdat        sas   SAS Data File- Versions 7-9 
   sd7;sas7bdat    sas-win   SAS Data File - Versions 7-9 
   sd7;sas7bdat    sas-sun   SAS Data File - Versions 7-9 
   sd7;sas7bdat  sas-linux   SAS Data File - Versions 7-9 
        xpt;tpt       sasx   SAS Transport File 
            sas       sasp   SAS Program & Data File 
            sav       spss   SPSS Data File 
            sav    spss-hl   SPSS Data File - HP,IBM, & Sun Unix 
            por      spssp   SPSS Portable File 
            sps      spsss   SPSS 'Syntax' & Data File 
            dta      stata   Stata 
            dta   stata/se   Stata/SE 
             do    statado   Stata Program & Data File 
            sta statistica   Statistica 
            sys     systat   Systat 

      st> 

Type exit to get out of an interactive Stat/Transfer session.

Using Stat/Transfer by Example

The following simple examples run Stat/Transfer from the Unix command prompt. The Stat/Transfer program is directed by the file extensions of the files named on the command line. The first file named is the input file, and the second file named is the output file. Conversion is done by reading the input file and writing the output file in the new format.

In the case of Stata files, the special File-Type Tag stata/se is used to tell Stat/Transfer to work with a Stata/SE data file, which can contain more variables than the standard Stata data file. The stata/se File-Type Tag may be used to modify any of the files name on the st command.

The stata command runs Stata/SE 64-bit on all SSCC hosts. There is no need to specify the stata-se command to run the special edition of Stata for large datasets.

More complex operations are best performed interactively as documented in the Stat/Transfer User's Manual (PDF).

  • Excel File to Standard Stata File
  • [abc123@seldon ~]$ st indata.xls outdata.dta
    
  • SPSS Portable File to Stata/SE File (for files with many variables)
  • [abc123@seldon ~]$ st indata.por stata/se outdata.dta
    
  • Excel File to Matlab File
  • 
    [abc123@seldon ~]$ st indata.xls outdata.mat
    
  • SAS Dataset to Stata/SE File
  • [abc123@seldon ~]$ st indata.sas7bdat stata/se outdata.dta
    
  • Stata/SE File to SAS Dataset
  • [abc123@seldon ~]$ st stata/se indata.dta outdata.sas7bdat
    
  • CSV (Comma-Separated Values) File to Stata/SE File
  • [abc123@seldon ~]$ st indata.csv stata/se outdata.dta
    

Comma-Separated Values files can be very difficult to work with if they contain character data fields with double-quote characters as values (because those characters are normally separators). Files like that typically use the invisible Delete character as a delimiter. The program delimChange is provided to deal with that particular situation. To learn how to run delimChange, type the Unix command "man delimChange" and look at the Examples section.

Last Updated: 20 November 2008

Information Technology 1800 Sherman Avenue Evanston, Illinois 60201 | Contact Us

Northwestern Home | Calendar: Plan-It Purple | Online Directory | Search

World Wide Web Disclaimer and University Policy Statements

© 2009 Northwestern University