IBM Sterling Transformation Extender

Sterling Transformation Extender

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


#Sterling
 View Only
  • 1.  COUNTSTRING Function

    Posted Mon March 15, 2021 08:10 AM
    Hi,

    is it possible to count <CR><LF> or <LF> in a file?

    I know these are special character and not strings so i think its not possible.

    I have tried with symbol function inside countstring function but does not get any output.

    my requirement is to make a generic map which will take string dynamically from a DB or B2BI and then count it.

    Thanks
    Santanu

    ------------------------------
    Santanu Baral
    ------------------------------

    #IBMSterlingTransformationExtender
    #DataExchange


  • 2.  RE: COUNTSTRING Function

    Posted Mon March 15, 2021 12:22 PM
    Not sure exactly what you are asking for.
    If you are counting the number of elements in field or segment, you can try COUNTABS instead of COUNT.

    If you are using COUNTSTRING, you can try
    COUNTSTRING(element_name, "<CR>")
    or
    COUNTSTRING(element_name, "<<hex>>"

    ------------------------------
    Rex Chan
    ------------------------------



  • 3.  RE: COUNTSTRING Function

    Posted Tue March 16, 2021 07:27 AM
    Thank you so much.

    I have two records in my input file with each record terminates with <CR><LF>
    I was trying earlier as NUMBERTOTEXT(COUNTSTRING(Field:Record:Input,"<CR><LF>")) which returns 0 to me
    I have changed the logic to NUMBERTOTEXT(COUNTSTRING(TEXT(Record:Input),"<CR><LF>")) which returns 2 to me

     Actually i am trying to develop a generic map which will take string to count from a DB table or B2BI during runtime and gives the output.
    So the string can be alphabet or any word or new line character or anything.

    Thanks again.

    Thanks
    Santanu

    ------------------------------
    Santanu Baral
    ------------------------------