1个回答
展开全部
希望能帮到你。
/**先将数据集读入sas**/
data idd_reve;
input account $ revenue $ @@;
datalines;
012 $8 011 $12 005 $25 014 $54 013 $63 004 $70
015 $100 002 $120 007 $170 017 $200 010 $210
006 $299 003 $300 018 $300 008 $340 001 $501
016 $800 009 $801
;
run;
/**将revenue转化为数值型,并重新命名为revenue1**/
data idd_reve1;
set idd_reve;
revenue1=input(revenue,dollar8.);
format revenue1 dollar8.;
run;
/**设计revenue1的显示格式**/
/* format for ATTR0001 */
proc format;
value reveg
500 <- high='>$500'
300 <-500 ='>$300 -$500 '
100 <-300 ='>$100-$300 '
50 <-100 ='>$50-$100 '
10 <-50 ='>$10-$50'
0 <-10 ='>$0-$10'
;run;
/**输出想要的结果**/
proc tabulate data=idd_reve1 ;
format revenue1 reveg.;
class revenue1;
table (revenue1 all),n="Number of account";
label revenue1="Revenue Group" ;
keylabel all="Total";
run;
/**先将数据集读入sas**/
data idd_reve;
input account $ revenue $ @@;
datalines;
012 $8 011 $12 005 $25 014 $54 013 $63 004 $70
015 $100 002 $120 007 $170 017 $200 010 $210
006 $299 003 $300 018 $300 008 $340 001 $501
016 $800 009 $801
;
run;
/**将revenue转化为数值型,并重新命名为revenue1**/
data idd_reve1;
set idd_reve;
revenue1=input(revenue,dollar8.);
format revenue1 dollar8.;
run;
/**设计revenue1的显示格式**/
/* format for ATTR0001 */
proc format;
value reveg
500 <- high='>$500'
300 <-500 ='>$300 -$500 '
100 <-300 ='>$100-$300 '
50 <-100 ='>$50-$100 '
10 <-50 ='>$10-$50'
0 <-10 ='>$0-$10'
;run;
/**输出想要的结果**/
proc tabulate data=idd_reve1 ;
format revenue1 reveg.;
class revenue1;
table (revenue1 all),n="Number of account";
label revenue1="Revenue Group" ;
keylabel all="Total";
run;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询