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.
2 replies Latest Post - ‏2012-11-20T06:16:21Z by Muk1234
Muk1234
Muk1234
22 Posts
ACCEPTED ANSWER

Pinned topic Increment a value of an output field

‏2012-11-19T10:44:10Z |
Hello
I have an output field 'id' whose value depends on an input field. The id maps to a field 'refid' in a functional map. The functional map runs multiple times if there are multiple refids and generates the output accordingly. But I want the value of id to be 0 if the refid=p and 1,2,3,4...and so on if the refid='d'. So basically I want to increment the value of id each time for each refid='d' so that I can get the value of id as 1 for first refid='d' and then 2 for second refid='d' and so on. Can anyone Please help me on this. I am stuck at this issue for long. Would appreciate any help on this.Thanks in advance.
Updated on 2012-11-20T06:16:21Z at 2012-11-20T06:16:21Z by Muk1234
  • SystemAdmin
    SystemAdmin
    6184 Posts
    ACCEPTED ANSWER

    Re: Increment a value of an output field

    ‏2012-11-19T14:21:52Z  in response to Muk1234
    I'd suggest you use an integer as the counter's value, initialize it to 1 when the map starts, and then use GETANDSET to increment it.

    The number should be of fixed length (padded to fix length with zeroes works) and long enough to accomodate the highest possible value.

    Hope this helps

    Laurent
    • Muk1234
      Muk1234
      22 Posts
      ACCEPTED ANSWER

      Re: Increment a value of an output field

      ‏2012-11-20T06:16:21Z  in response to SystemAdmin
      Thankyou Laurent. But Index($)served my purpose. Would look into GETANDSET().

      Muk