App Connect

App Connect

Join this online user group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

string with space in concatenation trimming white space at the end of first string

  • 1.  string with space in concatenation trimming white space at the end of first string

    Posted Thu July 22, 2021 05:09 AM
    Hi Guys,

    Anyone knows how to concatenate two strings with a space without the IIB integration bus trimming the space during transmission.when i create a variable with a space separating the string i can see in the debug the string is concatenated well but on transmission i have noted that the space seems to be trimmed and i am getting errors.if i hard code the variable the string is sent and i am getting the valid response. please can someone help me fix this problem

    ------------------------------
    Kenneth Muragu
    ------------------------------


  • 2.  RE: string with space in concatenation trimming white space at the end of first string

    Posted Thu July 22, 2021 02:11 PM
    Hi Kenneth,

    You didn't mention how you're attempting this transformation. Are you doing this via ESQL, Mapping Node? So, this is what I would do via ESQL. I would not add the space to the end of the first variable, I would add it during the concatenation process itself.

    DECLARE cVariable1 CHAR 'FirstString';
    DECLARE cVariable2 CHAR 'SecondString';
    DECLARE cConcatString CHAR cVariable1  || ' ' || cVariable2;
    
    Result in cConcatString would be 'FirstString SecondString'​


    ------------------------------
    James E. (Jim) Berube
    Technical Account Manager (TAM) - Specialist, IBM Expertise Connect
    IBM Cloud and Cognitive Software
    ------------------------------