LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2002, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 11 Sep 2002 09:03:14 -0700
Reply-To:     "Huang, Ya" <ya.huang@PFIZER.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Huang, Ya" <ya.huang@PFIZER.COM>
Subject:      Re: Appending ";" at the end of a variable
Comments: To: Action Man <wollo_desse@HOTMAIL.COM>
Content-Type: text/plain

191 data _null_; 192 length big_var $50; 193 big_var="I_am_too_Big_2_handle"; 194 put big_var=; 195 big_var=trim(big_var)||';'; 196 put big_var=; 197 run;

big_var=I_am_too_Big_2_handle big_var=I_am_too_Big_2_handle; NOTE: DATA statement used: real time 0.01 second

You have to declare the length of big_var long enough to fit in one more letter. If you don't use length statement, by default, big_var will get the length of the first string assigned to it, therefore, when you try to concatenate one more letter, there is no room for it.

BTW, no need of macro var here.

Kind regards,

Ya

-----Original Message----- From: Action Man [mailto:wollo_desse@HOTMAIL.COM] Sent: Wednesday, September 11, 2002 8:50 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Appending ";" at the end of a variable

Hello SASL;

I need to append ";" at the end of a variable, I tried the following;

%let commait = %str(;);

data test1; big_var="I_am_too_Big_2_handle"; run;

data test2; set test1; big_Var=Big_var||&commait; run;

but I am not getting the ";" at the end of the variable. What am I doing wrong?

Thank you in advance. Wollo

_________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx


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