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 (January 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 4 Jan 2005 14:35:02 -0500
Reply-To:     "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject:      Re: proc sql, variables with numeric postfix names

Preferable and more likely, I think, is some special notation which would bind immediately to the otherwise ambiguous specification. Years ago the same problem arose with the summary functions; compare

x1 = sum( a1-a7);

with

x2 = sum(of a1-a7);

However, the value of this enhancement is limited. While it would allow such column groups to be brought into a query, there still would be no mechanism for testing or transforming values in parallel. That is, there would still be no DO loop.

People who wish to use SQL effectively would still be advised to normalize their data.

On Mon, 3 Jan 2005 12:34:56 -0800, Pardee, Roy <pardee.r@GHC.ORG> wrote:

>Or maybe as an option on the proc sql statement--like: > >Proc sql sasvarlist = on ; > /* This selects seven columns, a1 through a7. */ > select a1-a7 > from mytable ; > > reset sasvarlist = off ; > > /* This selects a single column containing the value in a7 subtracted >from the value in a1. */ > select a1-a7 > from mytable ; > >Quit ; > >-----Original Message----- >From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of >Jack Hamilton >Sent: Monday, January 03, 2005 12:22 PM >To: SAS-L@LISTSERV.UGA.EDU >Subject: Re: proc sql, variables with numeric postfix names > > >I understand why this is wanted, but it requires a major incompatibility >with standard SQL, insofar as there's such a thing as "standard" SQL. > >I'd prefer an institute-supplied macro to do the equivalent, something >like > > %varnames(data=x.y, range=a1-a12) > >or > > %varnames(data=x.y, range=b1--z99) > >That would make it more obvious that something non-standard is being >done. > > > > >-- >JackHamilton@FirstHealth.com >Manager, Technical Development >Metrics Department, First Health >West Sacramento, California USA > >Coelum, non animum mutant, qui trans mare currunt. > > >>>> "Mike Rhoads" <RHOADSM1@WESTAT.COM> 01/03/2005 11:11 AM >>> >Nina, > >Glad you got your question answered! > >Anyone reading this who has not yet voted on this year's SASware Ballot >(deadline is January 7) may want to consider supporting item #64: >"provide syntax to PROC SQL for variable lists, specifically in the >SELECT clause". > >Mike Rhoads >Westat >RhoadsM1@Westat.com > >-----Original Message----- >From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of >Nina Harris >Sent: Monday, January 03, 2005 10:59 AM >To: SAS-L@LISTSERV.UGA.EDU >Subject: proc sql, variables with numeric postfix names > > >how do I select all the variables that are named like m0, m1, m2 ... m99 >? > >have tried ...select x.m0-x.m99 from x.mytable1 > >that does not work > > >"MMS <firsthealth.com>" made the following annotations. >------------------------------------------------------------------------ >------ >This message, including any attachments, is intended solely for the use >of the named recipient(s) and may contain confidential and/or privileged >information. Any unauthorized review, use, disclosure or distribution >of this communication(s) is expressly prohibited. If you are not the >intended recipient, please contact the sender by reply e-mail and >destroy any and all copies of the original message. Thank you. > ======================================================================= >======


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