EDI Enveloping Part Three (The GS)

scratch head EDI Enveloping Part Three (The GS)What is the GS segment?

The GS segment is the second mandatory enveloping segment.  It shares some properties with the ISA segment.  There is a sender and receiver, version Identifier, time stamp and control number.  But one thing that the GS has that the ISA does not is a Functional Identifier.

That’s right, Functional.  This means that within the GS envelope are only EDI messages or documents that have the same function.

Here is a GS segment:

GS*PO*901234572000*908887732000*081031*0835*1*T*004010!

Like all segments, the first element is 0 and identifies the segment type.  This segment has a GS in this element, making it a GS segment.

Unlike the ISA segment, that does not change in any way from standard to standard, the GS may change a bit.

Here are the definitions of the GS segment for the 3020 X12 standard:

gs elementdef 3020 EDI Enveloping Part Three (The GS)

There are 8 elements.

And here is the definitions of the GS segment for the 4010 X12 standard:

gs elementdef 4010 EDI Enveloping Part Three (The GS)

Again there are 8 elements.

Now look at the size of the Date and Time elements in GS_04 and GS_05.  In the 3020 version, the Date is 6 char, and in 4010 it is 8 char.  The time also grows from a 6 to a possible 8 char size.

Version 4010 was considered the Y2K standard where the dates moved from a 6 char date, to and 8 char date to accommodate the century change.

Other than this change, the GS segments and usage are the same.

Element by Element

GS_01 is the Functional Identifier.  This designates the type of messages this envelope contains.  If it contains Purchase Orders, the GS_01 is “PO”  if it contains Invoices, it is “IN” as so forth.

GS_02 is the Sender Identifier.  This does not have to be the same as the ISA Sender, but it can be.  This element has the same restrictions on content, a 15 character alpha-numeric.  But unlike the ISA sender, this one is not fixed in size.  This means that the delimiters fit around the value without including any white space.  In many basic implementations, the value in the ISA sender, and the GS sender are the same value.

GS_03 is the Receiver Identifier.  This does not have to be the same as the ISA receiver, but it can be.  This element has the saem restrictions on content, a 15 character alpha-numeric.  But unlike the ISA sender, this one is not fixed in size.  This means that the delimiters fit around the values without including any white space.  In many basic implementations, the values in the ISA receiver and the GS receiver are the same value.

GS_04 is the Date.  It should be the date of the creation of the GS envelope.  Many times it is the same date as the ISA date.

GS_05 is the Time.  It should be the time of the creation of the GS envelope.  Many times it is the same as the ISA time.

GS_06 is the Control Number.  This is a 1 to 9 numeric value.  This is a number that needs to be unique inside the ISA envelope only.  Some implementations use an incrementing number that increments with the usage like the ISA control number.  Others just have a count of the number of GS envelopes inside an ISA.  Both are acceptable.  All that is required is that the GS control number be unique among other GS control numbers within the ISA envelope that it is contained in.

GS_07 is the Agency Code.  Basically for any X12 document that will be “T” or “X”.  I have only seen “X” indicating that it is really using X12.  Even when it is not.  Most of the time I ignore this value.

GS_08 is a Version identification value.  Just like the ISA_12, this identifies the standard, but identifies it to the next level.  Thus if you are 4010, this will be 004010 and so on.

Too Much?

No problem, there are really a few things to pay attention to as you begin to work with GS envelopes.  And if you are just needing to do a quick edit and resubmit you may not need to do much.

  • Pay attention to the GS_02 and GS_03, these are the sender and receiver and need to be conrect to route documents and match with the profile for most systems.
  • Make sure the GS_01 is the type of document that you are really sending.  Some systems get cranky when they get an Invoice in a Purchase Order envelope.
  • And as always, make sure your GS and GE control numbers match and are unique inside the ISA-IEA envelope.

For an overview of Enveloping go here.

Looking for the ISA enveloping page?

Looking for the ST enveloping page?

Looking for something else relating to EDI?  Check out the EDI Primer post

Subscribe to "The Integration Engineer" by Email

Related Articles:

Leave a Reply