The program loads information from the company file/table into the WIX_* system variables and information from the trading partner database into the system variables that hold trading-partner and trade agreement information.
The program performs a trading partner lookup to determine which map to run. Based on the search option chosen (switch selected/parameter used), the program looks for a match between the values in specific system variables (which were loaded from fields in the incoming envelope) and corresponding fields in the trading partner database.
Each time the program reads a new ISA envelope, it updates the ISA_IN_NO field in the trading partner table in the trading partner database using the value from the following areas:
Interchange Control Number (ISA 13) field in X12 envelopes
Interchange Control Reference (UNB S004 0020) field in EDIFACT envelopes
File Control ID (FHS 00091) field in HL7 envelopes
Each time it reads a new GS envelope, the program updates the GS_NO field in the trade agreement table in the trading partner database using the value from the following areas:
Functional Group Header Control Number (GS 06) field in X12 envelopes
Interchange Control Reference (UNG S004 00248 field in EDIFACT envelopes
Batch Control ID (BHS 00091) field in HL7 envelopes