3 Setting Up Interfaces for Electronic Data Interchange
3.2 Understanding Flat File Data Formatting
3.2.3 Formatting Flat File Data for Outbound Documents
Depending on the capabilities of the translator software that you use, you might have to specify how the data should be formatted in the flat file when running the
Outbound Flat File Conversion program from the EDI outbound interface tables into the flat file.
Each record within a flat file must be consistent in record length and field position.
Most EDI translator software packages read the data positionally within each record; if the data varies in length and field position, most fields are not read correctly by the translator software.
3.2.3.1 Dates
The system determines how a date is formatted in a flat file when you run the Outbound Flat File Conversion program through a combination of the date-format user preference and the default value for century change year (CENTCHG in UDC 00/DF). When the date-format user preference is MDY (month, day, year), YMD (year, month, day), or DMY (day, month, year), the Outbound Flat File Conversion program uses the default value for CENTCHG to determine whether the year (Y) portion of a Value in Flat File
Converted Value in Interface Table
Value Displayed with Three Display Decimals
Attribute of Field in Interface Table
123 123 123 Numeric 9
123 123 123 Numeric 9
-123 -123 123- Numeric 9
123- -123 123- Numeric 9
0 0 Numeric 9
0 0 0 Numeric 9
000000000 0 0 Numeric 9
Understanding Flat File Data Formatting
Setting Up Interfaces for Electronic Data Interchange 3-7 date is four digits or two digits. If the year being processed by the Outbound Flat File Conversion program is less than or equal to the CENTCHG default value, the system converts the year in the flat file to two digits. If the year being processed by the Outbound Flat File Conversion program is greater than the CENTCHG default value, the system converts the year in the flat file to four digits.
For example, if the default value for the CENTCHG item is 15 and the date-format user preference is MDY, the system uses this formatting in the Outbound Flat File Conversion:
You can also set the year portion of the date so that it is always produced as four digits in the flat file when you run the Flat File Conversion program. To set the year portion, follow these steps:
1. Set up a custom date format in UDC table 00/DF as MDE (month, day, four-digit year).
This is a predefined date format that the Outbound Flat File Conversion program uses to display the date as four digits. The order of the date in the custom date format can be changed to produce the desired date-format output, such as DME (day, month, year), EMD (year, month, day), and so on.
2. Assign this custom date format to the date-format user preference.
For example, if you set the date formatting so that the output always appears as four digits, the system formats the date as indicated in this table after you run the Outbound Flat File Conversion program:
Date to Be Formatted
Typical Interface Table
Format (Julian Dates) Converted Value in Flat File
May 14, 1998 98134 05/14/98
December 12, 2014 114346 12/12/14
December 12, 2015 115346 12/12/15
December 12, 2016 116347 12/12/2016
Blank Date 0 00/00/00
Note: Date formats for month, day, and year should always be converted as two digits for the month, two digits for the day, and two or four digits for the year. If the EDI translator software reads any flat file record positionally, you must select a specific date-format user preference for the user profile that uses the Flat File Conversion program. If the date-format user preference is blank, the displayed date is based on the system default value, and single digit months and days appear with only one position. For example, the output for the date May 14, 1998, appears as 5/14/98.
Date to be Formatted
Typical Interface Table
Format (Julian Dates) Converted Value in Flat File
May 14, 1998 98134 05/14/1998
December 12, 1998 98346 12/12/1998
December 12, 2015 115346 12/12/2015
Understanding Flat File Data Formatting
3.2.3.2 Numeric Values
Numeric fields in Flat File Cross-Reference program (P47002) output appear as 32 positions. The first position indicates the sign of the subsequent value. A 0 indicates the number that follows is positive, and a dash indicates that the number that follows is negative. The next 20 positions indicate the whole number portion of the value, followed by a separator and then by 10 digits that indicate the decimal portion of the value. The separator character is based on the setting in the user preference for the decimal format character. Typically in North America, this value is a period. Numeric values always appear in this format, regardless of whether the field in the EDI outbound interface table is stored with a decimal.
This table shows the flat file format that corresponds to the values shown in the EDI outbound interface tables:
When you send or receive documents with decimal numbers, you must use a place holder such as a period (.) to indicate the position of the decimal. You define the place holder in the user preference table.
3.2.3.3 Character Values
The system produces character strings from the EDI outbound interface tables to the flat file and pads the values with blank spaces out to the number of positions of the field. Typically, these positions are left justified in the field. However, a few exceptions exist, such as the data dictionary item Business Unit (MCU), which is right justified (just as it appears in the actual field). The system pads fields that are blank with blanks.
This table lists the character strings that are produced from the EDI outbound interface tables to the flat file:
3.2.3.4 Example: Formatting Flat File Data for Outbound Documents
These examples illustrate correctly formatted flat file data:
December 12, 2016 116347 12/12/2016
Blank Date 0 00/00/0000
Value in Interface Table Format in Flat File
1 or 1.0 000000000000000000001.0000000000
100686.54 000000000000000100686.5400000000
100686.54- -00000000000000100686.5400000000
0 00000000000000000000000000000000
Value in Interface Table
Interface Table Field and
Attributes Format in Flat File
F47047 ZAFILE in F4714 - Alpha 10 F47047
30 SYMCU in F47046 - Alpha 12 30
A blank field in any F47 table Date to be Formatted
Typical Interface Table
Format (Julian Dates) Converted Value in Flat File
Setting Up Customer Billing Instructions
Setting Up Interfaces for Electronic Data Interchange 3-9 1,000000000000000000001.0000000000,00001,00000000000000010005.0000000000,IN