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 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 4 Sep 2007 10:19:43 -0400
Reply-To:   "Sridhar, Nagakumar" <nagakumar.sridhar@SPCORP.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Sridhar, Nagakumar" <nagakumar.sridhar@SPCORP.COM>
Subject:   Re: Reg: Sort in Proc Report
Comments:   To: deva narsimha <nar_deva@YAHOO.COM>
In-Reply-To:   A<887512.24728.qm@web50601.mail.re2.yahoo.com>
Content-Type:   text/plain; charset="us-ascii"

Deva: Try this:

data temp; format date1 date2 date3 mmddyy10.; input @1 date1 mmddyy10. @12 date2 mmddyy10. @24 date3 mmddyy10. @34 no 2. @37 no1 2. @40 CUSTNO ; datalines; 09/05/2006 01/23/2006 03/15/2001 23 33 25429928 09/05/2006 01/23/2006 04/21/2003 23 33 25429928 09/05/2007 01/23/2006 01/01/2002 23 33 25429928 09/04/2007 01/23/2006 01/01/2002 23 33 25429928 11/21/2006 12/02/2006 01/02/2000 24 90 25429929 11/21/2006 12/02/2006 01/02/2001 24 90 25429929 11/21/2006 12/02/2006 01/02/1999 24 90 25429929 ; run; proc sort data=temp out=temp1; by custno descending date1 no descending date2 no1 descending date3; run; proc report data=temp1 nowd; column CUSTNO date1 no date2 no1 date3 ; define date1 / order order=internal descending format= date9.; define date2 / order order=internal descending format= date9.; define date3 / order order=internal descending format= date9.; run;

HTH

Kumar

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of deva narsimha Sent: Tuesday, September 04, 2007 10:11 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Reg: Sort in Proc Report

Hi All, I want to get the result with group of date fields with descending sort order. When i ran the below code, it is sorting as descending, but when i print the report through proc report procedure,sort variables are not displaying as descending in the report.

Please have a look into the below code and give me the right solution. I need to do group by with date fields only with descending order.

data temp; format date1 date2 date3 mmddyy10.; input @1 date1 mmddyy10. @12 date2 mmddyy10. @24 date3 mmddyy10. @34 no 2. @37 no1 2. @40 CUSTNO ; datalines; 09/05/2006 01/23/2006 03/15/2001 23 33 25429928 09/05/2006 01/23/2006 04/21/2003 23 33 25429928 09/05/2007 01/23/2006 01/01/2002 23 33 25429928 09/04/2007 01/23/2006 01/01/2002 23 33 25429928 11/21/2006 12/02/2006 01/02/2000 24 90 25429929 11/21/2006 12/02/2006 01/02/2001 24 90 25429929 11/21/2006 12/02/2006 01/02/1999 24 90 25429929 ; run; proc sort data=temp out=temp1; by custno descending date1 no descending date2 no1 descending date3; run; proc report data=temp1 nowd; column CUSTNO date1 no date2 no1 date3 ; define date1 / group descending format= date9.; define date2 / group descending format= date9.; define date3 / group descending format= date9.; run;

Thanks, Deva

________________________________________________________________________ ____________ Need a vacation? Get great deals to amazing places on Yahoo! Travel. http://travel.yahoo.com/ ********************************************************************* This message and any attachments are solely for the intended recipient. If you are not the intended recipient, disclosure, copying, use or distribution of the information included in this message is prohibited -- Please immediately and permanently delete.


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