hi ,
I am trying to generate a report but my vars exceeds width how to split variables into 2 row.
For example;
proc report data = all4 nowd split = "|" style(report)=[asis=on] nowindows ;
column paran _NAME_ N_50mg N_100mg N_200mg N_400mg N_600mg N_800mg ;
define paran /order "PK Parameter" format = sch.;
define _NAME_/ "";
define N_50mg/ display ;
define N_100mg/ display ;
define N_200mg/ display ;
define N_400mg/ display;
define N_600mg / display ;
define N_800mg / display ;
by ppcat avisit;
run;
I want my output like below...
page=1
analyte avisit=day1
------------------------------------------------------------------
tmax mean N_50mg N_100mg N_200mg
sd
min
page=2
analyte avisit=day1
------------------------------------------------------------------
tmax mean N_400mg N_600mg N_800mg
sd
min
basically wanto split vars in to 2 pages and tmax and _name as id vars
Appreciate all your help
proc report data=sashelp.class nowd;
columns name age sex weight height;
define name/display id ;
define age/display ;
define sex/display ;
define weight/display page;
define height/display;
run;
Please try this untested code , i used the compute blocks.
Also to get the variable N_50mg N_100mg N_200mg width incresed in such a way that these variable will fit in one page and next N_400mg N_600mg N_800mg will go to the next page and paran and _name_ are in the id so they will be displayed in both the pages.
/*this is for the line size, it could be change as per your requirement;*/
%let ls=68;
proc report data = all4 nowd split = "|" style(report)=[asis=on] nowindows ;
column avisit paran _NAME_ N_50mg N_100mg N_200mg N_400mg N_600mg N_800mg ;
define avisit/ order 'analyte avisit';
define paran /id order "PK Parameter" format = sch.;
define _NAME_/ id "";
define N_50mg/ display ;
define N_100mg/ display ;
define N_200mg/ display ;
define N_400mg/ display;
define N_600mg / display ;
define N_800mg / display ;
break after avisit / page;
compute before _page_/ left;
line 'analyte avisit: ' avisit;
line &ls.*'_';
line ' ';
endcomp;
run;
.
proc report data=sashelp.class nowd;
columns name age sex weight height;
define name/display id ;
define age/display ;
define sex/display ;
define weight/display page;
define height/display;
run;
Many thanks ..is there anyway populate only columns which hase values?
If I understood your question correctly. Try nozero option.
data class;
set sashelp.class;
call missing(age);
run;
proc report data=class nowd;
columns name age sex weight height;
define name/display ;
define age/display nozero;
define sex/display nozero;
define weight/display nozero;
define height/display nozero;
run;
hi,
variable having missing or blank values when doing by day .
nozero now working
Suppose on day1 I have values for 50mg 100mg 200mg 600mg
where ason day21 I have values for 50mg 600mg but in report 10mmg and 200mg coming with blank values''
Appreciate your help
valli
Sorry. Start a new session. Let other people see it. I can't understand your Q .
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 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.