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

Help with WTX Mapping Issue

  • 1.  Help with WTX Mapping Issue

    Posted 10/04/07 01:55 PM

    Originally posted by: SystemAdmin



    Hello-

    I am very new to WTX and I have two issues that I cannot seem to resolve. Issue #1-
    I am having an issue where my map will only read the first segment that appears in my file. I was under the impression that if I didnt need a specific segment to be read, I wouldn't need to create an index and all segments within a particular loop would be read. I have also tried to indext by adding the segment number after each one but it still doesnt work. I have also tried to create a functional map but it still only reads the first segment.

    What Im trying to determine in my map rule is if any of the segments in group 2 have a locfunctcdqual's or 20 or 21, and if so, map X else Y. Here are two examples that I have tried:
    =EITHER(IF(LocFunctCdQual'r Element:.:Group2:.:batch = "20" , "21", "X"), "Y")
    =EITHER(IF(ALL(LocFunctCdQual'r Element:.:Group2:.:batch = "20" ), "21"), "X", "Y")
    Can someone tell me what I am doing wrong or have any suggestions? Thanks

    Issue #2
    I need my map to be able to read a map that has a DOB of 6 or 8 characters. The issue that I am having is, in WTX the century is automatically being added if the DOB is 6 char which is great; however, when the file contains 8 char. including the century I am getting 2020-07-04. I have tried to figure out if the century is present, then trimleft, 20, I have also changed the map settings but nothing I am doing is working. how can I get the map to suppress the century if present in the dob field? Sorry for such simple questions but any help will be greatly appreciated.

    Thanks in advance
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 2.  Re: Help with WTX Mapping Issue

    Posted 10/04/07 03:14 PM

    Originally posted by: jvanboga


    Issue #1.... Lot of ways to write the rule.

    It may be a type tree issue. How is your output tree structured? ie... Can the element/field in question occur more than once at the rule's level? does your field look something like "field_name", "field_name(S)" or "field_name(0:n)"?
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: Help with WTX Mapping Issue

    Posted 10/04/07 03:19 PM

    Originally posted by: jvanboga


    Sorry, issue 2: "I need my map to be able to read a map... "? do you mean you need your map to be able to read a DOB?

    How are your input and output date fields defined? Check your type tree? Is it defined as a date or text? If date what date format is defined? Several ways to do what you want but it might help to know.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: Help with WTX Mapping Issue

    Posted 10/04/07 03:42 PM

    Originally posted by: SystemAdmin


    Its reading the DOB, but when the DOB comes in with the century and the map setting is defined as sliding it is reading the DOB as: 2020-07-04. On the input side the intent = general, subclass = text, interp. as char 1-35 (since its date/time/period. On the output side it is defined as subclass = char., interp. as character, format {CCYY-MM-DD}. Thanks again.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: Help with WTX Mapping Issue

    Posted 10/04/07 04:38 PM

    Originally posted by: jvanboga


    Ok, so it looks like you are reading in text and writing out a date... You're going to get a lot of advice on this one......

    Assuming that while your input is text 1-35 and is date the only value passed in that field is the date and the date is either going to be ccyy-mm-dd or yy-mm-dd you could create a functional map

    f_map(date:field, word(date:field, "-", 1))

    The f_map rule would then read something like todatetime(if size(input2) = 4, input1, code determining what cc should be + input2), "ccyy-mm-dd")

    If your input actually contains time/period values enhance the rule above to grab the date protion only.

    Probably an easier way but.....

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


  • 6.  Re: Help with WTX Mapping Issue

    Posted 10/05/07 09:25 AM

    Originally posted by: SystemAdmin


    Thank you! I will try this and let you know what happens!
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 7.  Re: Help with WTX Mapping Issue

    Posted 10/04/07 03:34 PM

    Originally posted by: SystemAdmin


    The field in the output type tree looks like "field)_name(0:1). I tried to change this to (0:4) and it still didnt work. Should I try again but this time use a functional map? Thank you for the suggestion
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 8.  Re: Help with WTX Mapping Issue

    Posted 10/04/07 04:41 PM

    Originally posted by: jvanboga


    If your field is defined as (0:1) you'll only output up to one occurance. If you want more you'll need the (0:4) with an f_map.

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


  • 9.  Re: Help with WTX Mapping Issue

    Posted 10/05/07 09:21 AM

    Originally posted by: SystemAdmin


    Thank you! I will give it a try and let you know what happens. Thanks again.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 10.  Re: Help with WTX Mapping Issue

    Posted 10/05/07 10:16 AM

    Originally posted by: SystemAdmin


    Ok, I tried it this way, and yes it does give me 4 outputs; however, I may have described the result I am trying to get incorrectly (my mistake). I think the problem is in my map rule. What I am trying to do is read all four LOC's *in a particular group) to determine their result, and if any one of the results is 21, or Y then map Y only. Something like this:
    If LOC1 =20(X), LOC2=21(Y), LOC3=20(X), LOC4=20(X). The result would be map Y
    If LOC1 =20(X), LOC2=20(X), LOC3=20(X), LOC4=20(X). The result would be map X
    If LOC1 =21(Y), LOC2=21(Y), LOC3=21(Y), LOC4=21(Y). The result would be map Y

    Is there anyway to accomplish this in a map rule? Thanks

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


  • 11.  Re: Help with WTX Mapping Issue

    Posted 10/05/07 10:46 AM

    Originally posted by: jvanboga


    Not sure if this will help you but you could try the lookup function as part of your rule. Assuming LOC1 thru LOC4 are part of a group it should work.

    either(lookup(LOC, "Y", "Y"), "X")

    OR if (present(lookup(LOC, "Y", "Y"), map Y, map X)
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 12.  Re: Help with WTX Mapping Issue

    Posted 10/05/07 10:56 AM

    Originally posted by: jvanboga


    soory forgot to give you another option.... again though you can do this all sorts of ways this is just one (and the syntax may need tweaking)....

    if(countstring(uppercase(seriestotext(LOC1 + LOC2=21 + LOC3 + LOC4 )), "Y") > 0, map Y, map X)
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 13.  Re: Help with WTX Mapping Issue

    Posted 10/05/07 11:08 AM

    Originally posted by: SystemAdmin


    ok, I will try both options. Thanks for the suggestions, any help at this point is greatly appreciated.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 14.  Re: Help with WTX Mapping Issue

    Posted 10/05/07 11:12 AM

    Originally posted by: janhess


    =IF(LocFunctCdQual'r Element:.:Group2:.:batch = "20" | LocFunctCdQual'r Element:.:Group2:.:batch ="21", "X", "Y")
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 15.  Re: Help with WTX Mapping Issue

    Posted 10/05/07 12:25 PM

    Originally posted by: SystemAdmin


    ok, these suggestions have been great, they seem to work, but since I have four loc's to search, my map is looking at the first loc and then mapping either x or y. I have even tried to add an index, and add the segment numbers, but it is still looking at the 1st occurrence. Even when I remove the segment #'s, it still looks at the first segment and not the other 3. I need it to look at all 4 loc's then if any one of the loc is y to map a y else x. The problem is when the 1st one is x and the last one is y then it should map a y, or if any one in between is y it should map y. I will keep trying, your suggestions have really helped me. Thanks
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 16.  Re: Help with WTX Mapping Issue

    Posted 10/05/07 12:28 PM

    Originally posted by: janhess


    Have you tried using the MEMBER function?
    if(member(series,"Y"),"Y","N")
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 17.  Re: Help with WTX Mapping Issue

    Posted 10/05/07 01:22 PM

    Originally posted by: SystemAdmin


    Yes, it still only reads the first loc. Thanks for your help.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 18.  Re: Help with WTX Mapping Issue

    Posted 10/07/07 06:18 AM

    Originally posted by: janhess


    Then the problem must be with your output. Does it occur multiple times?
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 19.  Re: Help with WTX Mapping Issue

    Posted 10/09/07 10:46 AM

    Originally posted by: SystemAdmin


    Youre correct, it doesnt occur multiple times. I had to ask for additional help and I had to use a functional map to get it to work. Everything is ok now, thank you for your help.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 20.  Re: Help with WTX Mapping Issue

    Posted 10/09/07 12:18 PM

    Originally posted by: SystemAdmin


    I have this same issue, how did you get this to work?
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 21.  Re: Help with WTX Mapping Issue

    Posted 10/09/07 12:25 PM

    Originally posted by: janhess


    The output needs to occer S and use a functional map
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 22.  Re: Help with WTX Mapping Issue

    Posted 10/10/07 08:55 AM

    Originally posted by: SystemAdmin


    Actually, I dont want the output to occur multiple times. The problem was the input occurred multiple times (loc1, loc2, loc3, loc4) but I only wanted 1 output. Because of this I had to nest functional maps and use the Or function. The credit for this solution belongs to the support I recd from IBM. I really appreciate all of the responses to this post, it seems like I wasnt the only one having this issue.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 23.  Re: Help with WTX Mapping Issue

    Posted 10/09/07 12:31 PM

    Originally posted by: jvanboga


    http://www.ibm.com/developerworks/forums/dw_thread.jsp?message=13998980&cat=19&thread=177948&treeDisplayType=expandtree&forum=829#13998980

    You'll only get 1 output if one or more of the following conditions are true...

    a: your input field/group occurs is defined as (0:1) or (1:1)
    b: your output field/group occurs is defined as (0:1) or (1:1)
    c: you are not using a functional map (depends on rule)

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