Now opening: online payments go live shortly. Email [email protected] and we'll take your request first.
Over The Road SIOTRSI

997 AK9 code 4 or 5: the functional group trailer is wrong

The group envelope (GS ... GE) around your transaction sets has a trailer that doesn't match its header, or claims the wrong number of transaction sets. The partner can reject the entire batch, not just one 214.

What you see

AK1*QM*417~
AK9*R*1*1*0*4~

or, when the count is wrong:

AK1*QM*417~
AK9*R*1*2*0*5~

Reading AK9: AK901 = group status (A, E, P partially accepted, R), AK902 = number of sets the GE says are included, AK903 = number actually received, AK904 = number accepted, AK905+ = error codes. Exact counts can vary by translator.

What it means

Why it happens

The exact fix

  1. Set GE02 equal to GS06.
  2. Set GE01 to the number of ST segments between that GS and GE.
  3. Resend with a new ISA13 (and a new GS06 if your partner tracks duplicates at the group level).

Before and after

Rejected (2 sets, trailer says 1 and 418)
GS*QM*TRKX*BROKERX*20261021*1430*417*X*004010~
ST*214*0001~ ... SE*9*0001~
ST*214*0002~ ... SE*6*0002~
GE*1*418~
Accepted
GS*QM*TRKX*BROKERX*20261021*1430*417*X*004010~
ST*214*0001~ ... SE*9*0001~
ST*214*0002~ ... SE*6*0002~
GE*2*417~

"..." stands for the segments inside each transaction set, shortened for space.

Also check GS01 and GS08

GS01 must match the transaction sets inside the group: QM for 214, IM for 210, SM for 204, GF for 990, and FA for 997. GS08 must be the version your partner expects (for example 004010). A version they don't support comes back as AK9 code 2 (Functional Group Version Not Supported).

Not sure this is your error?

Paste your 997, TA1, rejected file, or the broker's error email into the free EDI Reject Checker. It decodes every AK3/AK4/AK5/AK9 and TA1 code and checks counts, control numbers, and dates in seconds. It runs in your browser, so nothing is uploaded.

Fix reports are paid up front; if we can't find the cause, the refund is automatic.

References