setDelimiters columns Statement

Added: build 1

Purpose

Enables special formatting option for values that take up a range of character positions within a file; this option is most often used in FORTRAN input/output files.

Applicability

The setDelimiters columns statement can be used within the RowFieldInputFile and RowFieldOutputFile sections.

Additional Information

This is a specific use of the setDelimiters statement that supports FORTRAN-style input/output files.

The field values in any array and variable statements that follow a setDelimiters columns statement will specify the starting column position. The use of a fformat statement (see the variable section) is required and will determine how many characters wide the field is.

Syntax

setDelimiters columns 

Example

Many FORTRAN codes use predefined format statements to read and write data files. In some cases no delimiters are used only field widths and positions. Suppose two variables are written to a file using the `I3' FORTRAN format. This allows two integer values to occupy three columns each. The output file could have the form of any of these cases:
case 1:  xxxyyy 
case 2:    x  y 
case 3:  x  y     
case 4:   xx yy 
If the person wrapping this code does not realize that they could have data similar to case 1, their wrapper will fail because there will be no way to separate the two data items in case 1. The other cases could lead one to believe that the data is space delimited, when in fact it is not. In this type of situation, the setDelimiters columns statement should be used as follows:
setDelimiters columns 
 
#          name        type  row  field  format 
variable:  firstValue  int   1    1      fformat="i3"
variable:  secValue    int   1    4      fformat="i3"
The section of code above assumes that the data is located on the first row. The fformat statement specifies the number of columns the integers occupy (see the variable section). For this example each variable occupies three columns. When the FileWrapper program uses this code, it will look in columns one, two, and three for the value of firstValue and in columns four, five, and six for the value of secValue.

See also Analysis Server | FileWrapper | FileWrapper Statements