buildop String concatenation
Posted: Fri Jul 27, 2007 7:46 am
Hi,
We have a buildop to do the following: It gets the unique 2-byte values from the string field with the same key.
Example
Input:
rec# key string (20 byte value)
1 KEY1 aa
2 KEY1 abaa
.
.
10000 KEY1 xxaaab
10001 KEY2 yy
Expected Output:
KEY1 aaabxx
KEY2 yy
Current logic in the buildop:
KEY1 xx
KEY2 yy
Can someone pls. tell us how to get the expected output?
Thanks
-- fbr
We have a buildop to do the following: It gets the unique 2-byte values from the string field with the same key.
Example
Input:
rec# key string (20 byte value)
1 KEY1 aa
2 KEY1 abaa
.
.
10000 KEY1 xxaaab
10001 KEY2 yy
Expected Output:
KEY1 aaabxx
KEY2 yy
Current logic in the buildop:
Output that we are getting from the above buildop:Code: Select all
if (KEY_IN != holdkey.c_str()) { if (firstrec == false) { KEY_OUT = holdkey.c_str(); FBL_AC_NR_OUT = holdacnr.c_str(); for (mymapit = mymap.begin(); mymapit != mymap.end(); ++mymapit) { MSG_CD_OUT = mymapit->first.c_str(); } transferAndWriteRecord(0); mymap.clear(); } else firstrec = false; holdkey = KEY_IN.data(); holdacnr = FBL_AC_NR_IN.data(); } for (int x=0; x < 20; x+=2) { holdmsg = MSG_CD_IN.substring(x,2); if (holdmsg != " ") mymap[holdmsg] ++; }
KEY1 xx
KEY2 yy
Can someone pls. tell us how to get the expected output?
Thanks
-- fbr