|
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|
>+----------------------+------------+
>*/
|