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 (February 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 17 Feb 2009 17:30:58 +0000
Reply-To:     karma <dorjetarap@GOOGLEMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         karma <dorjetarap@GOOGLEMAIL.COM>
Subject:      Re: proc sql and %TRIM
Comments: To: Anindya Mozumdar <anindya.lugbang@gmail.com>
In-Reply-To:  <4e829fd30902170923v2dd41503v85434b7eb7051ffb@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

I suspect that for %left to work, there has to be delta charcters to show the start and end of empty strings. Removing these delta characters that %str places using %unquote seems make %trim act more like the strip function.

%let a = %str( xyz ); %put *&a*; %put *%trim(%unquote(&a))*;

2009/2/17 Anindya Mozumdar <anindya.lugbang@gmail.com>: > On Tue, Feb 17, 2009 at 9:57 PM, Marianne Weires <m.weires@dkfz.de> wrote: >> Dear all, >> >> This may be a very trivial question but I was hoping someone could help me >> with it: >> I have some piece of code (Example 1, see below) and I don't understand the >> behavior of %TRIM. TRIM and %TRIM remove trailing blank, however in Example >> 1 %TRIM also removes leading blanks (%TRIM(&anz_vname) and %TRIM(&vname2)). >> In Example 2 %TRIM removes trailing blanks (%TRIM(&time)). Am I missing >> something? >> > > Interesting. It looks like it has something to do with variables > created using PROC SQL - > > %let a = %str( xyz ); > %put *&a*; > %put *%trim(&a)*; > > proc sql noprint; > select " xyz " into :a > from sashelp.class; > quit; > %put *&a*; > %put *%trim(&a)*; >


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