BookmarkSubscribeRSS Feed
KalaBhairava
Quartz | Level 8

Please find the screen shot and clarify me

 

in attachment statistic column data split into two page for weight i need all statistic in one page how i can doCapture1.png

8 REPLIES 8
KalaBhairava
Quartz | Level 8

Please find the below screen shot and my data in below formateCaptureA.png

KalaBhairava
Quartz | Level 8

Sorry, please find below code for the same

 

 

data ned;
length parameter $15. stats $10. DrugA $5. DrugB $5. total $5.;
input parameter stats DrugA DrugB total ;
datalines;
Age(years) Maximum 48 42 48
Age(years) Mean 33.5 28.93 31.29
Age(years) Median 35 29 32
Age(years) Minimum 22 21 21
Age(years) Q1 25.5 23 24
Age(years) Q3 39 33 36
Age(years) SD 7.581 5.75 7.039
Age(years) n 16 15 31
Height(cm) Maximum 173 173 173
Height(cm) Mean 166.81 167.4 167.1
Height(cm) Median 167 167 167
Height(cm) Minimum 159 161 159
Height(cm) Q1 164.5 165 165
Height(cm) Q3 169.5 171 170
Height(cm) SD 3.371 3.602 3.439
Height(cm) n 16 15 31
Weight(kg) Maximum 78 79.5 79.5
Weight(kg) Mean 68.7 68.07 68.4
Weight(kg) Median 69.4 68.3 69
Weight(kg) Minimum 54.1 51.6 51.6
Weight(kg) Q1 65.53 64 64.75
Weight(kg) Q3 74.5 72.4 74
Weight(kg) SD 6.872 6.945 6.799
Weight(kg) n 16 15 31
;
run;

KalaBhairava
Quartz | Level 8

Please find my code below i am using proc report to generate rtf file

 

proc report data= derived.&derive.  nowd split='*' headskip headline missing style(column)=[vjust=center ];

 

column ORPRM CAT ordst STATS   T_DRUG R1_DRUG TOTAL_DRUG;

 

define ORPRM /noprint order order = internal ;

define CAT / "Variable/*  Category " order=data style=[asis=on just=left  cellwidth=.8cm  ] left order order ;

define ordst /noprint order  ;

define STATS / "Statistics" style=[just=left cellwidth=.5cm ] left ;

define T_DRUG / "T*(N=&NT.)" order=data style=[just=center  cellwidth=.5cm  ] left order  ;

define R1_DRUG / "R1*(N=&NR.)" style=[just=center  cellwidth=.5cm ] left ;

define TOTAL_DRUG / "Total*(N=&NTot.)" order=data style=[just=center  cellwidth=.5cm  ] left order ;

 

compute CAT;

if CAT in ("Ethnicity/Race","BMI(kg/m^{super 2})","Age (years)" "Height (cm)" "Weight (kg)") then

        call define(_col_, "style", "style=[font_weight=bold]");

endcomp;

 

compute after ORPRM;

line @1 "";

endcomp;

 

compute after / style=[borderbottomcolor=black bordertopwidth=2];

line "";

endcomp;

run;

ods _all_ close;

 

Cynthia_sas
SAS Super FREQ

Hi:

  Even if I read in your data set, and create a file, your data has these variables:

 parameter stats DrugA DrugB total 

and your PROC REPORT code has these variables:

ORPRM CAT ordst STATS   T_DRUG R1_DRUG TOTAL_DRUG

The ONLY variable name that is the same is STATS. How do you get from your original dataset to the DATA=derived.&derive?? How do ORPRM CAT ORDST T_DRUG R1_DRUG and TOTAL_DRUG get created????

 

  You don't show how to generate the data you're using with PROC REPORT....therefore, no one can run your code unless they guess what you're doing to get from the initial data you posted to the PROC REPORT data you show.

 

  Also, you say you want ODS RTF, but you don't show any ODS RTF statements. No one can see your options. And, you use options like HEADLINE and HEADSKIP that are LISTING only options which will be ignored by RTF.

 

  In order to help us help you, you need to either post ALL your code or if you can't post ALL your code, then you should open a track with Tech Support and work this with them.

 

Cynthia

KalaBhairava
Quartz | Level 8
Thank you

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 1257 views
  • 0 likes
  • 3 in conversation