Date: Tue, 29 Nov 2011 10:14:45 -0600
Reply-To: Yu Zhang <zhangyu05@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Yu Zhang <zhangyu05@GMAIL.COM>
Subject: Re: change order in output, proc tabulate, multilabel format
In-Reply-To: <CAM+YpE-4Q07vBrm3H9vkX1W0RctrX9uW67ZzcKGkqLSLQo4n4w@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
In addition to 2 options Joe's mentioned, you have to use 1 more to get
what you want.
proc format;
value tempfmt (multilabel notsorted)
1='One'
2='Two'
1='Odd'
2='Even';
run;
data new;
input num value;
cards;
1 100
2 200
1 100
;
proc tabulate data=new;
attrib num format=tempfmt.;
class num/mlf order=data preloadfmt;
var value;
table num,value;
run;
On Tue, Nov 29, 2011 at 10:04 AM, Joe Matise <snoopy369@gmail.com> wrote:
> Look up the 'NOTSORTED' option for PROC FORMAT, and ORDER=DATA option
> for the class statement.
>
> -Joe
>
> On Tue, Nov 29, 2011 at 10:03 AM, bbser 2009 <bbser2009@gmail.com> wrote:
> > Greetings!
> >
> > After running the code below, I got the output where the order of values
> of
> > num is like: Even, Odd, One, Two, from top to bottom.
> > I was wondering if there is a way to change this order to: One, Two, Odd,
> > Even, from top to bottom? Thanks a lot.
> >
> > Regards, Max
> > (Maaxx)
> >
> > proc format;
> > value tempfmt (multilabel)
> > 1='One'
> > 2='Two'
> > 1='Odd'
> > 2='Even';
> > run;
> >
> > data new;
> > input num value;
> > cards;
> > 1 100
> > 2 200
> > 1 100
> > ;
> >
> > proc tabulate data=new;
> > attrib num format=tempfmt.;
> > class num/mlf;
> > var value;
> > table num,value;
> > run;
> >
>
|