Combining multiple transactions in a single EDI file into one output file

1,150 views
Skip to first unread message

Terry Greenlaw

unread,
Apr 27, 2012, 9:35:58 AM4/27/12
to bots...@googlegroups.com
What is the best way to combine all EDI transactions coming from a single input file into a single output file for a given trading partner?

I can accomplish what I want by setting nextmessage to ({'BOTSID':'ISA'},{'BOTSID':'GS'}) in x12.py, but that affects all x12 documents.

Making it partner-specific would be wrong, too, because I have other EDI files from that trading partner that shouldn't be combined.

I also don't want it to merge multiple input files into a single output file. I need the one-to-one mapping between input and output files.

Is there a way to set nextmessage for a given route, or is there an even better way to accomplish this?

Thanks in advance for any help!


henk-jan ebbers

unread,
Apr 27, 2012, 1:24:07 PM4/27/12
to bots...@googlegroups.com
normally in x12 message are merged: the same type of message get merged in one envelope.
(not different messagetypes).
this is fairly standard, and AFAIK always preferred.
one cna turn this off in bots, so every message end up in one envelope.
this can even be turned on/off per partner of messagetype.
but not per messagetype/partner.

there is an option in an outgoing channel to append all ouytput to one file (used fixed filename without wildcards), but I do not now if this could be workeble for you

henk-jan

Terry Greenlaw

unread,
Apr 27, 2012, 11:46:41 PM4/27/12
to bots...@googlegroups.com
Sorry, I should have given a better example.

I'm getting 2 or 3 files EDI files nightly from a specific trading partner. Each file usually has a couple dozen 835 transactions in them. For each of these files, I want to write a single corresponding JSON file with a header block and one detail block per 835.

I was able to do it by setting nextmessage in the x12 syntax to  ({'BOTSID':'ISA'},{'BOTSID':'GS'})  in x12/py, but that is a horrible way to do it since I've got lots of other EDI files coming in that require the normal value for nextmessage. With this approach, I loop over the ST records in the mapping vs. getting ST at the root for multiple calls to the mapping script.

I guess that I would like to be able to set nextmessage on a per route (translation, ???) basis unless there is a better way to do this that I haven't found yet.

BikeMike

unread,
Apr 28, 2012, 2:10:46 AM4/28/12
to Bots Open Source EDI Translator
Hi Terry,
Do you need the 2 or 3 input files to be mapped to 2 or 3
corresponding output files? What if they were all mapped into one
output file? eg. 3 input files containing 20 transactions each to one
output file containing 60 transactions. This should be possible with
'merge':True in the json output grammar. Another possibility might be
using envelopescripts, but I have not tried that.

Kind Regards,
Mike

Terry Greenlaw

unread,
Apr 28, 2012, 7:11:55 AM4/28/12
to bots...@googlegroups.com
Hi Mike,
I do need each of the input files mapped to a separate output file.

I considered changing the upstream code to feed the files to bots one at a time and using merge:True, but I need control of the output file name and Henk-jan pointed out that enabling merge affected grabbing botskey in a communication script.

I'm also considering post-processing the json files and regrouping them since i have to correct the json that bots emits anyway to remove the extraneous lists it adds to every non-root, non-recurring node.

I'd prefer to do it all in bots, though, as it would make it much cleaner and easier for my team to maintain.

Thanks for the help !
-terry

Eppye Bots

unread,
Apr 28, 2012, 5:38:08 PM4/28/12
to bots...@googlegroups.com
why would you want such a thing?
(why is the information that transaction where enveloped togheter needed? )



henk-jan

Claudiu A. Secara

unread,
Apr 28, 2012, 7:04:18 PM4/28/12
to bots...@googlegroups.com

Hello Henk-Jan,

 

As you might remember, we are happy with the outgoing 850 & 810. They work like a clock.

 

Now, we are trying to map an incoming 857 and everything is going well, except that there is no output. No errors / no output.

 

Could you kindly point us to what is “Merged >> Stuck” ? I couldn’t find any reference to it.

 

As always, appreciate your help.

Claudio

 

 

in

FileRecieve

Done

857-in-file_test

C:\Data\EDI\Bots\Test\EBS.M01041611_1

1

2012-04-28 18:54:23

us-ascii

text/plain

RawInfile

Done

857-in-file_test

9159

1

2012-04-28 18:54:23

us-ascii

text/plain

Infile

Done

857-in-file_test

x12

x12

9159

1

2012-04-28 18:54:23

us-ascii

text/plain

Translate

Done

857-in-file_test

x12

x12

9159

1

2012-04-28 18:54:23

us-ascii

text/plain

Parsed

Done

857-in-file_test

x12

x12

9159

1

2012-04-28 18:54:23

us-ascii

text/plain

Splitup

Done

857-in-file_test

x12

857003060

BNB

ALGORA

1370

P

9159

1

2012-04-28 18:54:23

us-ascii

application/X12

Translated

Done

857-in-file_test

fixed

857_Output_File

BNB

ALGORA

None

P

9166

1

2012-04-28 18:54:23

us-ascii

text/plain

857_to_fixed

Merged

Stuck

857-in-file_test

fixed

857_Output_File

BNB

ALGORA

None

P

9168

1

2012-04-28 18:54:23

us-ascii

text/plain

 

Claudiu

unread,
Apr 29, 2012, 12:52:52 PM4/29/12
to Bots Open Source EDI Translator
I found the answer in a 2009 response to Mateusz. It worked. Thank you

On Apr 28, 7:04 pm, "Claudiu A. Secara" <clau...@algora.com> wrote:
> Hello Henk-Jan,
>
> As you might remember, we are happy with the outgoing 850 & 810. They work
> like a clock.
>
> Now, we are trying to map an incoming 857 and everything is going well,
> except that there is no output. No errors / no output.
>
> Could you kindly point us to what is "Merged >> Stuck" ? I couldn't find any
> reference to it.
>
> As always, appreciate your help.
>
> Claudio
>
> in
>
> FileRecieve
>
> Done
>
> 857-in-file_test
>
> <http://localhost:8080/filer/?action=this&idta=9158>
> C:\Data\EDI\Bots\Test\EBS.M01041611_1
>
> 1
>
> 2012-04-28 18:54:23
>
>                         us-ascii
>
> text/plain
>
> RawInfile
>
> Done
>
> 857-in-file_test
>
> <http://localhost:8080/filer/?action=this&idta=9159> 9159
>
> 1
>
> 2012-04-28 18:54:23
>
>                         us-ascii
>
> text/plain
>
> Infile
>
> Done
>
> 857-in-file_test
>
> x12
>
> x12
>
> <http://localhost:8080/filer/?action=this&idta=9161> 9159
>
> 1
>
> 2012-04-28 18:54:23
>
>                         us-ascii
>
> text/plain
>
> Translate
>
> Done
>
> 857-in-file_test
>
> x12
>
> x12
>
> <http://localhost:8080/filer/?action=this&idta=9162> 9159
>
> 1
>
> 2012-04-28 18:54:23
>
>                         us-ascii
>
> text/plain
>
> Parsed
>
> Done
>
> 857-in-file_test
>
> x12
>
> x12
>
> <http://localhost:8080/filer/?action=this&idta=9164> 9159
>
> 1
>
> 2012-04-28 18:54:23
>
>                         us-ascii
>
> text/plain
>
> Splitup
>
> Done
>
> 857-in-file_test
>
> x12
>
> 857003060
>
> BNB
>
> ALGORA
>
> 1370
>
> P
>
>  <http://localhost:8080/filer/?action=this&idta=9165> 9159
>
> 1
>
> 2012-04-28 18:54:23
>
>                         us-ascii
>
> application/X12
>
> Translated
>
> Done
>
> 857-in-file_test
>
> fixed
>
> 857_Output_File
>
> BNB
>
> ALGORA
>
> None
>
> P
>
>  <http://localhost:8080/filer/?action=this&idta=9166> 9166
>
> 1
>
> 2012-04-28 18:54:23
>
>                         us-ascii
>
> text/plain
>
>         857_to_fixed
>
> Merged
>
> Stuck
>
> 857-in-file_test
>
> fixed
>
> 857_Output_File
>
> BNB
>
> ALGORA
>
> None
>
> P
>
>  <http://localhost:8080/filer/?action=this&idta=9168> 9168

Terry Greenlaw

unread,
Apr 30, 2012, 3:41:29 AM4/30/12
to bots...@googlegroups.com
One of our trading partners is sending 835s with a single remit per transaction, and I need to group them so the output matches the "normal" 835s we receive. If it's not something easily achievable in bots, I can fix it in the post-processing phase when I'm cleaning up the json.

Eppye Bots

unread,
Apr 30, 2012, 4:45:51 AM4/30/12
to bots...@googlegroups.com
hi terry,

this is not std in bots.
i am thinking of solutions, but this week I am on holidays. I do read email etc, but do not do any 'real work'  ;-))

several option to consider:
- feed interchanges one by one to the translator; multiple run needed. This might be easy to do with eg shell script in linux.
- have interchange ID in output files so you can sort according to interchangeID
- use exits in enveloping.

kind regards,
henk-jan

Terry Greenlaw

unread,
Apr 30, 2012, 6:15:24 AM4/30/12
to bots...@googlegroups.com
Henk-jan,
Go enjoy your vacation and don't think about any of this work stuff. It will all be here when you get back :-)

I'll take a look at envelope user exits. That sounds promising :-)

Thanks!

-terry
Reply all
Reply to author
Forward
0 new messages