Creating a Flat File Schema instructs Clarify how to format data it reads from or
writes to a multiple-format Flat File.
You must have sample data in Clarify to use the Create from Sample option.
Cleo recommends creating a new folder called samples in your Project at the same
level as the src and META-INF folders to hold sample data.
If your flat file is fixed-length, part of creating a multiple-format Flat File
Schema requires you to adjust the field lengths. If, after reading this topic, you feel
you need more detailed information on this process or would like to see an example, see
Altering Fields on Multi-Format, Fixed-Length Flat Files.If your flat file is delimited,
you will not need to adjust fields.
-
Select File | New | Flat File Schema from the main menu.
Note: If you select the Package in which the Flat File Schema should reside
before creating it, some parameters are automatically populated in the
New Flat File Schema window.
-
The New Flat File Schema window appears. Choose Create From Sample from the Create radio button options. Click Next.
-
Either type a file path in the File Name field or click Browse to
produce the Select File window. Once you've selected a file, click
Next.
-
The Fixed Length or Delimited panel appears. Clarify automatically
detects for the parameters below, but you should double-check the values.
- If the file is Fixed Length, choose Fixed Length
from the Flat File Type radio-buttons.
- If the file is Delimited, choose Delimited from the
Flat File Type radio buttons. If the Delimiter parameter
is incorrect, type the correct delimiter. If using one, type an escape
character in the Escape Wrap Character parameter.
Click Next.
-
If the file is fixed-length, the Alter Fields panel
appears.
Focus only on the first format. Change the field lengths, from
left to right, until whatever field denotes the record is the correct
length. If the first field of the first format is what denotes the record,
only adjust that field's length.
- If you need to re-adjust a field, click the field header (ex.
Field1) and change the number in the Field Length field.
- If you need to add a field, click the header of the field you
want to precede the additional field, then click the Insert
a field button.
- If you need to remove a field, click the header of the field you
want to remove, then click the Remove a field button.
Click Next.
-
The Record ID panel appears. If the file is multiformated,
select the MulitFormatted Flat File checkbox. In the Record ID
drop-down, choose the field that signifies what data is contained in that
format. Click Next.
Note: Most often, it's the first field, so Clarify chooses Field1 as the
default.
-
The Record Structure panel appears.
-
Make sure each record you need is listed in the Record Structure
area, under the correct Record Group.
- If a record is missing in the Record Structure
area, select it in the Available Record IDs
area and click the Add Record ID to Record Structure
button.
- If you need an additional record group, in the
Record Structure area, click the Create Record
Group button. Then use the Add Record ID to Record
Structure button to add records to it.
- If you need to remove records or record groups,
select it and press the Remove button.
-
In the Record Structure area, select each field header (Field1,
etc.). With the field highlighted, make sure the Field Properties,
Data Type, and Field Length accurately reflect the field.
If not, change them.
- In the Field Name field, type a name for the data.
- In the Data Type field, specify if the data is a Boolean
(true false), Decimal, Integer, or String type.
- If the file is fixed-length, make the field length
the correct number of characters.
Do this for each field in each format. When you are done, click
Next.
Note: always adjust fields from left-to-right. Adjusting a field affects
the length of the field to the right of it, so if you don't start
with the leftmost field and go in order, you'll have readjusting to
do.
-
If the file is delimited, the Transformation Settings
section appears. Select a radio button to specify the role this file will play
during transformation. Options are:
- Source: The Schema will be used to format the input documents for
transformation
- Target: The Schema will be used to format the transformation's
output documents
- Both: The Schema will be used to format both input and output
documents
- None: The Schema will not be used in transformation, therefore
Transformation Settings are not needed.
-
Provide the Source folder, Package, and Name. Click
Next. Click Finish. The Flat File Schema editor appears.
Next: Make any changes to your Flat File Schema in its editor. If you need
help customizing it, see Customizing Flat File Schemas.To use
the Schema, select it when Creating Rulesets.