LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (November 2002, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 26 Nov 2002 16:45:16 -0500
Reply-To:     "Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>
Subject:      Re: Question :Options and rules of using underscore
Comments: To: Knada <knada@acesag.auburn.edu>
Content-Type: text/plain; charset="iso-8859-1"

Nada,

I will write my reason.

I use beginning underscores to minimize the chance of conflict with existing names from the input data set. In most cases, I do not need them in the output data and the underscores easily catch my eye to make provision to get rid of them. I tend to drop them easily with:

data outputdata ( drop = __: ) ; .. run ;

Kind Regards, __________________________ Venky Chakravarthy E-mail: swovcc@hotmail.com

-----Original Message----- From: Knada [mailto:knada@acesag.auburn.edu] Sent: Tuesday, November 26, 2002 11:37 AM To: SAS-L@listserv.uga.edu Cc: Venky.Chakravarthy@pfizer.com; nada Nadarajah Subject: Question :Options and rules of using underscore

SAS-L members,

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.

This is example code is from Venky: ----------------------------------------------- %let numblanks = 3 ; data withblanks ( drop = __i ) ; set needsblank ; by var2 notsorted ; array allnum _numeric_ ; array allcha _character_ ; output ; if last.var2 then do __i = 1 to &numblanks. ; do over allnum ; allnum = . ; end ; do over allcha ; allcha = " " ; end ; output ; end ; run ;

----------------------------------------------

Thanks in advance.

Nada -- ***************************************** * Nada K. Nadarajah, PhD * * Research Fellow * * Dept. Of Animal Sciences * * 214 Upchurch Hall * * Auburn University, AL 36849-5415 * * USA * * Tel:334-844-1502 Fax: 334-844-1519 * * e-mail knada@acesag.auburn.edu * * * *****************************************

LEGAL NOTICE Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.


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