Date: Wed, 17 Dec 1997 15:13:40 -0800
Reply-To: Erik Scott <escott@SFO.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Erik Scott <escott@SFO.COM>
Organization: San Francisco Online (Televolve, Inc.)
Subject: Re: string concatenation
Content-Type: text/plain; charset=us-ascii
Try this - the trim function removes trailing blanks from a variable -
useful in concatenation.
data _NULL_;
set test end=eof;
retain string;
format string $200.;
string = trim(left(string)) || trim(vname) ||'/';
put string=;
run;
Erik
marieke wrote:
> I was hoping the code returns a concatenated string
> name1/name2/name3/
>
> what is wrong with the following code?
>
> thanks
>
> data test;
> input vname $;
> cards;
> name1
> name2
> name3
> ;
>
> data _NULL_;
> set test end=eof;
> retain string '';
> format string $200.;
> string = string || FbcName ||'/';
> run;
|