Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed to join a few text strings

Status
Not open for further replies.

max5000

Programmer
Jun 24, 2005
2
0
0
CA
Hi,

Mercator 6.7
850 version 4010 tree.

I'm having an issue joining text strings today.
Here is what I want to do. In the N3 segment, there is an address info element, that can have 1 or 2 occurences.

I am dealing with data that has 2 occurences.
I need to map both occurences into one string, separated by a space. I also need to make sure that I am extracting the correct address, ie the "ST" type.
This is what I have

=EXTRACT(AddressInfo Element[1]:N3 Segment:LoopN1_1:Transaction #850 Inbound Partner Set V4010:Source, EntityIDCd Element:N1 Segment:LoopN1_1:Transaction #850 Inbound Partner Set V4010:Source = "ST" ) + EXTRACT(AddressInfo Element[2]:N3 Segment:LoopN1_1:Transaction #850 Inbound Partner Set V4010:Source, EntityIDCd Element:N1 Segment:LoopN1_1:Transaction #850 Inbound Partner Set V4010:Source = "ST" )

This actualy works, gets both pieces of data, for the correct ST address. However, when I add a space between them, all I get is the space, and no data.

This is what I want, but does not work

=EXTRACT(AddressInfo Element[1]:N3 Segment:LoopN1_1:Transaction #850 Inbound Partner Set V4010:Source, EntityIDCd Element:N1 Segment:LoopN1_1:Transaction #850 Inbound Partner Set V4010:Source = "ST" ) + " " + EXTRACT(AddressInfo Element[2]:N3 Segment:LoopN1_1:Transaction #850 Inbound Partner Set V4010:Source, EntityIDCd Element:N1 Segment:LoopN1_1:Transaction #850 Inbound Partner Set V4010:Source = "ST" )

Putting is the extra space seems to blow the rest of the data away.

Is there a way to make this work, or is there a better way to accomplish the same thing.
Any help appreciated.

Thanks
Max
 
Try encapsulating the two extracts clauses with a TEXT(), and see if this solves your problem. It may be different data types that is your problem.

You also may wish to try using a "|" instead of a space, and then substituting it with a space ... if option one does not work.

;)
 
Are you using 6.7 or 6.7.1? If 6.7 it's probably a bug. You should upgrade to 6.7.1 or 7.5.1.
 
Problem solved,

Thanks for the replys guys!

janhes, it's version 6.7, and yes I think it probably is a bug. I think the code should have worked as is.

I did try encapsulating with TEXT(), and I also tried using "<sp>" instead of " ".

I spoke to Ascential Support and this was their solution.
By calling a functional map, and using the two EXTRACT statements as argumants. Then I joined the the two input parameters like this
=In1 + "<sp>" + In2
and this works as expected.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top