Date: Mon, 19 Jul 2004 10:59:57 -0400
Reply-To: Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Subject: Re: Help: display order
ORDER=FORMATTED is not applicable because RANGE does not have a format
associated with it. The fact that is derived indirectly from the formatted
value of another variable means nothing.
I think ORDER=DATA should work in this case.
For explicit control, look into the CLASSDATA= option. You can build the
necessary dataset either from the original data or from your format library
(using PROC FORMAT's CNTLOUT= option).
On Fri, 16 Jul 2004 13:24:33 -0700, Cathy <cathydwu@YAHOO.COM> wrote:
>Thank you in advance for your help.
>I have serveral variables, and I use format to group them to get freq
>and save the freq/percent into a file.
>Later, I want to create report/plot and I have the problem to properly
>display them. I wish the display order is the same as defined in the
>format. I have tried to use 'order = formatted' or 'order=data' in
>'proc tabulate'. Sometimes it displays in order, sometimes not.
>The following is the simplified program.
>input score group $;
>value score . = 'missing'
> low - 0 = '<= 0'
> 0 <- 10 = '0-10'
> 10 <- 20 = '10-20'
> 20 <- 30 = '20-30'
> 30 <- 40 = '30-40'
> 40 - high = '> 40';
>ods output OneWayFreqs(match_all=datasetnames)=freqout;
>ods listing close;
>proc freq data = a;
>table score/ missing;
>format score score.;
>ods output close;
>length range $20;
>range = left(F_score);
>proc tabulate data = b missing order=formatted;
>table range, percent ;