Sample 25310: TABULATE Procedure, Chapter 37
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: BPG37R01 */
/* TITLE: TABULATE Procedure, Chapter 37 */
/* PRODUCT: SAS */
/* SYSTEM: ALL */
/* KEYS: EXAMPLES FROM DOCUMENTATION, CROSSTAB, TABULAR */
/* PROCS: TABULATE */
/* DATA: */
/* */
/* SUPPORT: UPDATE: */
/* REF: SAS Procedures Guide, CHAPTER 37 */
/* MISC: */
/* */
/****************************************************************/
options ls=132;
data timerec;
input employee $ week $ phase $ hours;
cards;
Chen 11SEP89 Analysis 8
Chen 11SEP89 Analysis 7
Chen 11SEP89 Coding 2.5
Chen 11SEP89 Testing 8
Chen 11SEP89 Coding 8.5
Chen 11SEP89 Testing 6
Chen 11SEP89 Coding 4
Stewart 11SEP89 Coding 8
Stewart 11SEP89 Testing 4.5
Stewart 11SEP89 Coding 4.5
Stewart 11SEP89 Coding 10.5
Stewart 11SEP89 Testing 10
;
run;
proc tabulate data=timerec format=8.1;
class employee week phase;
var hours;
table week, employee all, sum*hours=' '*(phase all);
table week, employee all, pctsum*hours=' '*(phase all);
keylabel sum='Total Hours'
pctsum='Percentage of Hours';
title 'Summary of Project Hours';
run;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Summary of Project Hours
WEEK 11SEP89
---------------------------------------------------------------------
| | Total Hours |
| |-----------------------------------|
| | PHASE | |
| |--------------------------| |
| |Analysis| Coding |Testing | ALL |
|-------------------------------+--------+--------+--------+--------|
|EMPLOYEE | | | | |
|-------------------------------| | | | |
|Chen | 15.0| 15.0| 14.0| 44.0|
|-------------------------------+--------+--------+--------+--------|
|Stewart | .| 23.0| 14.5| 37.5|
|-------------------------------+--------+--------+--------+--------|
|ALL | 15.0| 38.0| 28.5| 81.5|
---------------------------------------------------------------------
Summary of Project Hours
WEEK 11SEP89
---------------------------------------------------------------------
| | Percentage of Hours |
| |-----------------------------------|
| | PHASE | |
| |--------------------------| |
| |Analysis| Coding |Testing | ALL |
|-------------------------------+--------+--------+--------+--------|
|EMPLOYEE | | | | |
|-------------------------------| | | | |
|Chen | 18.4| 18.4| 17.2| 54.0|
|-------------------------------+--------+--------+--------+--------|
|Stewart | .| 28.2| 17.8| 46.0|
|-------------------------------+--------+--------+--------+--------|
|ALL | 18.4| 46.6| 35.0| 100.0|
---------------------------------------------------------------------
These samples are from the "SAS Procedures Guide, Version 6", Chapter 37.
For additional information on the samples refer to this book.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> TABULATE
|
| Date Modified: | 2005-06-18 03:00:01 |
| Date Created: | 2005-05-23 13:45:07 |
Operating System and Release Information
| SAS System | Base SAS | All | n/a | n/a |