Date: Fri, 6 Apr 2001 22:00:14 -0700
Reply-To: maxsfolks <maxsfolks@EMAIL.MSN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: maxsfolks <maxsfolks@EMAIL.MSN.COM>
Subject: Re: Merge two strings
Jim,
Try something like this:
data new;
input var1 $ var2 $;
cards;
ABC DEF
AED FFF
;
run;
data new2;
length var3 $8 var4 $16;
set new;
var3=trim(var1)||trim(var2);
var4=var1||var2;
run;
proc print;
run;
The '||' pipe characters tell SAS to concatinate.
The TRIM function will remove spaces if VAR1 and
VAR2 are variables with a length greater than 3.
Regards,
Bill McKirgan
jimcmi2 <jimcmi2@QWEST.COM> wrote in message
news:3ACDE354.153A33E9@qwest.com...
> Quick question, sorry to trouble you all with this, but I am in somewhat
> of a rush.
>
> I have two string fields and want to produce one string that is a combo
> of the two.
>
> Var1 Var2
> ABC DEF
> AED FFF
>
>
> Need Var3
> ABCDEF
> AEDFFF
>
> I do not see any concat function in SAS help, but I am sure I am missing
> something
>
> Any help would be appreciated.
>
> Jim
|