|
[EDI-L Mailing List Archive Home]
[Message List]
[Reply To This Message]
Re: ANSI ASC X12: BIN and BDS segments

Michael,
There's been a bit of traffic on this, but I don't think any of the
messages have quite answered your essential questions. You ask:
>But how can this be, given that a communications protocol may be a 7-bit
>protocol? If you use a 7-bit protocol, either you'd lose
>bit 7 of each octet or it would be misinterpreted as a control character.
>Or, does the use of BDS/BIN presuppose the use of an 8-bit
>protocol? Or preempt the use of high-order characters?
>
>Or does the standard just assume that "you have the data, communications
>is a totally separate consideration?" (Which really seems
>strange given the origin and original design of ANSI ASC X12 data format).
Actually, the answer is sort of the last case, but with
qualification. Support is provided for "filtering" the data, which means
taking the binary stream and encoding it in a text format, such as
hexadecimal or base 64, that the communications protocol being used is able
to handle. This is the reason for the "Filter ID Code" in BDS01 and EFI16
(used with BIN). It is assumed that the partners to an exchange would
recognize the limitations of the protocol they agree on, and select an
appropriate filter.
Mike
At 08:22 AM 3/23/2005 -0600, Michael Mattias wrote:
>3/23/05
>
>The "binary" data in BIN segments (BIN03) is defined in X12.6 (004010) thus:
>===============================
>3.5.1.7 Binary
>The binary data element is any sequence of octets ranging in value from
>binary 00000000 to binary
>11111111. This data element type has no defined maximum length. Actual
>length is specified by the
>immediately preceding data element. The binary data element type may only
>exist in the Binary segment
>(see Section 3.11). The representation for this data element type is B.
><binary> ::= <octet> {<octet>}
><octet> ::= "000000002" | ... | "111111112"
>
>......
>3.11 Binary Segment
>The binary segment has the same structure as a data segment but is used
>for transferring binary data
>with an accompanying length parameter. Bit patterns normally reserved for
>other functions may appear
>in the binary data element. These bit patterns could be misinterpreted.
>The length of the binary data
>element is provided in the preceding data element in order to locate the
>end of the binary data and
>prevent such misinterpretation. The binary segment may not occur outside
>the boundaries of a
>transaction set.
><binary_seg> ::= BIN <gs> <number_of_octets> <gs> <binary> <tr>
><number_of_octets> ::= <unsigned_integer>
>The data element that references the number of octets provides a count of
>all octets contained in the
>binary data element. This count does not include the preceding data
>element separator or trailing data
>segment terminator. The count is provided to enable finding the data
>segment terminator.
>===========
>
>Ok, so this means the BIN03 may contain an octet which - if I read this
>correctly - may be a high-order (extended) ASCII character
>(x'80'- x'FF').
>
>But how can this be, given that a communications protocol may be a 7-bit
>protocol? If you use a 7-bit protocol, either you'd lose
>bit 7 of each octet or it would be misinterpreted as a control character.
>Or, does the use of BDS/BIN presuppose the use of an 8-bit
>protocol? Or preempt the use of high-order characters?
>
>Or does the standard just assume that "you have the data, communications
>is a totally separate consideration?" (Which really seems
>strange given the origin and original design of ANSI ASC X12 data format).
>
>I ask because although I've been working with ANSI ASC X12 data since
>about 1984, I have never seen a BIN (or BDS ) segment used
>"for real."
>
>Inquiring Minds Want to Know.
>
>Thanks,
>Michael Mattias
>Tal Systems, Inc.
>Racine WI
>
>
>
>
>
>.
>Please use the following Message Identifiers as your subject prefix:
><SALES>, <JOBS>, <LIST>, <TECH>, <MISC>, <EVENT>, <OFF-TOPIC>
>Access the list online at: http://groups.yahoo.com/group/EDI-L
>
>Yahoo! Groups Links
>
>
>
>
---------------------------------------------------------------
Michael C. Rawlins, Rawlins EC Consulting
www.rawlinsecconsulting.com
Using XML with Legacy Business Applications (Addison-Wesley, 2003)
www.awprofessional.com/titles/0321154940
|
 |
Subscribe in XML format
| RSS 2.0 |
|
| Atom 0.3 |
|
|