Good point. A frequent source of confusion with concatenating the values of string variables is that all string variable values are right-padded to the defined width of the string; so an A8 variable with a value of "A" is really "A ". The RTRIM function returns just the "A" without the trailing blanks. This is a factor for string manipulations such as concatenation, but not for conditional expressions. For example IF stringvar="A" will return true for the above example value, regardless of the defined string width.
-----Original Message-----
From: SPSSX(r) Discussion [mailto:
[hidden email]] On Behalf Of Spousta Jan
Sent: Tuesday, July 25, 2006 10:30 AM
To:
[hidden email]
Subject: Re: CONCAT
Hi Jonathan,
Is the variable Descr long enough? Did you tried to use rtrim?
COMPUTE Descr = CONCAT ("SW ",rtrim(crsno),"-",rtrim(sec)) .
Greetings
Jan
-----Original Message-----
From: SPSSX(r) Discussion [mailto:
[hidden email]] On Behalf Of Jonathan Havey
Sent: Tuesday, July 25, 2006 5:27 PM
To:
[hidden email]
Subject: CONCAT
I'm having trouble getting CONCAT to work with more than two items.
COMPUTE Descr = CONCAT ("SW ",crsno,"-",sec) . This successfully concatenates "SW " and the variable crsno, but stops there. The same problem occurs with using just variables.
Jonathan Havey
UB School of Social Work