BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am a SAS beginner.
I have a SAS data table with columns:

Identity (X?....?)
Gender (1,2)
Class (1,2)
Mark (1,2,3,4,5)

Variable Mark is numeric, the remaining of character type.

I want to create a summary report with PROC REPORT.

On the first line I would like to have the table total numbers for men(1), women(2) and total.
On the third line Class 1 numbers.
On lines 4-8 the number of individuals in Class 1 with different marks.

On lines 10-15 Class 2 in the same way as Class 1.


If I could get some help I would be most grateful.
Best regards
Anne
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
I don't understand what you mean by "class 1 numbers on third line" the rest of the description is clear.

cynthia
deleted_user
Not applicable
Cynthia,

I meant the sum of individuals (the number of individuals) in Class 1.

Bad english by me. Where I come from we talk rotvälska all the time.

Anne
prholland
Fluorite | Level 6
Anne,

Is this what you are looking for?

PROC REPORT DATA=table NOWD;
COLUMNS class identity mark gender,(N) overall;
DEFINE class / GROUP;
DEFINE identity / GROUP;
DEFINE mark / GROUP;
DEFINE gender / ACROSS;
DEFINE overall / COMPUTED;
COMPUTE overall;
overall = SUM(_c5_, _c6_);
ENDCOMP;
BREAK BEFORE class / SUMMARIZE;
RBREAK BEFORE / SUMMARIZE;
RUN;

...............Phil
deleted_user
Not applicable
Thank you very much, Phil.

Your example seems useful. I am working on it.

Anne

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 767 views
  • 0 likes
  • 3 in conversation