The SAS Output Delivery System and reporting techniques

Help with output, please.

Reply
Contributor
Posts: 33

Help with output, please.

Hi. I know there has to be a way to do this, but I haven't done a lot of output beyond basic freqs or proc-prints. Here's what my data looks like:

County Year E P %
01-A 1989 1225 4317 28.376
01-A 1990 383 3812 10.047
01-A 1991 386 3537 10.913
01-A 1992 414 3510 11.795
01-A 1993 438 3653 11.99
01-A 1994 458 3851 11.893
02-B 1989 85 220 38.636
02-B 1990 93 252 36.905
02-B 1991 92 312 29.487
02-B 1992 84 278 30.216
02-B 1993 122 189 64.55
02-B 1994 81 174 46.552

And here is how I need it to output:

County Year
1989 1990 1991 etc.
E P % E P % E P % etc.
01A 1225 4317 28 383 3812 10 386 3537 10 etc.
02B 85 220 38 93 252 36 92 312 29 etc.

How can I do it? Or am I stuck with manipulating it greatly in Excel?

Thanks so much.

Sign me ~ novice outputter
SAS Super FREQ
Posts: 8,868

Re: Help with output, please.

Posted in reply to stateworker
Hi:
If your data were called WORK.YRDATA and your variables were actually named:
COUNTY, YEAR, E, P and PCTVAL (since % is an invalid variable name)

then you could generate the desired report with PROC REPORT. (I put an RBREAK statement, but if you don't want report totals, then you can simply delete that statement.

cynthia

[pre]
ods html file='c:\temp\across_examp.html' style=sasweb;

proc report data=yrdata nowd;
column county year,(e p pctval);
define county / group 'County';
define year / across 'Year';
define e / 'E';
define p / 'P';
define pctval / '%' f=3.0;
rbreak after / summarize;
run;
ods html close;
[/pre]
Contributor
Posts: 33

Re: Help with output, please.

Posted in reply to Cynthia_sas
Cynthia -

Thanks so much! It worked beautifully.
Contributor
Posts: 33

Re: Help with output, please.

Posted in reply to stateworker
So I just have to say that I had to do this again and it was great to come back here to refresh!
Ask a Question
Discussion stats
  • 3 replies
  • 145 views
  • 0 likes
  • 2 in conversation