0

Given an EDIFACT message snippet, using standard delimiters, with that content :

AAA?BBB

How should it be rendered ?

AAABBB

or

AAA?BBB

To me, the UN specification is unclear on this point :

  УФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФХФФФФФФФФФФФФФФФХФФФФФФФФФФФФД
  Г       Release character         Г               Г            Г
  Г (To release any of the charac-  Г       ?       Г            Г
  Г ters + ; ' ?  appearing in user Г(question mark)Г  NOT USED  Г
  Г data in Level A syntax.         Г               Г            Г
  Г It MUST immediately precede     Г               Г            Г
  Г the character in question       Г               Г            Г
  Г and signifies that the NEXT     Г               Г            Г
  Г single character is not to      Г               Г            Г
  Г be interpreted as a syntax      Г               Г            Г
  Г separator, terminator, or       Г               Г            Г
  Г release character.)             Г               Г            Г
  РФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФФСФФФФФФФФФФФФФФФСФФФФФФФФФФФФй

It states that it is used to release certain character, but what to do when the following character is not a special one ?

Jocelyn delalande
  • 5,123
  • 3
  • 30
  • 34

2 Answers2

1

It would normally be rendered as AAA?BBB. The question mark is allowed in UNOB syntax set but not in UNOA. Unless it escapes a delimiter, it is considered part of the contents.

In the unusual case where the B is a delimiter, let's say a component delimiter, then it will be rendered as AAAB, assuming that by rendering you mean the contents after applying the delimiters

  • Do you have any source stating that, or is it what you saw in practice (other parsers ?) ? – Jocelyn delalande May 01 '20 at 09:18
  • Well, the UN specification is very clear about this and it is my source. Also from practice and the thousands of files, I've helped interpret. For example, A???B, will be interpreted as A?B, etc. – Don Zoeggerle May 02 '20 at 12:15
  • I'd normally use [EDI Webpad](https://www.edination.com/edi-webpad.html) for quick tests as it follows the specification to the letter – Don Zoeggerle May 02 '20 at 16:35
  • Thanks, I subscribed to EDI webpad to give it a shot. (It is bugging right now) But I am a bit skeptic about the fact the spec that I pasted is explicit and equally skeptic for the `???` -> `?` : from what spec does this behavior comes ? Getting the impression that the spec is kinda loosy and/or used very liberaly :-/. – Jocelyn delalande May 06 '20 at 13:35
  • I just tested with EDI webpad. Here is what it gives :  `AAA?BBB` -> `AAABBB` (escaping the B) `AAA??BBB` -> `AAA?BBB` (escaping the ?) `AAA???BBB` -> `AAA?BBB` (escaping the ? and the B) ; so I will stick to this parsing for my own parser. – Jocelyn delalande May 06 '20 at 16:50
1

Using the UNOA character set (level A syntax), AAA?BBB is not valid EDIFACT.

If I were writing a parser from scratch, I'd flag it as a syntax error and allow for one or more of the following:

  • allow message processing to continue with a warning and render it as received (ie. AAA?BBB) - essentially assuming that the sender intended to send AAA??BBB
  • reject the message and send a negative CONTRL and/or APERAK message back to the sender indicating the location and type of error encountered.

But I'm not writing a parser from scratch - and I'm not sure how most commonly used parsers (eg Smooks for Java, Bots for Python, whatever is inside Biztalk and Azure Logic Apps) would handle this input. My guess is that some would not throw an error and would render the output as either "AAABB", "AAABBB", "AAA?BBB" or even "".

AdamKent
  • 366
  • 2
  • 8