The PRINT Procedure |
Procedure features: |
| ||||
Other features: |
| ||||
Data set: | EMPDATA |
This customized report
selects variables to include in the report and the order in which they appear
selects observations to include in the report
groups the selected observations by JobCode
sums the salaries for each job code and for all job codes
displays numeric data with commas and dollar signs.
Program: Creating a Listing Report |
options nodate pageno=1 linesize=64 pagesize=60; proc sort data=empdata out=tempemp; by jobcode gender; run; |
proc print data=tempemp split='*'; |
id jobcode; by jobcode; var gender salary; |
sum salary; |
label jobcode='Job Code*========' gender='Gender*======' salary='Annual Salary*============='; |
format salary dollar11.2; where jobcode contains 'FA' or jobcode contains 'ME'; title 'Salay Expenses'; run; |
Output: Listing |
Creating a Customized Layout with BY Groups and ID Variables: Listing Output
Program: Creating an HTML Report |
options nodate pageno=1 linesize=64 pagesize=60 obs=15; proc sort data=empdata out=tempemp; by jobcode gender; run;
ods html file='your_file.html'; |
proc print data=tempemp (obs=10) split='*';
id jobcode; by jobcode; var gender salary;
sum salary;
label jobcode='Job Code*========' gender='Gender*======' salary='Annual Salary*=============';
format salary dollar11.2; where jobcode contains 'FA' or jobcode contains 'ME'; title 'Salary Expenses'; run;
ods html close; |
Output: HTML |
Creating a Customized Layout with BY Groups and ID Variables: Default HTML Output
Program: Creating an HTML Report with the STYLE Option |
options nodate pageno=1 linesize=64 pagesize=60 obs=15; proc sort data=empdata out=tempemp; by jobcode gender; run;
ods html file='your_file.html';
proc print data=tempemp (obs=10) split='*' style(HEADER) = {fontstyle=italic} style(DATA) = {backgrouncolor=blue foreground = white}; |
id jobcode; by jobcode; var gender salary;
sum salary / style(total)= [color=red]; |
label jobcode='Job Code*========' gender='Gender*======' salary='Annual Salary*=============';
format salary dollar11.2; where jobcode contains 'FA' or jobcode contains 'ME'; title 'Expenses Incurred for'; title2 'Salaries for Flight Attendants and Mechanics'; run;
ods html close;
Output: HTML with Styles |
Creating a Customized Layout with BY Groups and ID Variables: HTML Output Using Styles
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.