Date: Tue, 26 Nov 2002 17:49:56 +0000
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: Question :Options and rules of using underscore
In-Reply-To: <E18GijZ-0007CY-00@coumxnn01.netbenefit.co.uk>
Content-Type: text/plain; charset="us-ascii"; format=flowed
At 10:36 26/11/02 -0600, Knada wrote:
>I have been noticing recently many SAS programmers use leading or/
>leading and trailing underscores in variable names as you see in the
>following SAS code from Venky. In the past only we often use underscore
>in ex: _n_ , to track observation number or in data step, _null_ etc.
>
>I couldn't find the rules/ options or guidelines of using underscores in
>SAS documentation and would someone please explain this options or
>direct me to read the guidelines /situations to use in programming code.
Nada, some people use the 'leading underscore' for variable names,
particularly in relation to global macro variables, and especially if they
are writing 'generic' code/macros which is going to be used in a variety of
situations, in an attempt to avoid 'clashes' with existing variable names
in datasets.
However, there's nothing magic or special about the underscore - they are
merely trying to create a 'very unusual' variable name, unlikely to be
present in a data set.
Others use a 'leading underscore' for variables they intend to DROP from a
DATA step, just to remind them (and others).
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
----------------------------------------------------------------
|