997 AK4 ... *337*9: invalid time (or time zone code) in your 214
The status time isn't a valid 24-hour time, or the time zone code after it isn't one of the X12 codes. Both reject the 214.
What you see
AK3*AT7*6**8~
AK4*6*337*9*2400~
AK5*R*5~
or, for the time zone code:
AK3*AT7*6**8~
AK4*7*623*5*CST~
AK5*R*5~
What it means
- AT7-06 is element 337 (Time): 24-hour HHMM (or HHMMSS), with hours 00 to 23 and minutes 00 to 59. Code 9 = Invalid Time.
2400,1475, and2:30PMare all invalid. - AT7-07 is element 623 (Time Code): exactly 2 characters, such as
CT(Central Time),CS(Central Standard),CD(Central Daylight),ET,MT,PT,LT(Local Time), orUT(UTC).CSTis 3 characters, so it's code 5 (Data element too long). A 2-character value that isn't on the list is code 7 (Invalid code value).
Why it happens
- The TMS stores midnight as 24:00, or the map outputs 12-hour time.
- The map copies the time zone abbreviation shown on screen (CST, EDT) instead of the X12 code.
- A colon is left in the time (
14:30), usually reported as code 6 (Invalid character) or 9. - AT7-07 is sent with no AT7-06. X12 syntax note C0706 requires the time whenever the time code is present.
The exact fix
- Format AT7-06 as 24-hour
HHmm. Midnight is0000on the next day, so roll AT7-05 forward too. - Map time zones to 2-character X12 codes: CST to
CS, CDT toCD, or simplyCTorLTif your partner accepts them. Some partners require one specific code, so check their guide. - If there's no time, leave AT7-06 and AT7-07 both empty, if your partner allows that.
Before and after
Rejected
AT7*X1*NS***20261021*2400*CT~ AT7*AF*NS***20261021*1430*CST~
Accepted
AT7*X1*NS***20261022*0000*CT~ AT7*AF*NS***20261021*1430*CS~
Each AT7 shown is in its own LX/AT7 loop in a real 214. AF = Carrier Departed Pick-up Location with Shipment.
Stop it happening again
- Use a lookup table for time zone codes instead of free text.
- Test status events at midnight and in the 12 PM to 1 PM hour.
- If AT7-07 is omitted, X12 treats AT7-06 as local time at the status location. Confirm that's what your partner expects.
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
- AT7 Shipment Status Details, 004010 (AT7-06 element 337, AT7-07 element 623, notes C0605 and C0706)
- Element 623, Time Code (full code list)
- Element 723, Data Element Syntax Error Code (5, 6, 7, 9)
- X12, Transaction Sets