BookmarkSubscribeRSS Feed
thanikondharish
Calcite | Level 5

data rawdata ;

input id $ test $ result ;

cards;

101 bp 120

101 wbc 230

101 rbc 234

102 bp 120

102 wbc 230

102 rbc 234

run;

Note: we need to transpose the data in proc report only

ods rtf file="path" ;

proc report data=rawdata ;

column id test result ;

define test/across ;

define id/order ;

run;

ods rtf close ; 

 

output should be like:

 

                  Analysis Variables

           ----------------------------------
id         bp           wbc            rbc   

101    120          230           234

102    120          230           234

 

my question is how to apply extra label for all  test varibles "Analysis Variables"  while transposing 
Note: We should do in proc report only (don't use proc tranpose)

7 REPLIES 7
PaigeMiller
Diamond | Level 26
define test/across "Analysis Variables";
--
Paige Miller
thanikondharish
Calcite | Level 5
Below label we need to get one underline
Ksharp
Super User
data rawdata ;
input id $ test $ result ;
cards;
101 bp 120
101 wbc 230
101 rbc 234
102 bp 120
102 wbc 230
102 rbc 234
;
run;





ods rtf file="c:\temp\temp.rtf" style=journal bodytitle;
ods escapechar = '^';
proc report data=rawdata split='*'  nowd;
column id result,test ;
define test/across "^R/RTF'\brdrb\brdrs 'Analysis Variables";
define result/analysis ' ';
define id/group ;
run;
ods rtf close ; 
Cynthia_sas
SAS Super FREQ

Hi:

  As an alternative, this is also possible with a style override instead of RTF control strings. This means the technique would work in other destinations, not just RTF:

Cynthia_sas_0-1650728339543.png

 

Cynthia

thanikondharish
Calcite | Level 5

how to apply label for only 2 columns like :
                                Analysis Variable

                              ----------------------------

id        bp                 rbc              rbc

101    120              230              340

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
  • 7 replies
  • 879 views
  • 1 like
  • 4 in conversation