BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello folks,

I have 2 variables, a class term, and a specific term such that for 1 class term value there are many specific term values.

In proc report I have the class term listed before the specific term in the column statement. In the define statement for the class term I specify sort and noprint and I have a compute block where I specify for this variable to print only the first occurance.

The report lists the specific terms indented under the class terms, but if a class term continues on to the next page, you don't see the class term, while you see the rest of the specific terms.

What I want to know is how can I print the class term on the next page, in proc report, if the class term repeats on the next page? I'm looking for an easy solution in proc report. I've tried a number of things in proc report with no luck. I would like to hear from you if you have done this.

thank you,

Anthony
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
When I run this report (below) I get the "classterm" repeated at the top of the page in the LISTING and RTF destinations in SAS 9.1.3. HTML, of course, has no page breaks, so COMPUTE BEFORE _PAGE_ only appears at the top of each value for CLASSTERM variable. In SAS 9.1.3, the PDF file only uses the COMPUTE BEFORE _PAGE_ at the beginning of each CLASSTERM. However, in SAS 9.2, PDF and RTF outputs both have the same behavior (with the text string at the top of each page).

I'm not exactly sure of what you're trying to do, but if this program doesn't help you, then you might consider contacting Tech Support for more help.

cynthia

[pre]
** make some data;
data examp;
length classterm $16 specific $16;
set sashelp.class;
classterm='First';
specific = catt('aaa',name);;
output;
specific = catt('bbb',name);
output;
specific = catt('ccc',name);
output;

classterm='Second';
specific = catt('xxx',name);
output;
specific = catt('yyy',name);
output;
specific = catt('zzz',name);
output;

run;


options nodate number pageno=1 ls=80 ps=50;
title; footnote;

ods listing;
ods html file='comp_before_page.html' style=sasweb;
ods rtf file='comp_before_page.rtf' ;
ods pdf file='comp_before_page.pdf';
proc report data=examp nowd;
title 'Use Compute Before Page and Compare Different Destinations';
column classterm specific height;
define classterm / order noprint;
define specific / order;
define height / sum;
break after classterm / summarize page;
compute before classterm;
holdterm = classterm;
endcomp;
compute before _page_;
line 'Term: ' holdterm $16.;
endcomp;
run;
ods _all_ close;


[/pre]
deleted_user
Not applicable
Hello Cynthia

Thank you for the response. I will try this when I get the chance. My output is lst so I don't know if this will work.

This is for doing adverse events incidence tables. Each system class terms has many preferred terms and many times an organ class's preferred term continue on the next page. proc report does not repeat the class term on the next page when the preferred term is indented under the class term, but we want to do it and add the text "(CONT.)" at the end of class term. Some persons developed very complex programming involving pre-processing to do it. I'm searching for an easier way.

Anthony
Cynthia_sas
SAS Super FREQ
Hi:
Starting in SAS 9.2, the TAGSETS.RTF destination will automatically place the string "continued" at the bottom of the output when the output splits across pages.

This doesn't help with LISTING output. the only way to do this for LISTING output may be to post-process the output file. You might search the PharmaSUG archive site, www.lexjansen.com for some more examples.

cynthia
LawrenceHW
Quartz | Level 8
Anthony,

The only way I've found of doing what you're requesting is the pre-processing route.

Cynthia's solution is very elegant but unfortunately isn't really what is needed for AE tables.

What I do is create page breaks (i.e. a paging variable) based on the number of available lines for my table. Make sure that you take into account skips and continued class headings.

I then run a 2nd data step to add an extra line where a class page breaks in the middle of the class. This is where I add the "(Cont.)".

Hope this helps.
Lawrence

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!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

Discussion stats
  • 4 replies
  • 1041 views
  • 0 likes
  • 3 in conversation