BookmarkSubscribeRSS Feed
raja777pharma
Fluorite | Level 6

Hello Team,
I am struggling to generate RTF as per below screen shot, My output is not coming as Group for COL1,COL2, and need to put blank line between (Break) COl1 after value 'Observed ' and 'Changed'
Note : The data should be in sort order of vars – ‘gpxpage paramn avisitn catno’
In Below screen shot have more columns , but in my out put column are restricted and will come next RTF page
I have attached the data set and same data set in excel sheet.
I need output like below :

raja777pharma_0-1585825491359.png

 

My Current code and Output as below:

 

data report;
set table;
    if _n_ < 25 then gpxpage=1;
	  else gpxpage=2;
run;

title;
%prctmplt;
%ttlmaker;
ods listing close;
ods &outype file="%sysfunc(pathname(out))\&outname2..&outype" style=acrsstyle ;
run;
ods escapechar = '^';

proc Report data=report split='^' missing nowd spanrows headline headskip ;
	column gpxpage paramn avisitn catno col1 col2 col3 col4 col5 col6 col7  ;
	define gpxpage	/order order=internal "" noprint;
	define paramn	/order order=internal "" noprint;
	define avisitn /order order=internal "" noprint;
    define catno /order order=internal "" noprint;

	define col1 /&Header  group style(column)=[cellwidth=1.2in font_face=Courier font_size=1.25just=l asis=on] style(hdr)=[just=l asis=on] flow;
    define col2 /"Parameter"  group style(column)=[cellwidth=0.8in font_face=Courier font_size=1.25just=l asis=on] style(hdr)=[just=l asis=on] flow;
    define col3 /"Statistics"   style(column)=[cellwidth=0.9in font_face=Courier font_size=1.25just=l asis=on] style(hdr)=[just=l asis=on] flow;
	define col4 /&Header1.   style(column)=[cellwidth=1in	font_face=Courier font_size=1.25just=c asis=on] style(hdr)=[just=c asis=on];
	define col5 /&Header2.  style(column)=[cellwidth=1in font_face=Courier font_size=1.25just=c asis=on] style(hdr)=[just=c asis=on];
    define col6 /&Header3.  style(column)=[cellwidth=1in font_face=Courier font_size=1.25just=c asis=on] style(hdr)=[just=c asis=on];
    define col7 /&Header99.  style(column)=[cellwidth=1in font_face=Courier font_size=1.25just=c asis=on] style(hdr)=[just=c asis=on];

	break after gpxpage / page;

	compute before gpxpage;
        line " ";
    endcomp;

run;

My data set attached

 

1 REPLY 1
Cynthia_sas
SAS Super FREQ
HI:
No need to post the same question in 2 different forums. This was also asked and answered here: https://communities.sas.com/t5/SAS-Programming/Proc-report-RTF-Grouping-and-Break/td-p/636828

Cynthia

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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
  • 1 reply
  • 576 views
  • 0 likes
  • 2 in conversation