SAS中文论坛

标题: 请教FORMAT有关二个维度报表的输出问题 [打印本页]

作者: shiyiming    时间: 2009-5-22 13:03
标题: 请教FORMAT有关二个维度报表的输出问题
各位大侠,我现在有这样的数据集合:
用户号码、语音arpu(每个月大电话花的钱),短信量
我先在用FORMAT规定格式出一个这样的报表:
            短信量
               1--20  21--50 51--90 91以上
语音 0-10
         10.1-20
         20.1-50
         50.1--100
         100以上

表中的数据为同时满足arpu和短信条件的用户数;
想请教该怎样用FORMAT实现这样的报表输出,谢谢!
作者: shiyiming    时间: 2009-5-22 21:14
标题: Re: 请教FORMAT有关二个维度报表的输出问题
data tbl;
do i=1 to 1000;
text=int(ranuni(1)*100+1);
arpu=round(ranuni(2)*150,0.1);
output;
end;
run;
/*proc print;run;*/
proc format;
value textFmt
1-20='1-20'
21-50='21-50'
51-90='51-90'
91-high='>90'
;
value arpuFmt
0-10='0-10'
10.1-20='10.1-20'
20.1-50='20.1-50'
50.1-100='50.1-100'
100<-high='>100'
;
*ods rtf;
proc freq;
format text textFmt. arpu arpuFmt.;
tables text*arpu/nopercent nocol norow;
run;
*ods rtf close;

*note: this may not be your needed. for your attention: text has to be integer and arpu round to 0.1;
作者: shiyiming    时间: 2009-5-22 22:25
标题: Re: 请教FORMAT有关二个维度报表的输出问题
兄弟,你太帅了啊,这正是我想要的啊,谢谢,万分感谢啊!
作者: shiyiming    时间: 2009-5-22 23:11
标题: Re: 请教FORMAT有关二个维度报表的输出问题
兄弟,麻烦再问一下,为什么将PREQ生成的表格存储在一个表里面后,格式有和OUTPUT里面显示的不一样了呢?
如果要一样该怎么处理啊,谢谢
作者: shiyiming    时间: 2009-5-23 02:10
标题: Re: 请教FORMAT有关二个维度报表的输出问题
can you say it again?

output window (listing) is not the same as ods table. but here i didn't specifize the table name, so lising should be the same as ods table
作者: shiyiming    时间: 2009-5-25 23:26
标题: Re: 请教FORMAT有关二个维度报表的输出问题
首先谢谢兄弟的回复,我是说我想把这个结果存入零时表中,因此应该在Table 后面加上一个表名,但此时打开WORK中的该表时,其形式和OUTPUTZ中的不一样




欢迎光临 SAS中文论坛 (https://mysas.net/forum/) Powered by Discuz! X3.2