IBM Sterling Transformation Extender

Sterling Transformation Extender

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


#Sterling
#Supplychain
 View Only
Expand all | Collapse all

COUNT WRONG ON UNIQUE FUNCTION

  • 1.  COUNT WRONG ON UNIQUE FUNCTION

    Posted 04/04/07 03:58 PM

    Originally posted by: jvanboga


    I am helping a co-worker with a problem. This is what he posted on another site.

    rule: "EXTRACT_SUBSCRIBER_ROW(Row:In1, COUNT(UNIQUE( DEP_BEGIN_DATE:Dep_Row:In1 )))"

    Sometimes the count is right others it is off... ie.. I have two dependents with the same date value. the 'count(unique...' value = 2. other times for other dependents they have the same value and count = 1.

    I looked at it and thought there might be non-printables etc that were causing the issue but that isn't the case. I also used a min/max rule to extract various dates when the count is higher than 1. Here's the result of a count greater than 1.

    dep count = 3
    unique count = 2
    max date = 20030519
    min date = 20030519
    fyi: in this process these dates are actually defined as text.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 2.  Re: COUNT WRONG ON UNIQUE FUNCTION

    Posted 04/04/07 07:38 PM

    Originally posted by: SystemAdmin


    Have you tried using the debugger yet? You did not specify a version, but at least in 8.1 you can set a breakpoint on that rule and watch the results of each function as you step through. This might give you an indication as to where the problem is. Just a thought.

    Yvonne Ricard
    Resistance is NOT futile.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 3.  Re: COUNT WRONG ON UNIQUE FUNCTION

    Posted 04/05/07 12:18 AM

    Originally posted by: jvanboga


    Yep! I imported it into 8.1. Unfortunatly it wasn't much help this time.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 4.  Re: COUNT WRONG ON UNIQUE FUNCTION

    Posted 04/05/07 10:37 AM

    Originally posted by: SystemAdmin


    So when you run it through the debugger do you see it come up with wrong value or is the value wrong at a later point? If you can see it come up incorrectly in the debugger, does the result match or not match the data in the right-most column? I guess what I am getting at is, have you identified which is return the wrong information -- the COUNT() or the UNIQUE()?

    Yvonne Ricard
    Resistance is NOT futile.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: COUNT WRONG ON UNIQUE FUNCTION

    Posted 04/05/07 05:28 AM

    Originally posted by: janhess


    Have you tried using just the unique function when it is giving the wrong count? This might help to tie down which function is at fault.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 6.  Re: COUNT WRONG ON UNIQUE FUNCTION

    Posted 04/05/07 10:42 AM

    Originally posted by: jvanboga


    OK, I added a loop to the end of the subscriber record

    dep_date (0:s)
    -date_field

    I then extracted the unique dates in question so I could see what was happening

    extract_unique_dep_dates(unique( DEP_BEGIN_DATE:Dep_Row:In1 ))

    I threw the my count unique and min/max outputs into a filler field. ran the results and this is what I got

    date count = 2
    MAX date = 20030519
    MIN date = 20030519
    unique dates 20030519 & 20060727

    The interesting thing is that in this example the dates extracted are not from "DEP_BEGIN_DATE:Dep_Row:In1". The are from another date field that occurs about 12 columns to the left in the record. So, in a sense the results are correct but for the wrong field, and yes, I confirmed that my rule pointed the correct field.

    Then ran this thru 8.1 with debugger on to see what fields the map thought it was checking and it was displaying the correct field name but using the wrong date value as described above.

    Any thoughts?

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


  • 7.  Re: COUNT WRONG ON UNIQUE FUNCTION

    Posted 04/05/07 10:48 AM

    Originally posted by: janhess


    I don't suppose you could have the name of the date fields switched? Have you tried using the other date in the rule?
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 8.  Re: COUNT WRONG ON UNIQUE FUNCTION

    Posted 04/05/07 11:01 AM

    Originally posted by: jvanboga


    Well, the rule says I looking at the correct field and the field is in the correct position in the type tree.

    I perf'd 2 more tests.

    1. extracted the date in question without the unique function. Pulled the dates from the same wrong field again.

    2. pointed to the dep dob with and without the unique function and it worked properly.

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


  • 9.  Re: COUNT WRONG ON UNIQUE FUNCTION

    Posted 04/05/07 11:04 AM

    Originally posted by: janhess


    OK last question. Have you set tracing on the input card to see if DSTX thinks the date is in the right place?
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 10.  Re: COUNT WRONG ON UNIQUE FUNCTION

    Posted 04/05/07 11:07 AM

    Originally posted by: janhess


    Sorry I lied. Is the date in an occurring group - group(1:s)?
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 11.  Re: COUNT WRONG ON UNIQUE FUNCTION

    Posted 04/05/07 12:08 PM

    Originally posted by: jvanboga


    file structure....

    file
    -sub_dep_loops (0:s)
    --sub_rec
    --dep_rec (0:s)

    The sub and dep recs are extracted from a DB using a union and a sort. The record layout for each is identical but a record type of 10 = subscriber and record type of 20 = dep. Each field in each record occurs 1X. All dep cols/fields are set to null in the subscriber record.

    When we encountered the problem I added the follwoing to the sub rec for this map

    dep_date (0:s) {initiator of 'DBD:'}
    -date_field

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


  • 12.  Re: COUNT WRONG ON UNIQUE FUNCTION

    Posted 04/05/07 03:36 PM

    Originally posted by: jvanboga


    found the issue....

    There was a modification in the map that I wasn't aware of so the results were not a reflection of what was actually going on.

    Talked with coworker and the mods were due to scope creep and weren't reflected in my copy of the project plan. when I wrote the shell, originally the date field was just copied. I started comparing the inputs and outputs a little more and..... pooofffff....

    Thanks for your help. Both of us should have caught this sooner.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender