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 (September 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 10 Sep 2007 09:40:08 -0700
Reply-To:     Hari <excel_hari@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Hari <excel_hari@YAHOO.COM>
Organization: http://groups.google.com
Subject:      Re: Proc Transpose in EG - Creates iIlegal variables names
Comments: To: sas-l@uga.edu
In-Reply-To:  <200709100332.l8A1kSiD012949@mailgw.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"

On Sep 10, 8:32 am, nos...@HOWLES.COM ("Howard Schreier <hs AT dc-sug DOT org>") wrote: > On Fri, 7 Sep 2007 23:02:00 -0700, David L Cassell <davidlcass...@MSN.COM> > wrote: > > > > > > >excel_h...@YAHOO.COM wrote back: > >>On Sep 6, 12:28 am, nos...@HOWLES.COM ("Howard Schreier <hs AT dc-sug > >>DOT org>") wrote: > >> > On Wed, 5 Sep 2007 09:04:29 -0700, Hari <excel_h...@YAHOO.COM> wrote: > >> > >Hi, > > >> > >I am doing a Proc transpose within EG. > > >> > >My ID statement has values like "Microsoft Windows". In PC SAS when > >> > >one transposes a data set like this, then the new variable based on > >> > >that ID value would usually substitute illegal characters > >> > >automatically with underscores (and I want this automatic > >> > >substitution) > > >> > >But in EG, the variable name remains as "Microsoft Windows" (note Im > >> > >not talking about the label). Even when I do a proc contents it is > >> > >displaying the name with a space in between. > > >> > >2 clarifications: - > > >> > >a) Suppose one accepts the above and wants to use the above name in > >> > >subsequent code steps of EG, then how does one refer to the above > >> > >variable (I dont want to do VALIDVARNAME=ANY) > > >> > >b) I would rather want EG to behave like PC SAS and automatically > >> > >create variables with appropriate underscore characters during Proc > >> > >Transpose. Is this possible? > > >> > >hp > > >> > Seehttp://support.sas.com/techsup/unotes/SN/016/016867.html > > >> > It deals with a different proc, but the problem and possible solutions > >> > appear to be the same.- Hide quoted text - > > >> > - Show quoted text - > > >>Howard/Data_null), > > >>Thanks for the responses. > > >>I have added a standard option to all my EG projects VALIDVARNAME=V7, > >>so that I dont face this in future. Howard thanks a lot for the tech > >>note link. > > >>Data_null_ - thanks for the tip --> 'any name with blanks'n > > >>hp > > >I recommend that you do it the other way around. Leave EG as is, > >but alter SAS so that your default is VALIDVARNAME=ANY . > > >HTH, > >David > >-- > >David L. Cassell > >mathematical statistician > >Design Pathways > >3115 NW Norwood Pl. > >Corvallis OR 97330 > > I'm going to disagree with David (that doesn't happen often). I think > VALIDVARNAME=ANY is to be avoided. > > First of all VALIDVARNAME=ANY triggers a WARNING which tells you that it is > supported only for Base and Stat procedures. So it is experimental in other > contexts, apparently including the DATA step. > > I suspect that having variable names which do not conform to V7 rules, and > which therefore must be represented with name literals in code, will break a > lot of existing macros. A lot of non-macro code based on generating > variables lists from metadata sources like DICTIONARY.COLUMNS will also > fail. Fixing code could get complicated, because you can't just slap the > quotation marks and the N suffix on a parameter which might already be > packaged that way; the resulting string > > '''My Non-V7-Compliant Var.''n'n > > will yield a variable name which looks like a name literal. Altogether, a > can of worms.- Hide quoted text - > > - Show quoted text -

I agree with you Howard. I do have quite a bit of macro code and even without it writing each variable name with literals takes lot of typing effort. My fingers start huffing and puffing with all the single quotes!!.

Morever if my partners/colleagues see the code, then they will get unneccessarily confused while doing QC etc, while keeping track of quotes.

Morever when I share my data files with other folks in my company (some of those work both on PC/EG while others on only EG) then there will be unneccessary complications.

>triggers a WARNING which tells you that it is > supported only for Base and Stat procedures Thanks for this tip. It is even more the reason for us to not use this.

I have asked my IT to request all users to have this as a standard option in their autoexec.

hp


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