Help using Base SAS procedures

Problem with Proc report

Reply
N/A
Posts: 0

Problem with Proc report

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;
Super Contributor
Posts: 394

Re: Problem with Proc report

Posted in reply to deleted_user
Add a DEFINE statement for A to your program and use the NOPRINT option, like this:

[pre]DEFINE A / NOPRINT;[/pre]
N/A
Posts: 0

Re: Problem with Proc report

!!!! THANKS A LOT !!!! Your reply is very helpful!

Violaine
Ask a Question
Discussion stats
  • 2 replies
  • 105 views
  • 0 likes
  • 2 in conversation