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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 7 replies
  • 930 views
  • 1 like
  • 4 in conversation