Help using Base SAS procedures

PROC Report

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

PROC Report

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


Accepted Solutions
Solution
‎07-26-2017 05:50 AM
Super User
Posts: 10,046

Re: PROC Report



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;

View solution in original post


All Replies
Trusted Advisor
Posts: 1,137

Re: PROC Report

[ Edited ]

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;

Thanks,
Jag
Occasional Contributor
Posts: 7

Re: PROC Report

Posted in reply to Jagadishkatam
hi Jagdesh,

Many thanks for reply.

I tried the code you sent it didnt worked..it is just added one column
avisit before paran..
[image: Inline image 2]
I want to split report after 200mg and my report should generate by ech
analyte and Day

One more help if possible

for some DAY's I dont have any values for some treatments but whole column
coming with missing is there anyway to drop those columns automatically

Appreciate your help..


##- Please type your reply above this line. Simple formatting, no
attachments. -##
Trusted Advisor
Posts: 1,137

Re: PROC Report

did you try to increase the width of N_50mg N_100mg N_200mg in 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.

for the other question I think we need to use macro variables which will conditionally check the missing variables and drop them.
Thanks,
Jag
Solution
‎07-26-2017 05:50 AM
Super User
Posts: 10,046

Re: PROC Report



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;
Occasional Contributor
Posts: 7

Re: PROC Report

Many thanks ..is there anyway populate only columns which hase values?

Super User
Posts: 10,046

Re: PROC Report

[ Edited ]

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;

Occasional Contributor
Posts: 7

Re: PROC Report

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 have values for 50mg  600mg but in report 10mmg and 200mg coming with blank values''

 

Appreciate your help

 

valli

Super User
Posts: 10,046

Re: PROC Report

Sorry. Start a new session. Let other people see it. I can't understand your Q .

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 8 replies
  • 601 views
  • 2 likes
  • 3 in conversation