Date: Wed, 12 May 2004 09:55:16 -0400
Reply-To: Howard Schreier <howard_schreier@ITA.DOC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Howard Schreier <howard_schreier@ITA.DOC.GOV>
Subject: Re: aligning and length statement
Leave the TRIM function out. The intermediate result reurned by TRIM has
no trailing blanks, so there is no "space" for the RIGHT function to shift.
In other words, RIGHT and TRIM provide alternative ways to get rid of
trailing blanks. If you apply one, there is nothing for the other to do.
On Wed, 12 May 2004 02:27:52 GMT, David Wright <David_wright@SPRA.COM>
wrote:
>I was helping a client who needed to right align and zero fill a character
>field (y).
>
>I suggested:
>
>length $20 x;
>x=right(trim(y));
>
>and then translate the blanks to zeros.
>
>This turns out to only work if there is no length statement.
>
>Why is this the case? Doesn't the length statement simply intitalize a
>variable? And how can I work around the possiblity x might inititalize
with a
>length that is too small?
|