Target Output Variable Types
Previous Topic  Next Topic 

Output Variable Types

Systems differ widely in the number and variety of variable types they support.  When data are transferred from one file type to another, a variable type in the output format must be assigned to each of the variables being transferred.


Note that with Stat/Transfer, numerical precision is never lost in the transfer process, since all numerical variables are stored internally as double precision floating point numbers and are then written out according to the assigned variable type.


Stat/Transfer automatically reads your dataset an extra time in order to determine the optimum output types for each variable and the maximum length of string variables. In almost all cases it is appropriate to accept the output types that Stat/Transfer chooses.  However, there are times that you may wish to override these defaults and set the output types manually.


Target Types Assigned by Stat/Transfer

When assigning default output variable types, Stat/Transfer attempts to use all of the information at its disposal about the input data variables in order to preserve numeric precision and, at the same time, minimize the size of the output data set.


When reading numerical variables, Stat/Transfer selects a target output variable type based on the information available to it.  This target variable type is not used for internal storage during the transfer, but is simply the preferred output type.  If this type is not supported in the chosen output file type, the best approximation will be chosen.


The various target output variable types used by Stat/Transfer are:



byte

One byte signed integer (-128 to 100)


int

Two byte signed integer (-32768 to 32740)


long

Four byte signed integer


float

Four byte IEEE single precision floating point number


double

Eight byte IEEE double precision floating point number


date

Date stored as serial day number (days since December 30, 1899)


time

Fraction of a day (12:00 noon = .5)


date/time

Floating point number (integer  - serial day number; fractional part - time)


string

Character string  (stored internally in Unicode UTF-8 representation.


Remember that the target type will not necessarily be the actual output type.  If the target type assigned to a variable by Stat/Transfer is available as one of the variable types of the output file format, then that type will be used for the output.  If the assigned target type is not one of the available output types, then a format of the next larger size will be used.