I'm trying to change the appearance for the columns in my report
I used this code
proc report data=table4;
column Readable_Time_Points case_assigned Time_points_read Time_points_complete off_study off_study_total Time_Points_Pending ;
define Readable_Time_Points/ "Readable Time Points";
define case_assigned/ "Cases Assigned";
define Time_Points_Pending/ "Time Points Pending";
define off_study/ "Off_study cases requiring adjudication";
define off_study_total/ "Total cases completed(off_study)";
run;
and this is my current result
Readable Time Points | Cases Assigned | Time_points_read | Time_points_complete | Off_study cases requiring adjudication | Total cases completed(off_study) | Time Points Pending |
9 | 7 | 29 | 300 | 0 | 0 | 9 |
and this is the result that I aim for or something simillar
Time Points Read/Complete: (Complete reads/Contracted) | 29 | 300 | 9.7% |
Readable Time Points: | 9 | ||
Cases Assigned: | 7 | ||
Time Points Pending | 7 | ||
Off-study cases requiring adjudication: | 0 | ||
Total cases completed (off- study): | 0 |
Proc report doesn't like to mix values within a single column unless it is a summary of the column. It might be possible to generate some of that output with Proc tabulate as it will allow mixing columns a bit but does get picky about what needs to be included to do summaries and it appears that your desired result may not be practical (without data it is hard to tell).
If you provide example input data in the form of a data step you might get a tested solution.
You could re-arrange the data in a data step before PROC REPORT, which would then allow PROC REPORT to do different things than it normally does. So the only thing PROC REPORT would do is to create a table, it would not be doing the analysis of the data.
Nevertheless, this would take a bit of work in the data step to get PROC REPORT to produce the final report as you want it.
I already analysed my data before proc report but I want to change the report criteria that what I want
That's exactly what I want to do but I don't know how to do it
Since you haven't shown us your data, we can only guess at what you have, and so I would say you could create code that looks something like this (not a complete example)
data table5;
set table4;
length type $ 16;
value=readable_time_points;
type='COL1';
output;
value=cases_assigned;
type='COL1';
output;
value=time_points_read;
type='COL1';
output;
value=time_points_complete;
type='COL2';
ouptut;
run;
proc report data=table5;
columns value type;
define type/across;
run;
That's the result that I got from your code and it is not correct
type | ||
value | COL1 | COL2 |
338 | 3 | 1 |
There is a mistake in what I wrote, which should say
data table5;
set table4;
length type $ 16 label $ 24;
label='readable_time_points';
type='COL1';
value=readable_time_points;
output;
label='cases_assigned';
type='COL1';
value=cases_assigned;
output;
label='time_points_read_complete';
type='COL1';
value=time_points_read;
output;
label='time_points_read_complete';
type='COL2'
value=time_points_complete;
ouptut;
run;
proc report data=table5;
columns label type,value;
define type/across;
define value/analysis sum;
run;
I have not much to go on, as you haven't shared a reasonable subset of your data so we can see what it looks like.
Now, you show us a reasonable portion of your data in table4.
Here is a very old school approach:
data garbage; input Readable_Time_Points case_assigned Time_points_read Time_points_complete off_study off_study_total Time_Points_Pending ; datalines; 9 7 29 300 0 0 9 ; run; data _null_; set garbage; file print; rate= Time_points_read/Time_points_complete; put @1 "Time Points Read/Complete: (Complete reads/Contracted)" @56 Time_points_read @60 Time_points_complete @65 rate percent7.1 ; put @1 "Readable Time Points:" @56 Readable_Time_Points ; put @1 "Cases Assigned:" @56 case_assigned ; put @1 "Time Points Pending" @56 Time_Points_Pending ; put @1 "Off-study cases requiring adjudication:" @56 off_study ; put @1 "Total cases completed (off- study):" @56 off_study_total ; run;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.