Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
3 replies Latest Post - ‏2012-11-09T20:10:25Z by SystemAdmin
PKSAHOO
PKSAHOO
4 Posts
ACCEPTED ANSWER

Pinned topic Concatenate a source field repeating multiple times to target fileld(1:1)

‏2012-10-04T14:03:35Z |
Hi ,

Can anybody help me in this below senarios, please
I have a requirements like need to concatenate a field repeating multiple times with certain condition.

Here Input file like

:11:/ACC/BANKUS40
/INS/MYINFO
/XYZ/YOURINFO
/ABC/INSTRUCTION5
/ABC/INSTRUCTION4
/ABC/INSTRUCTION3
/EDF/INSTRUCTION2

Above Input saying...............

There is a group named "11" and having two elements CODE and CodeVal with delimiter "/".
Group(11) is repeating (1:7)

I need to map to target item (VAL) which is repeating once means(1:1).

Mapping Condition is
IF CODE != "INS " then concatenate all "CodeVal" to "VAL"

That means expected output will be

"BANKUS40-MYINFO-YOURINFO-INSTRUCTION5-INSTRUCTION4-INSTRUCTION3-INSTRUCTION2" Or

"BANKUS40MYINFOYOURINFOINSTRUCTION5INSTRUCTION4INSTRUCTION3INSTRUCTION2"
Please share your thoughts.

Thanks in advance,
Nils
Updated on 2012-11-09T20:10:25Z at 2012-11-09T20:10:25Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    6184 Posts
    ACCEPTED ANSWER

    Re: Concatenate a source field repeating multiple times to target fileld(1:1)

    ‏2012-10-05T05:48:06Z  in response to PKSAHOO
    try SERIESTOTEXT(EXTRACT(value, code != "INS"), that should generate the string containing the different values.
    • PKSAHOO
      PKSAHOO
      4 Posts
      ACCEPTED ANSWER

      Re: Concatenate a source field repeating multiple times to target fileld(1:1)

      ‏2012-11-08T13:05:07Z  in response to SystemAdmin
      Thanks a lot.
      I got that,

      But If I want to concatenate Codeval of different CODE like ACC/INS/EDF then how to design the mapping rules.

      Means. In ACC Code Codeval is repeating 3 times as "BANKUS40,MYINFO,YOURINFO" and I need to concatenate these three to get output like "BANKUS40MYINFOYOURINFO"

      Same with INS also, to get output "INSTRUCTION5INSTRUCTION4INSTRUCTION3INSTRUCTION2".

      Because here Code is repeting with multiple Codeval.

      11:/ACC/BANKUS40
      //MYINFO
      //YOURINFO
      /INS/INSTRUCTION5
      //INSTRUCTION4
      //INSTRUCTION3
      //INSTRUCTION2
      /EDF/INSTRUCTION11
      Thanks is advance.
      • SystemAdmin
        SystemAdmin
        6184 Posts
        ACCEPTED ANSWER

        Re: Concatenate a source field repeating multiple times to target fileld(1:1)

        ‏2012-11-09T20:10:25Z  in response to PKSAHOO
        you can use MEMBER func as IF ( MEMBER (CODE ,{"ACC","INS","EDF}, true ,false- EXTRACT code val))

        so that when member returns false , it gets the reqd result.