SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
Expand all | Collapse all

Question concerning concatenation of Strings

  • 1.  Question concerning concatenation of Strings

    Posted Fri March 19, 2021 11:09 AM

    Hello,

    So my problem is concerning the following syntax:

    String var3.

    Compute var3 = CONCAT(var1, var2).

    Execute.

    var1 and var2 are both string-variables and it is always the case, that when there is a value on var1, there is a missing on var2 and the other way around. '-66' is declarated is a missing.

    Now, if var1 = 'text' and var2 = '-66' this is what var3 should look like: var3 = 'text' and this is what it actually looks like: var3 = 'text-66'.

    So is there a possibility to achieve, that missings are treated like an empty string? Or do you have an idea where I made a mistake?

    Recoding var1 and var2 into numerics isnt possible because they are open answers .

    Thank you.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: Question concerning concatenation of Strings

    Posted Fri March 19, 2021 01:37 PM

    Look at the DO IF command and the MISSING function.






    #SPSSStatistics
    #Support
    #SupportMigration