Options for Variables
Previous Topic  Next Topic 


Several options are set with parameters of the form '-xi'.  These are given after the COPY command and can be given in any order.


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


They can also be used at the operating prompt:


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



Automatic Optimizing of Output Variable Type

Stat/Transfer attempts to produce the smallest possible output data set. After reading your data, Stat/Transfer will, by default, make an optimization pass during the transfer, to determine more information about each variable, and then will assign target output types.  (See Target Output Variable Types for a discussion of output types used by Stat/Transfer.)


The optimization pass will be performed if the file contains any string variables or if the selected output file type is such that the output file could be made smaller by optimization.  Some output file types, such as Stata, have a rich assortment of storage types and benefit from optimization.  Others, such as worksheets or files that have only one numeric type (SPSS for example), do not benefit.


Stat/Transfer can determine whether any variables can be represented as integers, and, for those cases, it can determine the smallest possible integral type that can be used to represent the data.  Further, if a variable cannot be represented by an integral type, Stat/Transfer can automatically determine whether it can be represented by a float instead of a double without a loss of information.  Information on the maximum length of string variables is also accumulated, so that these can be stored in variables of the smallest possible length.


If you wish to tell the Stat/Transfer command processor to turn off automatic optimization of the output variable types, you must use the parameter '-o-':


     COPY  infilename.ex1   outfilename.ex2   -o-


When this parameter is given, Stat/Transfer will not make an optimization pass through the input file even if it would benefit from it.  We do not recommend using this option.


Optimization is turned back on with the parameter '-o'.


In almost all cases it is appropriate to accept the target output types that Stat/Transfer chooses.  However, there are times that you may wish to override these defaults and set the output types yourself. You can change output variable types manually, as described in the section Changing Output Variable Types.  If you choose to do so, the parameter '-o' should not be used with the COPY command.



Floats Option

The behavior of the use of 'floats' or 'doubles' during the optimization pass has changed.


By default, Stat/Transfer will evaluate each variable to see if it can be represented as a 'float' without a loss of information, and will otherwise put those variables that require it into a 'double'.


If you want to change the default and use 'floats', there is a new '-of ' switch,  which tells Stat/Transfer to put variables with fractional parts into 'floats' on output. 


Most data are not measured with more than eight or nine digits of precision (survey data, for example, never are).  If you are concerned with the size of your output dataset, you might want to use the 'floats' option.


To tell the Stat/Transfer command processor to force numbers with fractional parts into floats where appropriate, use the following:


     COPY  infilename.ex1   outfilename.ex2   -of


When this parameter is given, Stat/Transfer will both optimize the variable types and use floats.  The floats option can only be used when output is optimized. 


If you choose to set output variable types manually, the parameter '-of' should not be used with the COPY command.



Automatic Dropping of Constants from Output File

You can tell Stat/Transfer to automatically drop variables that are constant or missing for a selected subset of data.


In order to tell Stat/Transfer to automatically drop constant or missing variables,  the parameter '-oc' is used:


     COPY  infilename.ex1   outfilename.ex2   -oc


When this parameter is given, Stat/Transfer will both optimize the variable types and drop variables where needed.  Note that the drop-constant option can only be used when the output is optimized.


You can use the doubles parameter and the drop-constants parameter simultaneously, using the parameter '-ocf'.


   COPY  infilename.ex1   outfilename.ex2   -ocf


If you choose to set output variable types manually, the parameters '-oc' or '-ocf ' should not be used with the COPY command.



.