DATA Step, Macro, Functions and more

how to report the total sum of each emp

Reply
N/A
Posts: 0

how to report the total sum of each emp

I want to report the total sale of each emp in summarized format in base SAS only without using SQL.

data is like that
data emp;
input eid $ job $ sale;
cards;
E101 CLERK 2000
E102 SALES 3000
E103 CLERK 4000
E102 SALES 2003
E103 CLERK 3009
E103 CLERK 4008
E102 SALES 2007
E102 SALES 3006
E101 CLERK 4005
;
output should be like this (total sum of sale)
E101 CLERK 6005
E102 SALES 10016
E103 CLERK 11017
Super Contributor
Super Contributor
Posts: 3,174

Re: how to report the total sum of each emp

Look at either PROC REPORT or consider using PROC SUMMARY along with PROC PRINT, or PROC MEANS. The SAS support website http://support.sas.com/ has much to offer, with SAS-hosted documentation and also technical / conference reference material - suggest using the SEARCH facility there or use a Google advanced search, possibly, by coding the parameter "site:sas.com" to limit your search.

Scott Barry
SBBWorks, Inc.
N/A
Posts: 0

Re:

Sorry for my wrong way of asking the question.
sir, is it possible that the same dataset (emp) should contain the total sale of every emp like the below output.
E101 CLERK 6005
E102 SALES 10016
E103 CLERK 11017
Super Contributor
Super Contributor
Posts: 3,174

Re: how to report the total sum of each emp

Based on the "output data" demonstrated, the SAS PROC SUMMARY can create a new file (or replace the existing file, as preferred) using the CLASS, VAR and OUTPUT statements.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:
proc summary site:sas.com
N/A
Posts: 0

Re: how to report the total sum of each emp

Thanks sir. Its working
Ask a Question
Discussion stats
  • 4 replies
  • 136 views
  • 0 likes
  • 2 in conversation