IBM Sterling Transformation Extender

Sterling Transformation Extender

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

 View Only
  • 1.  Count total number of RCD in a output TEXT file

    Posted Mon August 31, 2015 02:37 AM

    Originally posted by: yeswtx


    Hello,

    I have a problem here, I create an output which is a flat file (: delimited).

    I have a trailer element in the output which expects total count of RCD in the output.

    I use COUNTSTRING(PACKAGE(TextOUT), "'") as map rule but it doesn't work. (every output record ends with single quote ' )

    Any help would be greatly appreciated.

     

    Output structure for more clarity:-

    Header

    Loop (it has 5 records inside & 3rd record again is a loop) 

    Trailer (it has the element which needs this COUNT value).

     

     

     

     


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


  • 2.  Re: Count total number of RCD in a output TEXT file

    Posted Mon August 31, 2015 09:22 AM

    Originally posted by: jvanboga


    Have you tried counting the records?

     

    =COUNT(record:name IN Out)


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


  • 3.  Re: Count total number of RCD in a output TEXT file

    Posted Mon August 31, 2015 09:33 AM

    Originally posted by: yeswtx


    hello,

    Yes tried this too, doesn't work.

     


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


  • 4.  Re: Count total number of RCD in a output TEXT file

    Posted Tue September 01, 2015 01:23 AM

    Originally posted by: yeswtx


    Hello,

    This works with =COUNTSTRING(SERIESTOTEXT(TextOUT) ,"'").

    Thanks


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


  • 5.  Re: Count total number of RCD in a output TEXT file

    Posted Tue September 01, 2015 06:08 AM

    Originally posted by: paul.brett


    I am pleased to see that you found your own workaround  My own testing on a dummy map indicates that COUNTSTRING(PACKAGE()) should have worked.

    If you want this pursued further (and to expand everybody's knowledge here) perhaps you could attach your testcase?

    Thank-you.

    Paul.

    Follow me on Twitter


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


  • 6.  Re: Count total number of RCD in a output TEXT file

    Posted Tue September 01, 2015 09:12 AM

    Originally posted by: yeswtx


    Sorry for not being able to attach the test case,

    The problem was that the PACKAGE function, the B_LOOP treat only one B_LOOP occurrence (12 times), but B_LOOP has child loops A_LOOP, C_LOOP which were not being considered.

    With the SERIESTEOTEXT function, you retrieve all the B_LOOP,A_LOOP, C_LOOP, transform them into a text, and count the quotes (RCD terminator value).

    I hope this helps.


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


  • 7.  Re: Count total number of RCD in a output TEXT file

    Posted Tue September 01, 2015 04:26 PM

    Originally posted by: Srini_IBM


    Depends on How you defined your in put Structure , need to defined your Input/Output tree , need to create root --> sibling1 --> sibling 2 and so on , next card you need to cunt all records by using count ( Root IN last last child ) , remember this will not work for Burst mode , if its burst mode you need to run index and need to multiply with your burst count , Hope this helps , 


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