variable Statement

Added: build 1

Purpose

Creates input and output variables.

Applicability

The variable statement can be used within RowFieldInputFile and RowFieldOutputFile sections.

Additional Information

The variables values are determined by specifying their row and field positions within a file.

Syntax

variable: <name> <type> <row> <field> [default=value][fformat=string]
                                      [description=string][units=value] 
                                      [upperBound=value][lowerBound=value]
                                      [ignoreConversionErrors=true/false]
                                      [enumValues=val1,val2,...,valN] 
                                      [enumAliases=val1,val2,...,valN] 

Arguments

NameDescription
name The name is a string that specifies what the variable will be called.
type The type can be any primitive type supported by the Analysis Server: double, integer, string, boolean, and reference.
row This argument is used along with field to specify a file location. The row values can be determined in a number of ways. By default, the beginning and end of the file serve as the reference points. Positive row values use the beginning of the file reference point, and negative row values use the end of file reference point (see the markAsBeginning and markAsEnd sections).
field The delimiters being used (see the setDelimiters section) determine the fields. This value will determine the first column of a range when the setDelimiters columns statement is being used.

Options

NameDescription
default This option can be used to specify a default value. All entries in the variable will be set to this value initially. A default argument will take precedence over the initialization file.
fformat The fformat option is optional unless the setDelimiters columns statement is being used. It specifies a standard FORTRAN formatting string that controls the width of the formatted variable. The Analysis Server supports the I, G, E, F, and A FORTRAN formatting options.
description This option allows the user to write a description for the variable.
units This option allows the user to write a units string for the variable.
upperBound This option allows the user to set an upper bound for the variable.
lowerBound This option allows the user to set a lower bound for the variable.
ignoreConversionErrors This option applies to doubles and integer type variables only; if the number cannot be converted into an appropriate format, i.e., a string is assigned to a double, the FileWrapper will not generate an error with this option set to true.
enumValues This option allows the user to specify the set of possible values for the variable. The enumerated values are specified as a comma separated list of values.
enumAliases New as of build 169. This option allows the user to specify a set of string values that may be associated with the enumerated values. If the variable is set to a value in the alias set, the actual value will be set to the corresponding value in the enumValues set. The aliases are specified as a comma separated list of values. There must be the same amount of elements in the enumValues and enumAliases sets.

Example

If the following is a portion of an input file:
width=1
height=2
depth=3,4,5
then the section below could be used in a RowFieldInputFile to describe the locations of variables:
markAsBeginning "width"
setDelimiters " =,"

#          name    type    row  field
variable:  width   double  1    2
variable:  height  double  2    2
variable:  depth1  double  3    2
variable:  depth2  double  3    3
variable:  depth3  double  3    4 
If the width value has an upper bound of 10 and the height value is confined to values 2, 3, or 4, and all variables have units of inches, then the following statements could be used.
markAsBeginning "width"
setDelimiters " =,"

#          name    type    row  field
variable:  width   double  1    2  upperBound=10 units="inches"
variable:  height  double  2    2  enumValues="2,3,4" units="inches"
variable:  depth1  double  3    2  units="inches"
variable:  depth2  double  3    3  units="inches"
variable:  depth3  double  3    4  units="inches"

See also Analysis Server | FileWrapper | FileWrapper Statements