A flat file schema is a simple, one-level field structure that has the same data row type throughout the text document. This page covers creating a custom flat schema within a transformation.
To be able to create a flat file schema, first add a transformation to an operation. If the operation also an activity located adjacent to the transformation on the side where you want to use a flat schema in the transformation, it must not have a file schema provided in the activity configuration. That is, while configuring the activity, in the area where you can provide a request or response schema, make sure to select No so that the schema is not inherited by the transformation.
Provided this condition is met, the Define Schema button will be displayed in mapping mode on each side of the transformation that does not already have a schema defined in an activity. Click Define Schema on the source or target side of the transformation and select Create Flat:
Configuration of a file schema using the flat file schema editor is covered as follows:
Options: When Character Delimited is selected, these options become available:
Line breaks for end of records: Select this checkbox to use line breaks to separate records. This option is selected by default. When this option is selected, end of records are denoted by line breaks so that each record exists on one line (unless using a qualifier). When disabled, line breaks are ignored and new records begin after the total number of fields are reached.
|NOTE: This option is relevant only for schemas used on the source side of a transformation. For schemas used on the target side of a transformation, line breaks are always used to denote end of records.|
String Qualifier: Enter a character to use as wrapper to indicate a string of words to be treated as a data unit. The default is a double quote. In addition, select a corresponding business rule, Always or When needed, to indicate when the qualifier should be used. The default When needed is recommended.
Convert escape sequences: Select this checkbox to convert or ignore escape sequences as indicated by a backslash
\. By default, escape sequences are converted in accordance with Java standards. When disabled, text conversion occurs with no interpretation of escape sequences.
|NOTE: This option is relevant only for schemas used on the source side of a transformation.|
Add Field: Click the Add Field button to add new field rows one at a time to the table. These columns are available for each row:
Field: Enter a name for the field. The field name cannot contain whitespace characters or symbols such as these:
@ $ % & / + ( ) : ; ,. In addition, the field name cannot begin with a number, period (
.), or hyphen (
|TIP: For reference on all unallowed characters, see NCName as defined by W3C.|
Type: Use the dropdown to select a data type. Options for new custom schemas include
boolean. If a custom schema was created by mirroring a schema from a server-based activity, additional data types may be listed.
Fixed-length text files always specify a certain number of characters that are reserved for each field. For example, you may identify a field called
LastName that always has 30 characters reserved for it. If the actual value is "Smith", only 5 characters are used; the remaining characters have nothing in them.
End: For Fixed Width schemas only, enter the ending character position. When the starting character position and length are already entered, this field will be calculated automatically.
|NOTE: By default, fixed-length segments are terminated with a newline character.|
Actions: For actions you can take on an existing field row, hover over the field on the far right under the actions menu icon . Then click the copy icon to duplicate the field row, or click the trash icon to delete the field row.
After a custom flat file schema is created, you can access additional menu options that are available for all schemas.
These include deleting, renaming, viewing dependencies of, deploying, configurable deploying of, and adding to a group, as well as editing a schema or clearing a schema from a transformation. For details on these actions, see Schema Menu Actions.