[EDI-L Mailing List Archive Home] [Message List] [Reply To This Message]

Re: <tech> X12 input indexing issue in Mercator

From: "jm_edi" <jm_edi@...>
Date: Tue Dec 2, 2003  8:47 pm
Subject: Re: <tech> X12 input indexing issue in Mercator
Thanks Bob and Michael for the suggestions...

I'm doing a bit of what each of you suggests and the following is a
summary of the test map I'm using to finalize the map rule logic.

INPUT DATA - emulates X12 AMT loop
------------------------------------
AMT*KC*68775.58
AT*970X0X4930
REF*10*1
REF*AX*AA
AMT*ZR*34387.79
REF*AX*AA

TYPE TREE SUMMARY FOR MAP RULE
------------------------------------
1) AMTTest group consists of AMT Loop (1:s)
2) AMT Loop group consists of AMT Segment (1:1), AT Segment (0:1), and
REF Segment (s)
3) REF01 is AX in this example and REF02 is AA in this example for
both AMT Loop's

MAP LOGIC SUMMARY
------------------------------
1) Map logic should do its thing if two AMT Loop's that are next to
each other have REF02 the same value for both having REF01 = AX. In
this case, the input data should trigger the action
2) FM_CheckAMT is passed a single AMT Loop object and checks whether
if it has a REF01 = AX and if it does returns the REF02 value
3) Following logic is executed at a level that has visibility to all
the AMT Loop's in AMTTest.

The following logic is what I'm using to determine the above rule and
should mean "if any REF segment of current AMT Loop has REF01 = AX
call FM_CheckAMT on current AMT Loop and next AMT Loop and see if both
have equal REF02 values, and if equal call FM_CreateOutputRecords
to take desired action."

=IF(UPPERCASE(RefNumQualCD Element:REF Segment:AMT Loop:AMTTest) =
"AX", IF(FM_CheckAMT(AMT Loop:AMTTest) = FM_CheckAMT(CHOOSE(AMT
Loop:AMTTest, INDEX(AMT Loop:AMTTest) + 1)),
FM_CreateOutputRecords(AMT Loop:AMTTest)))


What's seems to be messing up is the 2nd IF function which causes the
map to output garbage. If I remove the 2nd IF or hard-code it to
evaluate to TRUE, things work as expected so I believe I don't have
the syntax right to pass "current data object" and "next data object"
to functional maps.

Ideas?




 
EDI to XML Mapping for EDIFACT/X12 Convert EDIFACT/X12 Schemas to XML Schema Legacy Data Conversion Tools Access Relational Data as XML Visual XSLT and XQuery Mapping Tools Simplify EDI Data Integration with Stylus Studio XML Enterprise Suite - Free Download!
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.