Defining the Export Record
You must know the format of the record you intend to export. This includes having a list of all the fields that comprise the record and the lengths and formats of those fields.
If you omit fields from the ImpExpCombined control group, the export record will contain the information specified for the Trigger2WIP control group in the order it is listed. The default layout is a fixed record length. If the fields are omitted from both the ImpExpCombined and Trigger2WIP control groups, an error occurs.
Surround each field element within the export record with field separators. This helps input systems parse the field information. The default field separators are quotation marks (“), as shown here:
WIP = “data”“data”“data”
Fixed or variable record lengths
Fixed length records are always the same. In a fixed length record, all field data has a known (output) size that must be generated. Adding all the field lengths together, generally equals the fixed record length. (Remember to add two separator strings for each field to determine the actual length.)
Variable record length output typically means that some or all of the data element will not adhere to a fixed size.
With variable length records, you often need a marker that identifies where each field element begins and ends. These elements are typically constant —meaning each field begins and ends with the same value. This is the purpose of the field separator mentioned previously. The field separator defaults to a quotation mark (“), but you can specify any string of up to 39 characters.
Delimiting the fields is often necessary because the importing program needs to recognize where fields begin and end within the variable record. Although a fixed length record may not always require field separators, there is no harm caused by using them.
Listing the field source, length, and format
Build a table with this information:
- Each field that will be contained within each record
- Any length requirements of the field data
- Any special formatting requirements for writing the data to the output record.
With a fixed length record layout, each field has a specific length. In variable length records, a field may have no specific length requirement or may have a minimum or a maximum length requirement or both. Note the length requirements for each field.
Finally, note any special formatting requirements for each field. When composing this information, keep in mind that the manner in which the data is formatted within the export record may be different that the export record requirement. This would include information such as the following:
- Should the data be left or right justified in the output?
- For date fields, what format should be used (such as Month/Day/Year or Year/Month/Day)?
- For numeric data, should values include or not include commas, dollar signs, and so on?
- Should a decimal number be converted to integers (should 41.1 written as 41)?
- Should integers be written as decimals (41 becomes 41.00)?
- Is there constant or filler data that should be written for a given export record field that will not be derived from a form set field? For example, you might want to write a given value into all records for a certain field because the importing program requires such a value.
Defining the export fields and formats
Once you have identified the fields that comprise the export record, you have to define these fields and the formats required to build the defined record layout.
The record layout for the record must be defined in the INI file, in this control group:
< ImpExpCombined >
For each field that should be exported to the export record line, you must include a line in the INI file. You may export as many fields as necessary. Each line must begin with the FIELD= statement and has the following syntax.
FIELD = GVM Fieldname;formatstring
You can omit the GVM Fieldname from any record location that must contain constant or filler information not derived from the actual export record. See Format Specification Flags for more information.
The formatstring is optional. If you include it, be sure to precede it with a semicolon. Whatever occurs after the semicolon is used to modify the field data in a specific manner. You can use format string flags to increase or decrease the data to a predetermined size or convert the data from one value format to another.
If a named export field is not followed by the format string, the format is derived internally by querying the GVM definition and will yield a constant string length result.
Specifying the format
If the output record area for a definition is a filler area — meaning that the output data is predetermined and not part of the export data — you can omit the field name. If you omit the field name in this manner, you must specify a format or nothing is written to the output record.
Constant data is often used to write header or trailer information to variable length records to help the importing system recognize where the record begins and ends. Also, you can use this method to write additional characters or data between fields such as, for example, if you need to include a comma between each field data element of a variable length record. Here are some examples:
FIELD = Key1;%-3.3s
FIELD = ;,
FIELD = KeyID;%-10.10s
In the first case, the value from Key1 is formatted as three characters in the output data. This constant text value of a comma is written next, followed by 10 characters from KeyID. If you assume Key1 contains BOB and KeyID contains 123456789, the result is as follows:
WIP = “BOB”“,”“123456789 ”
Notice that each field, whether constant or not, contains field separators. Also notice that the data for KeyID was padded to 10 characters even though the actual value only contained nine characters.
Converting dates
Date format conversions are specified using the D as the first character. The D is followed by the input format specifier for the data, a semicolon, and the format specification for output. Here is an example:
FIELD=CREATETIME;DX;D4
This example names the field CREATETIME. The D following the semicolon tells the system to retrieve this field and convert it from the format defined as X into the output format, D4. X represents the hexadecimal character format. D4 is a standard YYYYMMDD format without separators.
© Copyright 2020, Oracle and/or its affiliates. All rights reserved. Legal notices.