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.  Generic XML to COBOL format transformation

    Posted 03/19/07 07:38 PM

    Originally posted by: SystemAdmin


    WTx v8.1 build 114 w/Command Server
    Win XP SP2 (Workstation)
    Solaris 10 OS (Server)
    Good day all,

    I have a new problem and I would appreciate any help. Everything I have worked with up to this point has been COBOL to COBOL transformation and data manipulation. I now have a XML file requiring transformation into a COBOL format before sending on to its intended endpoint. The xsd is generic (see attached) in structure. The lowest level nodes are all "DATAITEM" with an attribute "NAME" that delineates the data. Let me stress I have no control over the format by which the file is received or sent, I have been instructed to transform it and not change either endpoint.

    A single construct (from COBOL perspective) contains one case record and multiple client records, which in the XML file is represented by one "Record" node. The "CaseStructure" node also contains multiple programs "CaseProgramEDG". There are 21 "DATAITEM" nodes that may or may not have data in the "CaseProgramEDG" node. These programs are hierarchical and I need to pull only the highest priority program for the COBOL record. The pull is based on a "DATAITEM" with a "NAME" attribute of "PROGRAM-TYPE" and data value of "TN". Then for that "CaseProgramEDG" node I have to pull, transform and move it to the COBOL layout... Does this make sense?

    I believe I need to use EXTRACT() and/or LOOKUP() in some way but have yet to get very close to a solution. Please help.

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


  • 2.  Re: Generic XML to COBOL format transformation

    Posted 03/19/07 08:31 PM
      |   view attached

    Originally posted by: SystemAdmin


    I have added a gif that depicts the xml structure showing the nodes and how often the "DATA-ITEM" occurs in each node. Hope this helps.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 3.  Re: Generic XML to COBOL format transformation

    Posted 03/20/07 09:42 AM

    Originally posted by: janhess


    What does the cobol structure look like?
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 4.  Re: Generic XML to COBOL format transformation

    Posted 03/20/07 09:46 AM

    Originally posted by: SystemAdmin


    COBOL Layout...

    01 HEADER-RECORD.
    05 FILLER PIC X(9).
    05 REC-TYPE PIC 9(1).
    05 REC-SEGMENT PIC 9(1).
    05 FILLER PIC X(1).
    05 BATCH-RUN-DATE.
    10 BATCH-DATES OCCURS 6 TIMES.
    15 RUN-MM PIC 9(2).
    15 RUN-DD PIC 9(2).
    15 RUN-YYYY PIC 9(4).
    15 RUN-JJJ PIC 9(3).
    15 ORIGIN PIC X(1).
    15 RUN-NUM PIC X(5).
    15 FILLER PIC X(1).
    05 SEQ-NUM PIC 9(7).
    05 FILLER PIC 9(90).
    01 CASE-RECORD.
    05 CASE-NUM PIC X(9).
    05 REC-TYPE PIC 9(1).
    05 REC-SEGMENT PIC 9(1).
    05 CHILD-SUPPORT-CD PIC X(1).
    05 PROG-TYPE PIC X(1).
    05 PROG-STATUS PIC 9(1).
    05 PA-DATE.
    10 PA-YYYY PIC 9(4).
    10 PA-MM PIC 9(2).
    10 PA-DD PIC 9(2).
    05 SERVICE-COUNTY PIC 9(2).
    05 LOAD-NUM.
    10 DISTRICT PIC 9(2).
    10 UNIT PIC 9(2).
    10 WORKER PIC 9(2).
    05 NEG-ACT-CODE.
    10 NAC-IND PIC 9(1).
    10 NAC-REASON PIC 9(2).
    05 NEG-ACT-DATE.
    10 NA-YYY PIC 9(4).
    10 NA-MM PIC 9(2).
    10 NA-DD PIC 9(2).
    05 CASE-NAME PIC X(20).
    05 CASE-ADDR.
    10 SUPP-ADDR PIC X(20).
    10 STREET PIC X(20).
    10 CITY PIC X(15).
    10 STATE PIC X(2).
    10 ZIP PIC X(5).
    05 PA-OPEN-CODE PIC X(3).
    05 FILLER PIC X(1).
    01 RECIP-RECORD.
    05 CASE-NUM PIC X(9).
    05 REC-TYPE PIC 9(1).
    05 RECIP-NAME PIC X(20).
    05 RECIP-DOB.
    10 DOB-YYYY PIC 9(4).
    10 DOB-MM PIC 9(2).
    10 DOB-DD PIC 9(2).
    05 RECIP-SSN PIC 9(9).
    05 RECIP-ID PIC 9(10).
    05 GENDER PIC X(1).
    05 RACE-CODE PIC X(1).
    05 MOTHER-STAT PIC 9(2).
    05 FATHER-STAT PIC 9(2).
    05 PAMA-STAT PIC 9(1).
    05 ME-BEGIN-DATE.
    10 ME-BEG-YYYY PIC 9(4).
    10 ME-BEG-MM PIC 9(2).
    10 ME-BEG-DD PIC 9(2).
    05 ME-END-DATE.
    10 ME-END-YYYY PIC 9(4).
    10 ME-END-MM PIC 9(2).
    10 ME-END-DD PIC 9(2).
    05 GRANTEE-STAT-CODE PIC 9(1).
    05 RECIP-PER-CODE PIC 9(2).
    05 PROG-TYPE PIC X(1).
    05 PA-DQM PIC X(1).
    05 SCOPE-COV.
    10 SCOPE PIC 9(1).
    10 COVERAGE PIC X(1).
    05 FILLER PIC X(40).
    01 TRLR-RECORD.
    05 TRAILER-ID PIC X(9).
    05 REC-TYPE PIC 9(1).
    05 REC-SEGMENT PIC 9(1).
    05 FILLER PIC X(1).
    05 TYPE-1-TOTAL PIC 9(6).
    05 TYPE-2-TOTAL PIC 9(6).
    05 TOTAL-RECORDS PIC 9(6).
    05 FILLER PIC X(97).
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 5.  Re: Generic XML to COBOL format transformation

    Posted 03/20/07 05:24 PM

    Originally posted by: SystemAdmin


    The XSD doesn't look right to me. I would expect to see a "value" attribute defined for DATAITEM. Then, you might be able to LOOKUP(Value:ElemDecl DATAITEM WHERE Name:Attr:AttrList:ElemDecl DATAITEM="somevalue").

    It would be helpful if you provided some sample data. You may also want to use an XSD Inference Engine to build an XSD from your data and compare with the one you have provided.

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


  • 6.  Re: Generic XML to COBOL format transformation

    Posted 03/20/07 06:16 PM

    Originally posted by: SystemAdmin


    It is called PCDATA when the xsd is imported to the Type Tree. I was able to perform some simple functionality. However, the "BINDING" issue kept cropping into it. Once I figured out the semantics and dug through the forum for binding, I found conversations between you, JanHess, John Gibby and others that led me to some break through. I had, also, submitted a PMR to get further help. John just e-mailed in response to the post that follows this one on "binding hurdle...". Binding now makes some sense. I'll see where I get with it. I'll keep you posted.

    Thanks for the reply.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender