The Custom Import Feature gives you the ability to build field objects from an external file when you know the format of the file.
Select File | Import | Custom Import. The Custom Import Criteria window opens where you define the format of a series of records in the external file, where each record identifies the characteristics of a single field.
Complete the fields in the window with the values that correspond to the data for the field object definitions. See
Click one of these options:
OK – to have TRAN-IDE build the field objects from the data in the file using the values you entered in the Custom Import Criteria window. When you click OK, the Import Custom File window opens. Navigate to and select the file that contains data for the field object definitions and click OK.
Save Settings – to save the settings as a file with a .cis extension. You can use the Load Settings option later to use previously saved settings.
Load Settings – load settings that you saved previously with the Save Settings option.
Close – close the window.
The Start column value is the column position in the data file for that entry. The Length column value is the number of columns in the data file for that entry. Column positions for each record in the file start at “1.” Use a value of zero (0) to tell TRAN-IDE to use the default value for a particular field.
This example shows content from a metadata file that describes field objects, which allows TRAN-IDE to build production object fields automatically.
This functionality applies only to stream fields (not
tree fields).
12345678910111213141516171819202122232425262728
@ part1 0 12 nN9
@ part26 12 8 nN9
@ part305 20 15 nN9
Each line of the file (except the first line), represents data describing one field object. When you enter values in the Custom Import Criteria window, you instruct TRAN-IDE where in the line to find the data needed to build the field object. The example entries are shown in Figure 2-4.
Figure 2-4: Custom Import example input
Remember that the values shown in the metadata file
are not the values you enter in the Custom Import Criteria fields.
The file values describe the actual content for the field object.
The values you enter describe where the data begins and the data’s
length, so TRAN-IDE knows what data to extract to create the production
object fields.
Field Name – in the example, the first field is “part1” and the field name starts at position 6 on a line and has a length of 10 characters, which is what you would enter in the Start and Length fields.
Field Offset – the field’s offset (“0”) starts at position 17 on each line and has a length of 2 characters.
Field Length – the field’s length (“12”) starts at the position 21 and can be up to two characters in length.
Field Separator – this example uses the default field separator (the pipe symbol), so no entries are required in these fields.
Field Type – the field’s datatype. The example’s datatype (“nN9” for numeric) begins at the position 26 and is one character long. The field type is the character in the data file that specifies the field object’s data type as listed in Table 2-1.
Value |
Description |
---|---|
aAxX |
Alphanumeric |
fF |
Alpha |
hH |
Hex16 |
bB |
Unsigned binary |
pP |
Printable |
tT |
Text |
nN9 |
Numeric |
rR |
Raw |
Any other value in the data file results in a data type of raw for the field object.
Key Field – if part of the data file (for example, headers, footers, and titles) should not be included when building the field objects, use this setting. Every line that should be included must start with the same pattern. Enter the line position where the key field begins and its character length. In the example, the key field is “@”, which begins in position 1 and is 1 character in length.
Key Value – enter the pattern with which
each line you want to include begins. For the example, you would
enter @
.
Default Field Separator – to use a different field separator character as the default character, enter the character in this field.
Each column should be 1 character only, although the
example displays 2 digit numbers in the first line for simplification.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |