LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2006)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
=========================================================================
Date:         Tue, 25 Jul 2006 11:00:31 -0500
Reply-To:     "Oliver, Richard" <roliver@SPSS.COM>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Oliver, Richard" <roliver@SPSS.COM>
Subject:      Re: CONCAT
Comments: To: Spousta Jan <JSpousta@CSAS.CZ>
Content-Type: text/plain; charset="US-ASCII"

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:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Spousta Jan Sent: Tuesday, July 25, 2006 10:30 AM To: SPSSX-L@LISTSERV.UGA.EDU 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:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Jonathan Havey Sent: Tuesday, July 25, 2006 5:27 PM To: SPSSX-L@LISTSERV.UGA.EDU 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


Back to: Top of message | Previous page | Main SPSSX-L page