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 (December 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 24 Dec 2008 12:53:29 -0500
Reply-To:   "Howard Schreier <hs AT dc-sug DOT org>" <schreier.junk.mail@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Howard Schreier <hs AT dc-sug DOT org>" <schreier.junk.mail@GMAIL.COM>
Subject:   Re: How to ReOrder Months in the report

I was thinking along the same lines. I think I would use

month = input(catt(mon, 4321), monyy7.);

On Wed, 24 Dec 2008 12:28:09 -0500, Chang Chung <chang_y_chung@HOTMAIL.COM> wrote:

>On Wed, 24 Dec 2008 10:42:00 -0500, Abc Unha <abcunha@YAHOO.COM> wrote: > >>I have a variable that contains three letter of month name. >>When I create a report by that month variable it does not display months >>in proper order. means Proc Tabulate display months in alphabetical order >>(Apr, Aug etc.) >>Is there anyway good ways to put month in Jan,Feb, Mar etc Order? > >hi, >here is one way. hth. >cheers, >chang > >/* test data */ >data one; > input mon $ v1 @@; >cards; >Apr 41 Apr 42 May 51 Jun 61 Aug 81 >; >run; > >/* create a view to map the char mon to > a date var month */ >proc datasets; > delete oneview; >run; >quit; >data oneview/view=oneview; > set one; > month = input(catt("01",mon,"2008"), anydtdte.); > format month monname3.; >run; > >/* tabulate using the view */ >proc tabulate data=oneview formchar="|-+++++++++"; > class month; > var v1; > table month, v1*mean; >run; >/* on lst >+----------------------+------------+ >| | v1 | >| +------------+ >| | Mean | >+----------------------+------------+ >|month | | >+----------------------+ | >|Apr | 41.50| >+----------------------+------------+ >|May | 51.00| >+----------------------+------------+ >|Jun | 61.00| >+----------------------+------------+ >|Aug | 81.00| >+----------------------+------------+ >*/


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