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.  Generate Documentation from Type Trees

    Posted 10/07/05 12:12 PM

    Originally posted by: SystemAdmin


    I'm just wondering. Has anyone else looked into generating documentation from the type trees? I frequently create type trees based on copybooks, tables, or stored procedures that others have built. They may or may not have documented what they built, and I was wondering what it would take to generate a more reader friendly document from the type tree. Say, a CSV that could be opened in Excel? Other?
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 2.  Re: Generate Documentation from Type Trees

    Posted 10/07/05 07:52 PM

    Originally posted by: SystemAdmin


    There are several options for creating documentation or formatted reports for maps, type trees, and audit logs. Maps & trees will first require exporting the source file as a .xml file for maps and a .mts file for type trees. You can then read the XML file into a map using the appropriate type tree and then output a report or CSV file. Lately I have been using XSLT to extract desired fields and reformat the data. XML techniques probably provide the most elegant approach as you can format the output and anyone can view the documents in their browser.

    The related type trees if using DSTX are tryaudit.mtt, mapimportexport.mtt & ttmaker60.mtt. You may need to request current versions as the shipped versions weren't always current in the past. I haven't tried the 7.5 & 8.0 versions. It takes a while to figure out how to map the XML data but you only have to do it once.

    Some basic XSL tutorials can be found at http://www.w3schools.com/xsl/default.asp, a great tutorial site for anything XML-related. It only took me a few hours to learn enough to output some basic reports.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 3.  Re: Generate Documentation from Type Trees

    Posted 03/01/06 01:44 PM

    Originally posted by: SystemAdmin


    I have DSTX version 7.5.1. Would anyone be willing to share maps they have for reading the exported type tree (say MyTree.mts) and converting it to a quickly referenced document. I guess I wasn't specific enough in my post earlier.

    When I am troubleshooting a file that has come in, one of the first questions is does the file's data structure look good. In simple cases (say 5 or less fields per record), or even with delimited files, looking through the .mtt and comparing definitions to the record is pretty straight-forward. But, when we get into 15, or heaven forbid 50, fields the task becomes more tedious.

    I was hoping to export a type tree, then be able to create a simple file from the .mts that I can scan quickly, say:

    Group Name: Voucher Line
    Component 1: Vendor_ID, Min=1, Max=20
    Component 2: Item_Number, Min=10, Max=10
    etc.

    Or any variation of this. Frankly, I would think this would fit very nicely in the group window of the Type Designer when I few the components of a Group?

    Thank you.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 4.  Re: Generate Documentation from Type Trees

    Posted 03/02/06 12:46 AM

    Originally posted by: SystemAdmin


    Why not just run the file through a validation map with tracing on. You can then look at the trace file for any errors.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 5.  Re: Generate Documentation from Type Trees

    Posted 03/02/06 04:21 AM

    Originally posted by: SystemAdmin


    This is how we do it in suport (mostly):
    Data file is open in text editor (left side window) Trace file opened in another instance of text editor (or another window in the editor), Tree opened in Type Designer.
    What would be great would be to have one product open the same three windows, but have the data linked to the trace, linked to the tree.
    Yes I have this as an enhancement request :-).

    Sounds easy since the engine uses the tree to read the data and produce the trace file, but it is not that easy to do it in "trace debugger" product.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 6.  Re: Generate Documentation from Type Trees

    Posted 03/02/06 10:02 AM

    Originally posted by: SystemAdmin


    Comparing the data from the trace file is exactly why I would want the file I've described. The trace kicks out a message for the types in a group based on their real order in the input, while the type tree is in alphabetical order. I guess I can use right-click, properties on the field in the group window, but then I've got to hope the size properties are expanded to show the relevant data.

    Basically, I've got several text windows open like JSmoley suggests (data, trace, and error) and the type tree. The navigation of the type tree window is probably my biggest problem with this. The properties window doesn't always maintain my viewing preferences, so I spend too much time 'mousing' around to find the information I need.

    I just think that a simple file with:
    Group
    Component 1, Size(min,max), type, range?

    would help me to troubleshoot.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 7.  Re: Generate Documentation from Type Trees

    Posted 03/02/06 10:16 AM

    Originally posted by: SystemAdmin


    If your tree is simple enough, this could be constructed from the export. If you have really complex data (XML or some other types), this would not be easy.

    A data debugger like I described would be the easiest to use.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 8.  Re: Generate Documentation from Type Trees

    Posted 03/03/06 09:58 AM

    Originally posted by: SystemAdmin


    I've probably spent more time trying to find a way to automate this from the type tree export than it would take to do manually for the most part. For some type trees (groups with less than 20 records), it would be pretty easy to do the Copy & Paste from the type tree export. It just gets ugly when there are 100 columns in a database query.

    I have unsuccessfully tried to extract it from the .mts files, I was just hoping someone smarter would have succeeded <shrug>.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 9.  Re: Generate Documentation from Type Trees

    Posted 03/05/06 01:11 PM

    Originally posted by: SystemAdmin


    You can do it in a map but it is much easier if you create an XSL file and use it to extract the desired data from the MTS file. It takes about 30-40 lines of XSL code. And this code can be used on any type tree and may be easily modified should you wish to extract different fields. See http://www.w3schools.com/xsl/default.asp.

    Here's a simple XSL file to pull card info & map rules from a map export file:

    code:1:3f88bffb71<?xml version="1.0" encoding="ISO-8859-1"?><xsl&#58;stylesheet version="1.0"

    xmlns&#58;xsl="http&#58;//www.w3.org/1999/XSL/Transform">

    <!-- Copyright EC Solutions, Inc., an EAI, EDI, & SAP consultancy -->
    <!-- with extensive Mercator/DataStage TX experience. 330-606-6826 -->
    <xsl&#58;template match="/">
    <html>
    <body>

    DataStage TX Map Export

    <table border="1">
    <xsl&#58;for-each select="MMS/Map">
    <tr>
    <th align="left">
    Map:</th>
    <th align ="center">
    <xsl&#58;value-of select="@name"/></th>
    </tr>
    <tr bgcolor="#FFAAAA">
    <th align="left">No.</th>
    <th align="center">Card Name</th>
    <th align="left">Type Tree</th>
    <th align="center">Type</th>
    </tr>
    <xsl&#58;for-each select="Input/Schema">
    <tr bgcolor="#99CCCC">
    <td><xsl&#58;value-of select="@cardnumber"/></td>
    <td><xsl&#58;value-of select="@cardname"/></td>
    <td><xsl&#58;value-of select="@typetree"/></td>
    <td><xsl&#58;value-of select="@type"/></td>
    </tr>
    </xsl&#58;for-each>
    <xsl&#58;for-each select="Output">
    <xsl&#58;for-each select="Schema">
    <tr bgcolor="#99FFFF">
    <td><xsl&#58;value-of select="@cardnumber"/></td>
    <td><xsl&#58;value-of select="@cardname"/></td>
    <td><xsl&#58;value-of select="@typetree"/></td>
    <td><xsl&#58;value-of select="@type"/></td>
    </tr>
    </xsl&#58;for-each>
    <xsl&#58;for-each select="MapRule">
    <tr>
    <td></td>
    <td><xsl&#58;value-of select="objectset"/></td>
    <td><xsl&#58;value-of select="objectrule"/></td>
    </tr>
    </xsl&#58;for-each>
    </xsl&#58;for-each>
    </xsl&#58;for-each>
    </table>
    </body>
    </html>
    </xsl&#58;template></xsl&#58;stylesheet>[/code:1:3f88bffb71]
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender