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 (April 2000, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 28 Apr 2000 14:54:54 +0100
Reply-To:     John Whittington <John.W@MEDISCIENCE.CO.UK>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         John Whittington <John.W@MEDISCIENCE.CO.UK>
Subject:      Re: length of variable assigned to substr function.
Comments: To: "Workman, Robert" <rworkman@CARBOMEDICS.COM>
In-Reply-To:  <200004281325.OAA02906@vicar.netnames.net>
Content-Type: text/plain; charset="us-ascii"

At 08:19 28/04/00 -0500, Workman, Robert wrote:

>Unfortunately it doesn't seem to be that simple when using functions to set >the initial value of the variables. "The rule" holds true when using >assignment statements to assign a literal string to the variable. However, >different functions seem to have different rules for determining the length.

Robert, yes, you're dead right - and Ian W has explained the 'thinking' that the SAS compiler uses when the first encounter with a variable is an assignment with the value returned by a function like SUBSTR() - I had never noticed that the compiler was so 'clever'!

However, I think the bottom line still remains the same - that, unless one is sure that one knows what one is doing, and equally sure of all possible ata situations, one is advised to explicitly define the length of a character variable that has not come from another data set.

Thanks for pointing out my error!

Kind Regards,

John

---------------------------------------------------------------- Dr John Whittington, Voice: +44 (0) 1296 730225 Mediscience Services Fax: +44 (0) 1296 738893 Twyford Manor, Twyford, E-mail: John.W@mediscience.co.uk Buckingham MK18 4EL, UK mediscience@compuserve.com ----------------------------------------------------------------


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