LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (April 2001, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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


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