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>
Subject: Re: Proc Transpose in EG - Creates iIlegal variables names
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>
> >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 -
> >>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
> >I recommend that you do it the other way around. Leave EG as is,
> >but alter SAS so that your default is VALIDVARNAME=ANY .
> >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
Morever if my partners/colleagues see the code, then they will get
unneccessarily confused while doing QC etc, while keeping track of
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
I have asked my IT to request all users to have this as a standard
option in their autoexec.