|
Gonzalo,
try this:
compute item3=10*item1+item2.
Hector Maletta
Universidad del Salvador
Buenos Aires, Argentina
Gonzalo Kmaid wrote:
>
> In article <saccojos-ya023480002703970035290001@news.msu.edu>,
> saccojos@pilot.msu.edu says...
> >hi,
> >I have two variables, say, item1 and item2 and want to create a third
> >variable item3 that is a concatentation of item1 and item2. e.g., if
> >item1=2 and item2=6 then item3=26 without using if then statements. any
> >ideas?
> >>please respond via email as well as by post.
> >thanks.
>
> A somewhat ineficient way to this is to create "duplicates" of the numeric
> variables but as string ones (using compute and the 'string' function), then
> concatenate them using the 'concatenate' function in a compute statement,
> and then creating a numeric variable from the string-concatenated-variable
> (using the 'number' function in a compute statement)...for sure there is a
> more elegant way to do this...any additional help? :-):-)
>
> Gonzalo Kmaid
>
> --
> Field of Development Sociology
> Cornell University
> Ithaca, New York 14853
|