IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Problem with GETANDSET

    Posted 03/20/06 07:11 AM

    Originally posted by: SystemAdmin


    hi,

    I have a map that have
    - one input card 'Counter' (that opens a file 'counter.txt' to get a number) and
    - one output card 'Calculate' that will do a GETANDSET with the value of input card 'Counter'.

    each time the map is called, it will do Counter + 1. The action of GETANDSET will automaticly update the file (as describe in the doc - GETANDSET function):
    output card 1 = GETANDSET(Counter, Counter + 1 , 2)

    It works fine. I put 1 in the file counter.txt.

    first call to the map: the file contains 2
    first call to the map: the file contains 3
    first call to the map: the file contains 4
    ...
    the problem happens when value = 9 in the file. when calling the map, the value counter will be 9. The value of output card will be 9 + 1 so equal to 10. The GETANDSET increment the value correctly BUT the the automatic uptdate in the file is not correct. the file contains now the character #

    the problem seems to appear when the value in the file (the actual counter value) is eq to 9 or 99 or 999 or 9999 etc. when going to a number with one more digit!!

    9 + 1 = # (in the file)
    99 + 1 = ## (in the file)
    999 + 1 = ### (in the file)

    Any idea of what is wrong ?? error in my code? Bug in DSTX ?

    thanks in advance !!!

    Stephane
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 2.  Re: Problem with GETANDSET

    Posted 03/20/06 07:18 AM

    Originally posted by: SystemAdmin


    The field you are updating must be a fixed length so you should set is as something like number character size min 5 chars max 5 chars.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 3.  Re: Problem with GETANDSET

    Posted 03/20/06 11:22 PM

    Originally posted by: SystemAdmin


    oki ... but if my counter start at 1. I won't be able to go to 10 or more ... if I have to fix the size! right ?

    for ex:

    if I put size min 5 max 5, the numbers permitted will be 10000 to 99999. am I right ?

    thanks in advance.
    steph
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: Problem with GETANDSET

    Posted 03/21/06 12:30 AM

    Originally posted by: SystemAdmin


    No. It will go from 1 to 99999.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 5.  Re: Problem with GETANDSET

    Posted 03/21/06 04:01 AM

    Originally posted by: SystemAdmin


    :o) yesss of course. sorry ;o)

    but I have to fix a limit. That is a little problem. I could fix a high limit (min max = 1000000000 for ex.) but it is still a hard coded limit. :o( In some cases it could be problematic ...

    thanks a lot for your solution !!!!!

    Steph
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 6.  Re: Problem with GETANDSET

    Posted 03/21/06 04:23 AM

    Originally posted by: SystemAdmin


    You could use a database and update the field using sql. That way you would only be limited by the database field.
    In Oracle the NUMBER datatype stores zero, positive, and negative fixed and floating-point numbers with magnitudes between 1.0 x 10 -130 and 9.9...9 x 10 125 (38 nines followed by 88 zeroes) with 38 digits of precision.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange