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 (August 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, 27 Aug 2002 17:54:44 +0100
Reply-To:     Peter Crawford <peter.crawford@DB.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Peter Crawford <peter.crawford@DB.COM>
Subject:      Re: Proc SQL monotone
Comments: To: david.mcnulty@QUESTINTL.COM
Content-type: text/plain; charset=iso-8859-1

Perhaps you could use, what I think is called, an "in-line" view, like proc sql; create table data2 as select *, monotonic() as row from ( select distinct * from data order by 1 ) ; quit; Because the "distinct" keyword is in the view, you don't need to use "order by" on the output

Datum: 27/08/2002 16:40 An: SAS-L@LISTSERV.UGA.EDU

Antwort an: david.mcnulty@QUESTINTL.COM

Betreff: Re: Proc SQL monotone Nachrichtentext:

Hi Folks,

Thanks for the help. I was hoping monotonic() could be used to index the final sorted output as in the following.

data data; input alpha $ @@; cards; w f h a v a d v d a d d s a f g h g f h d t f d h t r h y t s f g t r e w t r y t e t y e t y t e r l q w y o ;run;

proc sql; create table data as select distinct * from data order by 1;

create table data as select *, monotonic() as row from data; quit;

Unless one of those mysterious parameters Kevin mentions produces the final table as above using a compact syntax such as:

select distinct *, monotonic(parameter= ) as row from data order by 1;

I'll stick with a DATA step after exiting PROC SQL.

Once again thanks for the help.


P.S. I know I can get the same result using NODUP in PROC SORT followed by a DATA step but I didn't want to exit SQL and go straight back into it.

IMPORTANT NOTICE: This email is confidential, may be legally privileged, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone else is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender.


Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

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