Codepackr / edi / EDI 997 & CONTRL Ack Generator

EDI 997 & CONTRL Ack Generator

Generate ANSI X12 997 and EDIFACT CONTRL functional acknowledgments with auto-reversed sender/receiver envelopes.

Client-Side Execution & Privacy Guarantee

This utility executes 100% locally in your web browser. Your inputs, tokens, queries, and data payloads are never transmitted to any external server or backend.

A functional acknowledgment tells the sender that an interchange, group, or message was received and passed basic syntax checks. In X12 the acknowledgment is a 997 transaction set; in EDIFACT it is a CONTRL message. Both reverse the original sender and receiver identifiers and echo the control numbers being acknowledged.

The generator reads the inbound document, extracts the necessary control numbers and identifiers, reverses the parties, and emits a well-formed 997 or CONTRL. You can choose accepted, accepted-with-errors, or rejected status. All processing stays in the browser.

X12 997 Structure

A 997 contains ST, AK1 (functional group response header), optional AK2 loops (one per transaction set), AK5 (transaction set response trailer), AK9 (functional group response trailer), and SE. AK1 carries the original GS01 functional identifier and GS06 group control number. AK2 carries the original ST01 and ST02. AK5 reports the status for that transaction set (A = accepted, E = accepted with errors, R = rejected). AK9 reports the group status and the counts of included, received, and accepted sets.

The generator builds the ISA/GS envelopes with sender and receiver reversed from the inbound ISA and GS, assigns a new interchange and group control number, and sets the functional identifier to FA.

EDIFACT CONTRL Structure

A CONTRL message begins with UNH, contains a UCI segment that identifies the original interchange and its status, and may contain UCM segments for individual messages. UCS and UCD segments point to segment- and element-level errors when present. The message ends with UNT and the interchange ends with UNZ.

The generator reverses the UNB sender and recipient, copies the original interchange control reference into the UCI, and sets the action code according to the status you select.

Status Codes and Counts

For a clean acceptance the 997 uses AK5*A and AK9*A with matching counts. For a rejection it uses R and zero accepted. Partial acceptance uses P on the AK9 when some but not all transaction sets are accepted. The generator calculates the counts from the inbound document so the numbers are consistent.

You may override individual transaction-set statuses when you need to acknowledge a multi-transaction group with mixed results. The resulting document can be validated with the envelope validator before transmission.

When to use this tool

  • You received an X12 document and must return a 997.
  • You received an EDIFACT interchange and must return a CONTRL.
  • You are testing an inbound EDI flow and need realistic acknowledgments.
  • You want the sender/receiver reversal and control-number echoing handled automatically.
  • You need a quick, private way to produce an acknowledgment without a full translator.

How to use the EDI 997 & CONTRL Ack Generator

  1. Paste the inbound X12 or EDIFACT document.
  2. Select 997 or CONTRL (auto-detected from the input).
  3. Choose the overall status (accepted, accepted with errors, or rejected).
  4. Optionally adjust individual transaction-set or message statuses.
  5. Click Generate. The acknowledgment appears with reversed envelopes and correct counts.
  6. Copy or download the result. Validate it if desired.
  7. Nothing is uploaded.

Worked examples

997 Accepting a Single 850

Input
ISA*00*          *00*          *ZZ*SENDER         *ZZ*RECEIVER       *250101*1200*U*00401*000000001*0*P*>~GS*PO*SENDER*RECEIVER*20250101*1200*1*X*004010~ST*850*0001~BEG*00*SA*PO12345**20250101~SE*3*0001~GE*1*1~IEA*1*000000001~
Output
ISA*00*          *00*          *ZZ*RECEIVER       *ZZ*SENDER         *250101*1200*U*00401*000000002*0*P*>~GS*FA*RECEIVER*SENDER*20250101*1200*2*X*004010~ST*997*0001~AK1*PO*1~AK2*850*0001~AK5*A~AK9*A*1*1*1~SE*6*0001~GE*1*2~IEA*1*000000002~

Sender and receiver are reversed. AK1 echoes the original GS functional ID and control number. AK9 counts are 1/1/1. New control numbers are assigned.

CONTRL Accepting an ORDERS

Input
UNB+UNOC:3+SENDER+RECEIVER+240101:1200+REF1'UNH+1+ORDERS:D:96A:UN'BGM+220+PO12345+9'UNT+3+1'UNZ+1+REF1'
Output
UNB+UNOC:3+RECEIVER+SENDER+240101:1200+REF2'UNH+1+CONTRL:D:96A:UN'UCI+REF1+SENDER+RECEIVER+7'UNT+3+1'UNZ+1+REF2'

Parties reversed. UCI references the original interchange control REF1 and uses action code 7 (acknowledged). Exact CONTRL segment content may vary by directory version; the generator produces a minimal valid form.

Common mistakes and tips

  • Always reverse sender and receiver; sending an acknowledgment with the original parties is a common error.
  • Echo the exact original control numbers; partners match on those values.
  • AK9 counts must be arithmetically consistent with the AK5 results.
  • Generate a new interchange control number for the acknowledgment itself.
  • Validate the generated acknowledgment with the envelope validator before sending it.

Frequently asked questions

Does the generator support both 997 and CONTRL?

Yes. It detects X12 versus EDIFACT and produces the corresponding acknowledgment.

Can I acknowledge only some transaction sets?

Yes. You can set individual statuses; the AK9 or equivalent summary reflects the mix.

Are detailed error segments (AK3/AK4 or UCS/UCD) generated?

Basic status is generated automatically. Detailed segment- and element-level error pointers can be added when you supply the error locations.

Does it handle multiple groups?

Yes. Each functional group is acknowledged according to the status you assign.

Is the inbound document uploaded?

No. Generation runs entirely in the browser.