No Valid UNZ Trailer for UNB Header

84 views
Skip to first unread message

Tom Westrick

unread,
Jul 10, 2015, 4:04:40 PM7/10/15
to bots...@googlegroups.com
I am getting the following error from preprocess.py line 228 when trying to process a EDIFACT DELFOR 97A document:

[M58]: Found no valid UNZ trailer for the UNB header at position 0.

The record separator is a non-ASCII char \xe2. If I replace it in the file with a single quote, the file processes without error. Here is a snippet of the beginning and ending of the file.










I tried setting the record_sep in the syntax section of the DELFORD97AUN grammar but no luck. I also tried editing the preprocess.py file hardcoding the record_sep on line 208.

Any suggestions?

-Tom

henk-jan ebbers

unread,
Jul 11, 2015, 4:50:02 AM7/11/15
to bots...@googlegroups.com
hi Tom,

I can not see the content of the file.

Bet is to attach the fiel.



kind regards.

On 07/10/2015 10:04 PM, Tom Westrick wrote:
> I am getting the following error from preprocess.py line 228 when trying to process a EDIFACT DELFOR 97A document:
>
> [M58]: Found no valid UNZ trailer for the UNB header at position 0.
>
> The record separator is a non-ASCII char \xe2. If I replace it in the file with a single quote, the file processes without error. Here is a snippet of the beginning and ending of the file.
>
> <https://lh3.googleusercontent.com/-gjzhlFdVdhs/VaAhygYNlyI/AAAAAAAACHk/83E629rw1e0/s1600/Capture.PNG>
>
>
>
>
>
>
>
>
> <https://lh3.googleusercontent.com/-fPT5nUIE4sI/VaAlJdtA4KI/AAAAAAAACH0/5B9hxEZiCqc/s1600/Capture.PNG>
>
>
> I tried setting the record_sep in the syntax section of the DELFORD97AUN grammar but no luck. I also tried editing the preprocess.py file hardcoding the record_sep on line 208.
>
> Any suggestions?
>
> -Tom
> --
> You received this message because you are subscribed to the Google Groups "Bots Open Source EDI Translator" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to botsmail+u...@googlegroups.com <mailto:botsmail+u...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

BikeMike

unread,
Jul 11, 2015, 6:46:14 AM7/11/15
to bots...@googlegroups.com


On Saturday, 11 July 2015 05:34:40 UTC+9:30, Tom Westrick wrote:
The record separator is a non-ASCII char \xe2.

Hi Tom,
In theory you can use non-standard separator/terminator characters in edifact (I have never seen this in practice), but if you do they MUST be specified in a UNA segment as the first record. Since no UNA is provided, this file is non-compliant with edifact standards. You should contact your trading partner about this!

If they are unwilling to change this, you could fix it with a preprocessing script. Either add a UNA record specifying the terminator character they are using, or replace them all with the default ascii single quote character.

Kind Regards,
Mike

henk-jan ebbers

unread,
Jul 12, 2015, 4:28:32 PM7/12/15
to bots...@googlegroups.com
oooops, see that you send pcitures....my email reader does not display those by default...

my advice here is to check out what is going on.
some word processors use \xe2 when you type in apostrophe.
so is this production? looks like a 'manual' file to me.
the edifact rules are quite clear.
if they want other separators, use UNA (like Mike suggests).
but actually there is no reason to use other than default/standards separators.

Contact the edi-partner!

kind regards,
henk-jan

On 07/10/2015 10:04 PM, Tom Westrick wrote:
> I am getting the following error from preprocess.py line 228 when trying to process a EDIFACT DELFOR 97A document:
>
> [M58]: Found no valid UNZ trailer for the UNB header at position 0.
>
> The record separator is a non-ASCII char \xe2. If I replace it in the file with a single quote, the file processes without error. Here is a snippet of the beginning and ending of the file.
>
> <https://lh3.googleusercontent.com/-gjzhlFdVdhs/VaAhygYNlyI/AAAAAAAACHk/83E629rw1e0/s1600/Capture.PNG>
>
>
>
>
>
>
>
>
> <https://lh3.googleusercontent.com/-fPT5nUIE4sI/VaAlJdtA4KI/AAAAAAAACH0/5B9hxEZiCqc/s1600/Capture.PNG>
>
>
> I tried setting the record_sep in the syntax section of the DELFORD97AUN grammar but no luck. I also tried editing the preprocess.py file hardcoding the record_sep on line 208.
>
> Any suggestions?
>
> -Tom

Tom Westrick

unread,
Jul 12, 2015, 4:40:33 PM7/12/15
to bots...@googlegroups.com
It's a production file copied from our VAN in order to test in Bots as I work to switch translators. I swapped out the EDI addresses to keep them private. Either the VAN is doing something weird when displaying or the customer sends it like that.

I'll use a pre script for now as I know the customer isn't going to change.

Thanks for the help!

-Tom

henk-jan ebbers

unread,
Jul 12, 2015, 4:43:40 PM7/12/15
to bots...@googlegroups.com
really, inform you edi partner.
they probably make a mistake.
it is good to inform people about mistakes.
they will not shoot you.
(I am pretty sure about it)

henk-jan

BikeMike

unread,
Jul 12, 2015, 11:46:03 PM7/12/15
to bots...@googlegroups.com


On Monday, 13 July 2015 06:10:33 UTC+9:30, Tom Westrick wrote:
Either the VAN is doing something weird when displaying

Could be this.. maybe to make it look "prettier" in a browser depending on the font used? Could also be deliberate to try and keep EDI as a "black art" and discourage you trying to bypass them! But if it really comes from the partner like that then you should let them know it's wrong.

Tom Westrick

unread,
Jul 13, 2015, 9:00:08 AM7/13/15
to bots...@googlegroups.com
LOL...they probably won't shoot me :) I'll have to wait and see how the file comes through FTP before figuring out if it is the VAN or our partner.

-Tom
Reply all
Reply to author
Forward
0 new messages