Using x12 version 4010 and 4030 together

1,095 views
Skip to first unread message

David Friday

unread,
Oct 25, 2013, 4:42:49 PM10/25/13
to bots...@googlegroups.com
Hi,
 
I have been translating 850 x12 version 4010 for a while now but I have to start translating 850 x12 4030 and it gives me errors such as "expected not-repeating element". I'm using the X12.4030 grammars which are selected in the translation of BOTS and the ISA12 shows 00403 and GS08 shows 004030 in the 850 x12 file.
 
When I changed the 850 file ISA12 to 00401 the translation worked perfectly.
 
Any help is appreciated.
 
Thanks,
 
David
 

Eppye Bots

unread,
Oct 28, 2013, 6:03:07 AM10/28/13
to bots...@googlegroups.com

What is the exact error?
What line in mapping script?

Kind regards, henkjan

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

David Friday

unread,
Oct 28, 2013, 9:36:16 AM10/28/13
to bots...@googlegroups.com
Hi henkjan,
 
The error is as follows:
 
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\bots\transform.py", line 67, in translate
    command=command)
  File "C:\Python27\lib\site-packages\bots\inmessage.py", line 38, in parse_edi_file
    ediobject.initfromfile()
  File "C:\Python27\lib\site-packages\bots\inmessage.py", line 70, in initfromfile
    self.checkmessage(self.root,self.defmessage)
  File "C:\Python27\lib\site-packages\bots\message.py", line 77, in checkmessage
    raise botslib.MessageError(_(u'%(errorlist)s'),{'errorlist':''.join(self.errorlist)})
MessageError: Message nr 1, type 850004030, [F40] line 5 pos 6: Record "ST-REF" expect not-repeating elemen, but "3" is repeating.
Message nr 1, type 850004030, [F40] line 12 pos 20: Record "ST-N1-N3" expect not-repeating elemen, but "NTS PAYABLE" is repeating.
Message nr 1, type 850004030, [F40] line 12 pos 56: Record "ST-N1-N3" expect not-repeating elemen, but "ITE 300" is repeating.
Message nr 1, type 850004030, [F40] line 13 pos 25: Record "ST-N1-N4" expect not-repeating elemen, but "S" is repeating.
Message nr 1, type 850004030, [F40] line 16 pos 24: Record "ST-N1-N4" expect not-repeating elemen, but "S" is repeating.
Message nr 1, type 850004030, [F40] line 17 pos 40: Record "ST-PO1" expect not-repeating elemen, but "P" is repeating.
Message nr 1, type 850004030, [F02] line 5 pos 1: Record "ST-REF" field "REF01" is mandatory.
[F02] line 1 pos 1: Record "ISA" field "ISA11" is mandatory.
 
I have attached the plugin in case needed.
 
Thanks for your help,
 
David

 
plugin_20131028.zip

Eppye Bots

unread,
Oct 28, 2013, 1:09:05 PM10/28/13
to bots...@googlegroups.com

There are errors in the incoming message. In x12 syntax version 403 amd above a repeating character is used. About ISA11: make this conditional in grammars/x12/envelope.py. if you change ISA version file should translate OK.
Kind regards
Henkjan

--

David Friday

unread,
Oct 28, 2013, 1:37:07 PM10/28/13
to bots...@googlegroups.com
Thank you for your response Henkjan,
 
I have changed the enveloperecords.py file for ISA11 to C for conditional, but I do not know how to change the ISA version file and also why would there be a repeating character error on version 403 and not on version 401?
 
Thanks again for your help,
 
David

Eppye Bots

unread,
Oct 28, 2013, 1:40:31 PM10/28/13
to bots...@googlegroups.com

The why: those are the x12 syntax rules, a given thing. Yes, they addedthis >0401
Kind regards
Henkjan

--

David Friday

unread,
Oct 28, 2013, 1:44:47 PM10/28/13
to bots...@googlegroups.com
How do I change the ISA version file?
Thanks,
David

Brandon Maciag

unread,
Oct 28, 2013, 2:31:34 PM10/28/13
to bots...@googlegroups.com
Oddly enough, I'm running into the exact same issue today.

I'm attempting to translate an X12 004030UCS 875 purchase order to our flat file standards. We have customers across all sorts of X12 versions, but only the ones utilizing X12 004030 or 004030UCS are an issue. The issue is definitely with the ISA that they are sending me. They are utilizing a 'U' in the ISA11 record, which is obviously wrong. I am utilizing the following in my bots/usersys/grammars/x12/875004030.py script:

syntax = { 
        'version'    :  '00401',    #version of ISA to send
        'functionalgroup'    :  'OG',
        }

Unfortunately, the issue persists. Any thoughts?

David Friday

unread,
Oct 28, 2013, 2:44:29 PM10/28/13
to bots...@googlegroups.com
Hi Brandon,
 
I have just looked up what is suppossed to be in ISA11 for version 4030 and it is the pipe symbol | and when I replaced the U with this symbol it translated without problems.
 
Thanks for  your input I just need to make sure that the client can follow the x12 4030 standards so that there are no errors.
 
David

Brandon Maciag

unread,
Oct 28, 2013, 2:47:23 PM10/28/13
to bots...@googlegroups.com
Well, any character can be in the ISA11. Walmart, for example, utilizes a colon (:) with us. My issue is that we deal with several clients that do this, and unfortunately they are on legacy systems that won't allow them to fix this. It is beyond me why they migrated to the 00403 standard without the ability to fix this, but that is what you deal with in EDI land...

Eppye Bots

unread,
Oct 28, 2013, 2:57:29 PM10/28/13
to bots...@googlegroups.com

Hi Brandon, David,
I can image edi-partners do this wrong. It might be good to allow for this.
This week i am on holidays, so i will no look at it ;-))
Ideas are welcome.
Kind regards henkjan

--

Brandon Maciag

unread,
Oct 28, 2013, 4:28:17 PM10/28/13
to bots...@googlegroups.com
In my case, I may see if I can edit the engine to treat the ISA like a <0403 if an an a-z0-9 is in the ISA11. I'm new to the bots engine workflow, so I'm not sure what that will entail yet.

David Friday

unread,
Oct 28, 2013, 5:16:25 PM10/28/13
to bots...@googlegroups.com
Please let me know if that works, I will try and see if I can make the ISA11 overlooked on the translation to csv but I'm not very advanced at bots or python.

David Friday

unread,
Nov 4, 2013, 10:40:12 AM11/4/13
to bots...@googlegroups.com
Hi Brandon,
 
Where you able to get around the ISA11 0403 problem?
 
I have been unsuccessful translating these 004030 documents with bots and have found that I will also be having other characters in the ISA11 that are not standard with new trading partners.
 
Any feedback is appreciated.
 
Thanks,
 
David

Brandon Maciag

unread,
Nov 4, 2013, 1:41:06 PM11/4/13
to bots...@googlegroups.com
David,

Unfortunately I haven't. We are just switching over to bots, so we have a lot of work to do as far as getting mappings up for all of our different customers. I figured that I would let eppye take a stab at it before I do, since it will be at least another month before we are in production mode with bots.

henk-jan ebbers

unread,
Nov 4, 2013, 4:45:26 PM11/4/13
to bots...@googlegroups.com
hi David,

using Brandon's suggestion:

in inmessage.py , around line 1127
this is now:
        if version < '00403':  #not used before this version
            self.ta_info['reserve'] = ''   
should be something like:
        if version < '00403' or self.ta_info['reserve'].isalnum():  #not used before this version
            self.ta_info['reserve'] = ''   

(did not test this, but this should work.)

kind regards,
henk-jan

David Friday

unread,
Nov 5, 2013, 10:06:11 AM11/5/13
to bots...@googlegroups.com

Hi henk-jan,
 
I tried using the change you suggested above but it does not work for the 4030 x12 that has a | in ISA11.

henk-jan ebbers

unread,
Nov 5, 2013, 10:35:11 AM11/5/13
to bots...@googlegroups.com
is ISA11 is '|' this is supposed to be the 'repeat' character.
in older ISA-version this was eg 'U' or something.
I accomodated for partners that use new ISA-version but still use old ISA-11 value.
That is easy to do, without risk, does not break anything etc.

If they use '|': how should I accomodate for this? (how should this be handled?)

My advice: contact your edi-partner about this.

kind regards,
henk-jan

David Friday

unread,
Nov 5, 2013, 10:54:55 AM11/5/13
to bots...@googlegroups.com
Thanks for the quick response henk-jan,
 
Am I correct in assuming that bots cannot handle the version 4030 standard | symbol for ISA11?
 
I'm not trying to offend you so please don't take it that way.
 
Thanks,
 
David

henk-jan ebbers

unread,
Nov 5, 2013, 11:00:12 AM11/5/13
to bots...@googlegroups.com
hi David,

it does work in version 3.1

the 'repeating separator' does not work correct version 3.0 - but should not lead to errors, this is very seldom used. No errors have everr been reported.



kind regards,
henk-jan

David Friday

unread,
Nov 5, 2013, 12:35:36 PM11/5/13
to bots...@googlegroups.com
Hi henk-jan,
 
I'm currently using version 3.1 and it is not working, if you get a chance could you please take a look at the plugin I have posted.
 
Thanks,
 
David
plugin_20131105.zip

henk-jan ebbers

unread,
Nov 6, 2013, 6:00:59 AM11/6/13
to bots...@googlegroups.com
hi David,

I checked this.
in enveloperecords.py I found this:
['ISA11','M',(1,1),'AN'], # Changed from M to C on October 28th 2013 on the advice on Henkjan, also from AN to ID

note that ISA11 is still 'M' here!
when I changed this to 'C' the translation an OK.
(got an ´ file stuck' error, because the 997 generated by confirmrules was not processed further - but that was not the issue.
It seems to work OK here.

kind regards,
henk-jan

David Friday

unread,
Nov 6, 2013, 9:27:52 AM11/6/13
to bots...@googlegroups.com
Thanks henk-jan,
 
Works great now.
 
I really appreciate all of your help, have a great day.
 
David

Brandon Maciag

unread,
Feb 24, 2014, 3:26:19 PM2/24/14
to bots...@googlegroups.com
Just FYI, checking for an alpha-numeric value in the ISA 11 did fix the issue for me. Eppye's line of code in inmessage.py, which is quoted below should work for those with this same issue.

Just to explain the logic for anyone that is confused:
  • In ISA versions 00403 and above, the ISA 11 is used to separate segments that repeat within a transaction set. Prior to 00403, it was used as a standards identifier (Most commonly used was "U" for "U.S. EDI Community of ASC X12, TDCC and UCS."
  • Some trading partners utilize an ISA version that is 00403 and above, but still use a common character like "U" in the ISA 11, which means anytime the character "U" is found in the data, the engine thinks a repeating segment should follow it. Since the letter "U" is a common letter, the engine thinks it has found a number of repeating segments which are not supposed to be repeating segments.
  • By using the code fix listed here, you are effectively telling the BOTS engine to ignore the repeating character if it is alphanumeric. The thought here is that no one would logically use an alphanumeric character as a repeating segment identifier, and so the most likely scenario is that the document contains an error that you are going to willfully ignore.
  • In an ideal world, you would go back to your trading partner and tell them to change their ISA 11 if they are going to use 00403+, but many legacy systems prevent that type of change.
Cheers
Reply all
Reply to author
Forward
0 new messages