BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi All,

I am trying to create a summary report in Mainframes to get the percentage, i have used the "pctn" statistical keyword, but instead of giving "Row Percentage" its giving "Column Percentage". I tried rowpctn as well but its not giving any percentage at all.

Here is the data structure

District Name - Group
School Name - Group
School Code - Group
Grade - Group
Demo Info - Group (Male, female, etc...)
Performance Level - Across (% and count).

There can be 4 different performace level and I am trying to report the percentage of different performance levels for male, female... When I run my report, instead of getting percentage distribution rolled up to 100% @ row level, I am getting percentage distribution rolled up to 100% @ Column level. Here is my code

PROC REPORT DATA=DISAGS NOWD
HEADLINE HEADSKIP;

TITLE1 'School Report';
TITLE2 ' Spring 2008';

COLUMN SCHLCODE DIST SCHOOL DEMOVAR GRADE
PLVL ,(n pctn) ;

DEFINE DIST / GROUP NOPRINT;
DEFINE SCHOOL / GROUP NOPRINT;
DEFINE SCHLCODE/ GROUP NOPRINT;
DEFINE GRADE / GROUP NOPRINT;
DEFINE DEMOVAR / ORDER;
DEFINE DEMOVAR / GROUP;
DEFINE DEMOVAR / '% of Student Results' format = $char22.;
DEFINE PLVL / ACROSS Performance Level';
DEFINE PCTN / '% ' format=percent7.2;

WHERE RGRADE = '11' AND RSUPCD = ' ';

COMPUTE BEFORE _PAGE_/RIGHT;
LINE @04 'Grade : ' GRADE $char02.;
LINE @04 'Home District Name : ' DIST $char30.;
LINE @04 'Home School Name : ' SCHOOL $char30.;
LINE @04 'Home School Code : ' SCHLCODE $char12.;
ENDCOMP;

BREAK AFTER SCHLCD / PAGE;
RUN;

The output looks like this

> ------------------------------- 1-Mstry 4-Entry
> % of Student Results n % n %
> --------------------------------------------------------------

> 01 All Students 8 50.0% 1 50.0%
> 02 Female 5 31.3% . .
> 03 Male 3 18.8% 1 50.0%

I was expecting like this

> ------------------------------- 1-Mstry 4-Entry
> % of Student Results n % n %
> --------------------------------------------------------------

> 01 All Students 8 88.9% 1 11.1%
> 02 Female 5 100.0% . .
> 03 Male 3 75.0% 1 25.0%

Appreciate Any help
MK
1 REPLY 1
deleted_user
Not applicable
I have done this myself in a roundabout fashion. I have created PCT_ROW using FREQ procedured and directed the output to a SAS dataset, then I used REPORT PROC to create a report.

Thanks
MK

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1 reply
  • 747 views
  • 0 likes
  • 1 in conversation