Transfers from the Operating System Prompt
Previous Topic  Next Topic 

You can run a transfer directly from the operating system (OS) prompt or you can execute a command file.

If you wish to run a transfer directly from the OS prompt, then the COPY command is implicit, and (if the command processor is on your path) you type the following:


        ST  infilename.ex1 outfilename.ex2    -x1    -x2   ...


where infilename.ex1 and outfilename.ex2 are the input and output files, respectively, just as they are for the COPY command used within the command processor.  File-type tags are used in the same way.


In order to run a transfer from the command line, you will either need to be in the directory in which you installed Stat/Transfer, or have that directory on your path, or precede 'st' by the path to Stat/Transfer.


The same parameters, -xi, that are used from within the command processor from the Stat/Transfer prompt, are also used at the OS prompt.


When a transfer is run directly from the OS prompt, variable selection and case selection are not possible.  All variables and all cases will be transferred.  Carrying out a transfer from the OS command line is equivalent to copying the file from one format to another.


For example, to transfer all of the variables and cases from an Excel file, indata.xls to a Stata file, outdata.dta, type:


   st   indata.xls   outdata.dta


If you need to set options with SET commands before your transfer, you can do it one of two ways. 


  1. You can put them in a file and execute the options file by using the  -ex switch.  For instance, if your options are in a file called myopt.stcmd, you can execute them prior to the transfer by typing:

       st   indata.xls   outdata.dta -exmyopt.stcmd


  1. If you need these options all the time, you can put them in a startup options file.


Wildcard transfers can be specified from the OS prompt, just as they are from the st prompt.