BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi all,

What I would like to do is the following: I would like that the column A doesn't appear in the report, but only the break lines "Treatment Group= A" and "Treatment Group= B" appear in the report.
Indeed, since the modalities of the variable A are rather long (in my true dataset), I would like to display these modalities in line instead of in columns.

You can see below the corresponding SAS program (with variables A, B, C):

Data TEMP;
A="A"; B=0; C="Myriam"; OutPut;
A="A"; B=1; C="Chloe"; OutPut;
A="A"; B=2; C="Nadege"; OutPut;
A="A"; B=1; C="Elodie"; OutPut;
A="A"; B=0; C="Christelle"; OutPut;
A="B"; B=0; C="Mickael"; OutPut;
A="B"; B=1; C="Lili"; OutPut;
A="B"; B=2; C="Seb"; OutPut;
A="B"; B=1; C="Guillaume"; OutPut;
Run;
Ods rtf file="C:\MyData\Temp_report.rtf" notoc_data;
PROC REPORT DATA=TEMP SPLIT="¤" NOCENTER NOWD MISSING SPACING=0
Style(report)=[just=center]
Style(header)=[font_weight=bold just=left];
COLUMN A B C;
BREAK BEFORE A / SKIP;
COMPUTE BEFORE A;
LINE 'Treatment group=' A $.;
ENDCOMP;
DEFINE A / WIDTH=15 LEFT FLOW GROUP;
DEFINE B / WIDTH=15 LEFT FLOW;
DEFINE C / WIDTH=15 LEFT FLOW;
RUN;
Ods Rtf Close;
2 REPLIES 2
Tim_SAS
Barite | Level 11
Add a DEFINE statement for A to your program and use the NOPRINT option, like this:

[pre]DEFINE A / NOPRINT;[/pre]
deleted_user
Not applicable
!!!! THANKS A LOT !!!! Your reply is very helpful!

Violaine

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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