IBM Sterling Transformation Extender

Sterling Transformation Extender

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

 View Only
Expand all | Collapse all

WTX for beginners

  • 1.  WTX for beginners

    Posted Tue June 26, 2007 02:24 AM

    Originally posted by: SystemAdmin


    Hi,
    I am very new to WTX(started working a day ago).
    I have to create a map that will pull data from CSV file and put it into a XML file.
    My first problem is how do i make a tree type for a CSV file, a row of which is pasted below.
    "
    r1c1,r1c2,r1c3,r1c4,r1c5,r1c6,r1c7,r1c8,r1c9,r1c10,r1c11
    r2c1,r2c2,r2c3,r2c4,r2c5,r2c6,r2c7,r2c8,r2c9,r2c10,r2c11
    "
    I have created the mtt for XML from the schema.
    With the current csv tree type,when i run the map, i get a message "Input valid but unknown data found"
    The output xml that is created has proper structure but no data.
    I would really appriciate help in
    1. Creating the tree type for csv file.
    2. How do I run the map automatically whenever the csv file is created.
    3. How do i provide the name of input file/output file at runtime.
    4. Any pointers to relevent documentation.

    Thanks.


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


  • 2.  Re: WTX for beginners

    Posted Tue June 26, 2007 03:19 AM

    Originally posted by: Kepa_Screen


    1- You must create 10 text fiels. Then create a group called line. Populate "line" with the 10 text fields ( infile, separator, literal ',') . Create a new group called file and populate it with group line. Use terminator literal <NL>.

    2- For this, you must use event server. You must create a new system, put the map in the system, and put a "trigger" at input card for .csv file .

    3- You can do this in several ways, usign modifier -O for output file, if using event server, you can use wildcards.
    ( i.e.
    inputfile = 'abc*.txt'
    and outputfile = 'def*.log'

    imagine
    real input filename is 'abc123.txt'
    then real output filename would be = 'def123.txt'
    )

    4- I think you must read all documentation ( Mercator on.line library ) that was installed with WTX
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 3.  Re: WTX for beginners

    Posted Tue June 26, 2007 05:57 AM
      |   view attached

    Originally posted by: SystemAdmin


    Its working but still not ok. I am sure there is some problem with my mtt files.
    Could you please have a look at them?
    In the output xml, just b4 the first character of the input file is entered, i am getting these junk characters "ÿþ". and the end of line char is not recognized..as the last record is coming as "r1c11 r2c1". r2c1 is Row2 Col1.it shoud have gone in the next node.

    Thanks for your quick response.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange

    Attachment(s)



  • 4.  Re: WTX for beginners

    Posted Tue June 26, 2007 06:18 AM
      |   view attached

    Originally posted by: Kepa_Screen


    Yes, sorry for my mistake.
    You must tell how much lines are in the group file.

    This could be "1:s", you must open File group, then on line, with right button, "SET RANGE" --> min: 1 - max: s

    So in your map, you must use a Funjavascript:postPressed()
    Submitctional Map in order to treat an unique record.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender

    Attachment(s)



  • 5.  Re: WTX for beginners

    Posted Tue June 26, 2007 07:00 AM
      |   view attached

    Originally posted by: SystemAdmin


    hi Kepa,
    This helped to a greater extent.
    The next problem is that the output xml is getting generated only for the first record.
    A snapshot showing i/p, o/p cards and the i/p and o/p results is attached.
    I have a feeling that there might be some problem with my output mtt file.

    Also could you please point me out to some tutorial that talks about creating type trees.

    Thanks for your assistance.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 6.  Re: WTX for beginners

    Posted Tue June 26, 2007 08:45 AM
      |   view attached

    Originally posted by: Kepa_Screen


    Hi again:

    You must use a functional map in order to treat more than one line in your file.
    The first thing to do is to put SET RANGE 1:s to Line group in File Group

    File
    Lines (1:s)

    Then, at the output card rule, you must put something like :

    File
    Lines (1:s ) = F_treat_records(Line:Input)

    Then create the functional map with the wizard, in order to pass a single record to the functional map.

    Then in functional map output, you only have to map field by field.

    I attach another picture showing this ( in my case, output type tree is the same than input type tree ).

    Picture1 : how to create a functional map
    Picture2 : you only have to map field by field, because at functional map level you only have one record.


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


  • 7.  Re: WTX for beginners

    Posted Tue June 26, 2007 08:46 AM
      |   view attached

    Originally posted by: Kepa_Screen


    here is the second picture
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 8.  Re: WTX for beginners

    Posted Wed June 27, 2007 05:19 AM
      |   view attached

    Originally posted by: SystemAdmin


    Hi Kepa,
    I tried whatever you suggested. and now my maps looks similar to snapshots that you had posted...but still i am getting only 1 record populated in the xml output file.
    Could you please have a look at the snap of the functional map(pict1) and execution map(pict2) and help me figure out what is wrong.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 9.  Re: WTX for beginners

    Posted Wed June 27, 2007 05:20 AM
      |   view attached

    Originally posted by: SystemAdmin



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


  • 10.  Re: WTX for beginners

    Posted Wed June 27, 2007 06:09 AM

    Originally posted by: Kepa_Screen


    Could you send to me your input and output .mtt, and also an input file ?
    I can see your mapping at first picture, so i could try to make a similar map.

    It's very important to put AUDIT Logs ON, also TRACE on, when you are developing, so you can see where it's wrong.

    If you are trying to map a collection of records from a file, then the output should be another file, just another collection of records...are you sure that your output card type tree is also 1:s ?

    You can send to me your i/o .mtt and the input file ? ( kampanita(dot)gmail.com )
    I'll try to help you.

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


  • 11.  Re: WTX for beginners

    Posted Sat June 30, 2007 04:55 AM
      |   view attached

    Originally posted by: vickey


    Arora,

    Nice that Kepa is helping you. I hope this issue is resolved.

    I would like to let know one thumb rule in Mercator. when you want to iterate objects more than once then the input range should be either 0:S or 1:S. and the output range should also be either 0:s or 1:S.

    In the pic you attached if you closely look you are using a fucntional map where the range of the output is 1:1.

    The schema you imported to create the type tree is incorrect. Correct you schema to loop the Segments and then reimport.

    I have attached the pic where the range should be 1:S.

    Let me know if you any more questions.

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


  • 12.  Re: WTX for beginners

    Posted Sat June 30, 2007 06:37 AM

    Originally posted by: SystemAdmin


    hi kepa/krishnan,
    I modified the outpot mtt file as adviced. Things now seem to be working ok..as long as there is only 1 rec in the input csv file. If there are more than 1 line, I get an error trace like

    "
    (Level 2: Offset 62, len 5, comp 12 of 12, #1, DI 0000000C:)
    Data at offset 62 ('r1c12') was found to be of TYPE
    X'0010' (Path Field Data).

    (Level 1: Offset 0, len 67, comp 1 of 1, #1, DI 0000000D:)
    Data at offset 0 ('r1c1,r1c2,r1c3,r') was found to be of TYPE
    X'0003' (Line Data).

    (Level 1: Offset 67, len 0, comp 1 of 1, #2, DI 0000000E:)
    COMPONENT number 1 of TYPE X'0002' (File Data):
    occurrence 2 is optional and has no content.

    (Level 0: Offset 0, len 67, comp 1 of 0, #1, DI 0000000E:)
    Data at offset 0 ('r1c1,r1c2,r1c3,r') was found to be of TYPE
    X'0002' (File Data).

    INPUT 1 was valid but contained 138 bytes of unknown data at the end.
    "
    I am using NL as the record terminal char. I tried using <CR><LF> also, but that also resulted in the same type of error msg.

    Could you please suggest if this is some prob with my input CSV file or something wrong in my mtt files?

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


  • 13.  Re: WTX for beginners

    Posted Sat June 30, 2007 06:45 AM

    Originally posted by: vickey


    Hi Arora,

    Can you send me the components. So that I can correct it and send u back the components.

    you can send me the Maps, Input & Output Type tree, XML schema and Input files.

    You can zip them and send them to my email ID vikashrk@gmail.com.

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


  • 14.  Re: WTX for beginners

    Posted Mon July 02, 2007 10:56 AM

    Originally posted by: janhess


    Have you defined your file as having multiple records?
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 15.  Re: WTX for beginners

    Posted Fri April 20, 2018 01:04 PM

    Originally posted by: shilpaAllam


    INPUT 1 was valid but contained 138 bytes of unknown data at the end.
    "
    I am using NL as the record terminal char. I tried using <CR><LF> also, but that also resulted in the same type of error msg.

    Could you please suggest if this is some prob with my input CSV file or something wrong in my mtt files?

     

    I have similar type of error, can you provide me a solution on it?


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


  • 16.  Re: WTX for beginners

    Posted Mon April 23, 2018 03:23 AM

    Originally posted by: PaulBrett


    Please start a new post.

    Thank you.

    Paul

    Follow me on Twitter


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