Re: Concatentating two variables
Posted by
Art Kendall on
Aug 26, 2013; 10:16pm
URL: http://spssx-discussion.165.s1.nabble.com/Concatentating-two-variables-tp5721736p5721737.html
GET
FILE='C:\Users\Art\AppData\Local\Temp\Data_Sample.sav'.
string bigID1 (a6) bigID2(a5).
compute bigID1 =
concat(string(Hospital,N4),String(Unit_numerical,n2)).
compute bigID2 = concat(string(Hospital,N4),Unit_string).
list.
Art Kendall
Social Research Consultants
On 8/26/2013 5:37 PM, The Burl [via SPSSX Discussion] wrote:
Thanks in advance for any advice on this!
The data:
Hospital Id, which is numerical ranging from 1-4 digits (e.g. #3
to #3213)
Combine with a variable that identifies a respondent's work group
(e.g., "pharmacy") which I have as a string variable, as well as a
numeric (e.g., "a" and "1")
It seems fairly simple to concatentate these two variables but I'm
having difficulties... Would RTRIM help here?
A sample of the data is attached...
Thank you!Data_Sample.sav
Art Kendall
Social Research Consultants