Chapter Contents

Previous

Next
The PRINT Procedure

Example 8: Creating a Customized Layout with BY Groups and ID Variables


Procedure features:
BY statement
ID statement
SUM statement
VAR statement
Other features:
SORT procedure
Data set: EMPDATA

This customized report



Program
 Note about code
options nodate pageno=1 linesize=64 pagesize=60;
proc sort data=empdata out=tempemp;
   by jobcode gender;
run;
 Note about code
proc print data=tempemp split='*';
 Note about code
   id jobcode;
   by jobcode;
   var gender salary;
 Note about code
   sum salary;
 Note about code
   label jobcode='Job Code*========'
         gender='Gender*======'
         salary='Annual Salary*=============';

 Note about code
   format salary dollar11.2;
   where jobcode contains 'FA' or jobcode contains 'ME';
   title 'Expenses Incurred for';
   title2 'Salaries for Flight Attendants and Mechanics';
run;


Output
The ID and BY statements work together to produce this layout. The ID variable is listed only once for each BY group. The BY lines are suppressed. Instead, the value of the ID variable, JobCode, identifies each BY group. [HTML Output]
 [Listing Output]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.