Edifact release character `?` on its own

717 Views Asked by At

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 ?

2

There are 2 best solutions below

5
Don Zoeggerle On

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

0
AdamKent On

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 "".