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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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