BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
valli
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User


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

8 REPLIES 8
Jagadishkatam
Amethyst | Level 16

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
valli
Calcite | Level 5
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. -##
Jagadishkatam
Amethyst | Level 16
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
Ksharp
Super User


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;
valli
Calcite | Level 5

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

Ksharp
Super User

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;

valli
Calcite | Level 5

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

Ksharp
Super User

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

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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