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 (October 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 14 Oct 2005 11:25:02 -0400
Reply-To:   Sigurd Hermansen <HERMANS1@WESTAT.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Sigurd Hermansen <HERMANS1@WESTAT.COM>
Subject:   Re: Proc SQL: Minimise the code using S1-S10
Comments:   To: "adel F." <adel_tangi@yahoo.fr>
Content-Type:   text/plain; charset="iso-8859-1"

Adel: SAS SQL does not expand ranges of column variable names. You will find a number of postings in the outstanding SAS-L Archives on how to use metadata to expand and subset column variable names.

Standard practice in database programming calls for labels in data as opposed to long lists of column variable labels. Repeating columns do not fit well into relational database designs. Sig

-----Original Message----- From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of adel F. Sent: Friday, October 14, 2005 10:33 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Proc SQL: Minimise the code using S1-S10

Hi;

Instead of writing

/*--------------------*/

proc sql;

create table Newdata as select distinct

data1.Region,M1,M2,M3,M4,M5,M6,M7,M8,M9,M10, F1,F2,F3,F4,F5,F6,F7,F8,F9,F10

from Mylib.data1, Mylib.data2

where data1.Region = data2.Region;

quit;

/*------I tried-------------*/

proc sql;

create table Newdata as select distinct

data1.Region,M1-M10,F1-F10

from Mylib.data1, Mylib.data2

where data1.Region = data2.Region;

quit;

but I got only 3 columns

It seems that SAS understand that I am asking for a difference.

How I can write this?

Thanks for any comments

Adel

--------------------------------- Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez le ici !


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