Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie needs help writing Report "Maybe Proc Freq"

Status
Not open for further replies.

ecugrad

MIS
Apr 17, 2001
191
US
I've been asked to run some reports and I'm having some difficulties.

Looking at the code below, we surveyed 1200 people from 32 different regions. The surveyed consisted of 24 questions. The responses ranged from 1-5 with 5 = Excellent. My managers wants a breakdown by region for each question. ie: What percentage of people from that region scored us a 1,2 and so on. The kicker is that he wants to know this breakdown by how often they contact us Weekly, monthy, daily, etc.. I have this info in a AdminContact field. So I'm really looking at each region and in each region looking at the percentage of people and then looking at how often they contact us and averaging the score for that contact period.

The below code works but for 24 questions and 32 regions I'm recieving 768 pages of statistics. Is their an easier way to do this. Or can I format it some how to lower my page count. I'm stuck and confused, any help would be appreciated...

I'm utilizing SAS 8.0

Proc Sort Data = SCO Out=SCO1;
by AdminContact Region ;

proc Freq data=work.SCO1;



proc Freq data=work.SCO1;

Tables AdminContact * RSS;
by Region;
Title 'Overall satisfaction with Regional Support Staff';
Run;

proc Freq data=work.SCO1;

Tables AdminContact * a1;
by Region;
Title 'Knowledge of loan policy and procedures';
Run;

I'm writing the above 24 times for each question

Thanks,

Mike
 
Hi Mike.
OK, I think what you need to do here is some pre-processing of the data prior to writing your report in order to get ready for it.
First stage in this sort of thing is to make a mock up of the report and how you want it to look, this will give you and idea of how you want to tabulate your data, and starts to give you a clue as to what you are going to code. What you are looking at here is a 4 dimensional report (Score, Region, Question, Frequency of contact), so this is probably going to be the biggest challenge. For my part, when I get this sort of assignment, the first thing I do is go back to the requestor and ask them to create the mock up, as they should have an idea in their head how the end result should look. If they don't then give them a small sample of the data and sit with them to thrash out how the results should be laid out in a 2 dimensional form.
I would say that will be your first challenge.
Once you've got that, it'll make the rest easier. I would say that PROC TABULATE will be your weapon of choice here.
Check out the SAS documentation site for a full rundown on the procedure, which should also contain some examples to help you on your way. Also, if you have other SAS developers in your area, see if any of them have the course notes for "SAS Report Writing: A Programming Approach" which has a number of very useful examples. Also see if you can get yourself sent on it, it's an valuable course.

If you still need help, post back an example of how your data is laid out, and how you want to lay out the output and I'll see what I can do for you.
 
No worries. Using Proc Tabulate you should be able to do all the cross tabulation in just 1 step.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top