My data contains the following variables TRT SUBJECTID TESTNAME VISIT DATE RESULT. I am displaying this data as a listing in RTF file format. The data contains many subjects in three different treatment groups(TRT). The TRT value appears as a subtitle in the RTF output (achieved using BY TRT in PROC REPORT). Each subject has multiple TESTNAMEs and multiple VISITs. So the data for each subject spans several pages vertically (the columns on the RTF listing being SUBJECTID TESTNAME VISIT DATE and RESULT all fitting on a single page horizontally but flowing over several pages for each SUBJECTID vertically). The SUBJECTID prints on the first row of the subjects data (as a grouping variable). I need the SUBJECTID to display on the first row of each new page when a subjects data flows over to the next page vertically. My PROC REPORT code is as follows: PROC REPORT DATA= xdata; by TRT; COLUMN PG SUBJECTID TESTNAME VISIT DATE RESULT: DEFINE PG /order order=internal noprint; DEFINE SUBJECTID / order order=internal style(header)={cellwidth=0.9in just=l}; . . ; COMPUTE BEFORE SUBJECTID; line " "; ENDCOMP; BREAK AFTER PG/PAGE; run; The PG value is derived as PG=ceil(_n_/14); in order to get a limited number of rows per page. I notice that the SUBJECTID prints on subsequent pages when there is a change of PG value. But if a subject has the same PG value throughout his/her data but the PROC REPORT paging moves to the next page, that SUBJECTID does not print on that next page because the PG value is the same. So it appears the BREAK AFTER PG/PAGE (and change in PG value) is impacting the printing of SUBJECTID on next page. I cannot solve the issue by using BREAK AFTER SUBJECTID/PAGE because that would only print the SUBJECTID value at the beginning of each new subject's data. I tried leaving out the PG variable totally so that PROC REPORT determines the number of rows on each page. But this does not solve the issue. Also using GROUP BY instead of ORDER ORDER=internal on DEFINE SUBJECTID row of PROC REPORT does not make a difference. To describe my example visually the output looks similar to below example: Listing of LAB Results Page 1 of 3 Treatment A _____________________________________________________________________________________________________________ SUBJECTID TESTNAME VISIT DATE RESULT ______________________________________________________________________________________________________________ 400-2010A Hemoglobin Day 10 20Sep2023 XX Calcium Day 12 22Sep2023 XX Magnesium Day 20 02Oct2023 XX Listing of LAB Results Page 2 of 3 Treatment A _______________________________________________________________________________________________________ SUBJECTID TESTNAME VISIT DATE RESULT __________________________________________________________________________________________________________ missing ALT Day 21 03OCT2023 XX AST Day 22 04Oct2023 XX I am needing SUBJECTID value to show on the new page (page 2 in above example) where I have inserted 'missing' in red text. Any suggestions on how to resolve this?
... View more