BookmarkSubscribeRSS Feed
sri1
Obsidian | Level 7

Hi all,

 

I have the following output with proc report

 

Term

Trt1

Trt2

Trt3

PEP score

 

 

 

N

26

46

50

Mean

15.42

17.83

20.97

Median

59.0

32.0

33.0

Gender

 

 

 

F

19(79.2)

    0

19(25.8)

M

15(40.3)

10(12.8)

25(30.6)

Unknown

     0

    0

    0

 

 I have used the following code.

Proc report data=test;

Column term trt1 trt2 trt3;

   define trt1/ display

              style(header) =[just=c  ]

              style(column)=[just=d paddingright=5%];

    define trt2/ display

              style(header=[ just=c  ]

              style(column)=[just=d paddingright=2%];

     define trt3/ display

              style(header=[ just=c  ]

              style(column)=[just=d paddingright=2%];

run;

 

I need the output as follows

 

Term

Trt1

Trt2

Trt3

VAP score

 

 

 

N

26

46

50

Mean

15.42

17.83

20.97

Median

59.0

32.0

33.0

Gender

 

 

 

F

19(79.2)

0

19(25.8)

M

15(40.3)

10(12.8)

25(30.6)

Unknown

0

0

0

 

Appreciate your reply.

Regards

2 REPLIES 2
ballardw
Super User

Data? Hard to test code without data.

 

Please post code in code or text box opened with the running man or </> icon as the message windows on this forum insert lots of junk and may reformat other stuff so that it takes a lot of editing to clean up for testing.

 

Patrick
Opal | Level 21

Sample data shared in the form of a working SAS data step that creates the data, result based on this sample data AND the working code that produced the output.

 

Use the running man icon for sharing code

Patrick_0-1673144164139.png

 

Patrick_0-1673143858651.png

 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 2 replies
  • 390 views
  • 0 likes
  • 3 in conversation