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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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