/* 定义格式 */
proc format;
picture my_SALARY low-high='000,000.00'(prefix='$');
value $my_SEX 'F' = 'Female' 'M' = 'Male';
run;
/* 创建统计汇总表 */
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.);
/* 标签 */
label
SEX = 'Gender'
JOBCODE = 'Job Codes'
SALARY = 'Annual Salary';
/* 标题和脚注 */
title 'Average Salary';
footnote 'BY Jobcode And Gender';
options nocenter date;
/* 应用格式 */
format SEX $my_SEX.;
run;