Hi, I'm trying to add a line in proc report, however, I'm having some trouble
the data looks like this
Obs col1 col2 ord pct sort12345678910
Participants evaluable for adverse events | 14 | 1 | 1 | |
All casualties | 2 | 2 | ||
Number of adverse events | 0 | 3 | 4 | |
Participants with serious adverse events | 3 | 4 | (21.4) | 4 |
Participants discontinued from study due to adverse events~{super a} | 0 | 5 | (0.0) | 4 |
Participants discontinued study drug due to AE and continue study~{super b} | 0 | 6 | (0.0) | 4 |
Treatment related | 7 | 3 | ||
Number of adverse events | 0 | 8 | (0.0) | 4 |
Participants of adverse events | 0 | 9 | (0.0) | 4 |
Participants of severe adverse events | 0 | 10 | (0.0) | 4 |
I would like a line after Obs 1 and obs 6.
I tried creating a sort order to create a line but that just groups it up in the proc report.
proc report data=final nowd split='*' headline headskip;
column col1 ("Total" col2 pct) ord sort;
define ord/order order=internal noprint;
define sort/group noprint;
define col1/"Number (%) of subjects:" width=50 flow;
define col2/"N" width=35 center flow;
define pct/"(%)" width=35 center flow;
compute after ;
line '';
endcomp;
run;
I'm assuming I can drop the sort and hopefully there is an alternative way. I tried doing specific lines by doing:
computer after:
line @2 '';
endcomp;
but that's not working either.
One thing is helps to show the data as the Proc Report sees it. You apparently have at least two variables in the proc report that you show no values for. So we can't tell at all what you may be attempting with the proc report code.
You may just have missed "compute after ord"; but without your data who knows.
Please provide example data as a data step.
Here is one example of inserting a line value with data, SASHELP.CLASS, you should have available. I used a data step to add an order variable whose change allows use of Compute after.
data junk; set sashelp.class; if _n_ le 5 then ord=1; else if _n_ le 10 then ord=2; else ord=3; run; proc report data=junk; columns ord name sex age; define ord/order noprint; compute after ord; line "Here is a line"; endcomp; run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.