LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (December 1999, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 28 Dec 1999 08:59:13 -0500
Reply-To:     Y.Huang@ORGANONINC.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Ya Huang <Y.Huang@ORGANONINC.COM>
Subject:      Re: PROC TABULATE
Comments: To: sas_greenhorn@MY-DEJA.COM
Content-type: text/plain; charset="iso-8859-1"

I hope this is OK for you:

options ls=80; DATA TIMEREC; INPUT EMPLOYEE $ WEEK $ PHASE $ HOURS; CARDS; EMP1 12DEC99 ANALYSIS 8 EMP1 12DEC99 ANALYSIS 7 EMP1 12DEC99 CODING 2.5 EMP2 12DEC99 TESTING 7 EMP2 12DEC99 CODING 8 ; RUN;

* count distinct # of employee and put it into macro var nemp;

proc sql noprint; select count(distinct employee) into : nemp from timerec group by week ;

PROC TABULATE DATA=TIMEREC FORMAT=8.1; CLASS EMPLOYEE WEEK PHASE; VAR HOURS; TABLE WEEK, EMPLOYEE ALL, SUM*HOURS=' '*(PHASE ALL); KEYLABEL SUM='TOTAL HOURS'; label employee="EMPLOYEE (N=%cmpres(&nemp))"; /** use the macro here to show the N **/ TITLE 'SUMMARY OF PROJECT HOURS'; RUN;

=========== 1 SUMMARY OF PROJECT HOURS 1 08:50 Tuesday, December 28, 1999

WEEK 12DEC99 -------------------------------------------------------- | | TOTAL HOURS | | |-----------------------------------| | | PHASE | | | |--------------------------| | | |ANALYSIS| CODING |TESTING | ALL | |------------------+--------+--------+--------+--------| |EMPLOYEE (N=2) | | | | | |------------------| | | | | |EMP1 | 15.0| 2.5| .| 17.5| |------------------+--------+--------+--------+--------| |EMP2 | .| 8.0| 7.0| 15.0| |------------------+--------+--------+--------+--------| |ALL | 15.0| 10.5| 7.0| 32.5| --------------------------------------------------------

Happy new year.

Ya Huang Organon Inc.

> -----Original Message----- > From: sas_greenhorn@MY-DEJA.COM [mailto:sas_greenhorn@MY-DEJA.COM] > Sent: Monday, December 27, 1999 6:31 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: PROC TABULATE > > > Is there a way for me to list the number of rows displayed by PROC > TABULATE excluding the last row that displays the total of > each column. > For example, > > DATA TIMEREC; > INPUT EMPLOYEE $ WEEK $ PHASE $ HOURS; > CARDS; > EMP1 12DEC99 ANALYSIS 8 > EMP1 12DEC99 ANALYSIS 7 > EMP1 12DEC99 CODING 2.5 > EMP2 12DEC99 TESTING 7 > EMP2 12DEC99 CODING 8 > ; > RUN; > PROC TABULATE DATA=TIMEREC FORMAT=8.1; > CLASS EMPLOYEE WEEK PHASE; > VAR HOURS; > TABLE WEEK, EMPLOYEE ALL, SUM*HOURS=' '*(PHASE ALL); > KEYLABEL SUM='TOTAL HOURS'; > TITLE 'SUMMARY OF PROJECT HOURS'; > RUN; > > From the codes above, what should I add or change in PROC TABULATE to > show that there are 2 employees (EMP1, and EMP2)? > > > Sent via Deja.com http://www.deja.com/ > Before you buy. >


Back to: Top of message | Previous page | Main SAS-L page