/* 定義格式 */
proc format;
picture my_SALARY low-high='000,000.00'(prefix='$');
value $my_SEX 'F' = 'Female' 'M' = 'Male';
run;
/* 創(chuàng)建統(tǒng)計(jì)匯總表 */
proc tabulate data=dir.fltaten;
class SEX JOBCODE; /* 分類變量 */
var SALARY; /* 要分析的變量 */
/* 表格布局 */
table
SEX='Gender',
JOBCODE='Job Codes'*(SALARY*mean='Average'*format=my_SALARY.)
all='Overall'* (SALARY*mean='Average'*format=my_SALARY.);
/* 標(biāo)簽 */
label
SEX = 'Gender'
JOBCODE = 'Job Codes'
SALARY = 'Annual Salary';
/* 標(biāo)題和腳注 */
title 'Average Salary';
footnote 'BY Jobcode And Gender';
options nocenter date;
/* 應(yīng)用格式 */
format SEX $my_SEX.;
run;
|