Help using Base SAS procedures

proc means help

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 19
Accepted Solution

proc means help

I am using enterprise guide 9.3.  I have a dataset that has mutiple rows for a customer.  I want to look at how many contacts a customer has a well as payments over the course of a month.

 

I am using a proc means to summarize the data.

 

proc means data = gregory n;

class primekey agency employeecode;

var count;

where blank is eq to "contacts";

output out = contacts n;

RUN;

 

proc means data = gregory n;

class primekey agency employeecode;

var count;

where blank is eq to "promise";

output out = promises n;

RUN;

 

What I want to do is merge the two output datasets by primekey to have a result:

primekey      # contacts       #promises  agency employeecode   etc.

abc                10                   3

 

The problem I am having is that I get _type_ and _freq_ variables, which I can drop using (drop= _type_  _freq_),

however I get summaries for multiple _types_.  I only want to keep the one where all the variables are listed out.   


Accepted Solutions
Solution
‎07-20-2016 11:35 AM
Super User
Posts: 5,497

Re: proc means help

Add this option to the PROC MEANS statement:  NWAY

View solution in original post


All Replies
Solution
‎07-20-2016 11:35 AM
Super User
Posts: 5,497

Re: proc means help

Add this option to the PROC MEANS statement:  NWAY

Occasional Contributor
Posts: 19

Re: proc means help

Posted in reply to Astounding

Thanks for the assistance!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 326 views
  • 3 likes
  • 2 in conversation