Defining Fields In a Line Sequential or Fixed Width File
In the Write to File stage, the Fields tab defines the names, position, and, for some file types, lengths, of the fields in the file. After you define an output file on the File Properties tab you can define the fields.
To define fields with default values for position, length, and data type, click Quick Add and select the fields to add.
To add fields manually from a list of fields used in the dataflow, follow this procedure:
- Click Add.
- In the Name field, choose the field you want to add.
-
In the Type field, select the data type of the field
coming from the dataflow.
Spectrum Technology Platform supports these data types:
- bigdecimal
- A numeric data type that supports 38 decimal points of precision. Use this data type for data that will be used in mathematical calculations requiring a high degree of precision, especially those involving financial data. The bigdecimal data type supports more precise calculations than the double data type.
- boolean
- A logical type with two values: true and false.
- bytearray
- An array (list) of bytes. Note: Bytearray is not supported as an input for a REST service.
- date
- A data type that contains a month, day, and year. For example, 2012-01-30 or January 30, 2012. You can specify a default date format in Spectrum Management Console.
- datetime
- A data type that contains a month, day, year, and hours, minutes, and seconds. For example, 2012/01/30 6:15:00 PM.
- double
- A numeric data type that contains both negative and positive double precision numbers between 2-1074 and (2-2-52)×21023. In E notation, the range of values is -1.79769313486232E+308 to 1.79769313486232E+308.
- float
- A numeric data type that contains both negative and positive single precision numbers between 2-149 and (2-223)×2127. In E notation, the range of values -3.402823E+38 to 3.402823E+38.
- integer
- A numeric data type that contains both negative and positive whole numbers between -231 (-2,147,483,648) and 231-1 (2,147,483,647).
- list
- Strictly speaking, a list is not a data type. However, when a field contains
hierarchical data, it is treated as a "list" field. In Spectrum Technology Platform a list is a collection of data consisting of multiple
values. For example, a field Names may contain a list of name values. This
may be represented in an XML structure
as:
It is important to note that the Spectrum Technology Platform list data type different from the XML schema list data type in that the XML list data type is a simple data type consisting of multiple values, whereas the Spectrum Technology Platform list data type is similar to an XML complex data type.<Names> <Name>John Smith</Name> <Name>Ann Fowler</Name> </Names>
- long
- A numeric data type that contains both negative and positive whole numbers between -263 (-9,223,372,036,854,775,808) and 263-1 (9,223,372,036,854,775,807).
- string
- A sequence of characters.
- time
- A data type that contains the time of day. For example, 21:15:59 or 9:15:59 PM.
-
If you selected a date, time, or numeric data type, you can use the default date/time or number format or you can specify a different format for this specific field. The default format is either the system default format that has been set in the type conversion options in Spectrum Management Console, or it is the dataflow's default format specified in the type conversion options in Spectrum Enterprise Designer. The format that is in effect is displayed. To use the default format, leave Default selected. To specify a different format, choose Custom and follow these steps:
- The Start Position and Length fields are automatically filled in based on the data in the dataflow and number of fields you have already added.
-
Click Add.
Alternatively, you can also add a field by first defining the starting position and length of the field. To do this, under Sample File click at the position where you want to begin a field and drag to the left so that the desired field is highlighted, as shown here:
After defining the fields in your output file, you can edit its contents and layout. The Recalculate start position option tells the Write to File stage to recalculate the positions of the fields when you modify, move, or remove a field in the output file. Uncheck this box if you do not want the positions recalculated and instead want the fields to stay in their existing position after you edit the output file.
Option Name |
Description |
---|---|
Add |
Adds a field to the output. |
Modify |
Modifies the field's name, type, start position, and length. |
Remove |
Removes the selected field from the output. |
Move Up/Move Down |
Reorders the selected field. |