I've been trying to generate a report with the layout in the image. Each line in the column title references a column in the dataset (e.g. Reported term is the column reported_term, MedDRA Preferred Term is medra_term, and so on). Each cell content should be the concatenation of the texts referred in the title, separated by a new line character. When I generate the HTML and RTF output with PROC REPORT, the result is not the desired (see second image attached, the colored ones should be placed in a new line). My approach involved using CATX with the '0A'x hexadecimal character for newline, and the definition of a split character "#" in PROC REPORT, but none of those give me a good result. If anyone could provide me a little help, I would appreciate it. Image 1. Image 2. RTF output from PROC Report /* Building final dataset for before reporting */
DATA ae_test_final;
SET ae_test_2;
/* First column */
length subj_seqno $50;
length reportmdra $150;
length startendt $50;
/* Subject \n Seqno */
subj_seqno = catx('0A'x, strip(subject_id), strip(put(ae_count, 3.)));
/* Reported Term \n MedDRA Preferred Term \n MedDRA System Organ Class*/
reportmdra = catx('0A'x,
strip(reported_term),
strip(meddra_prefer),
strip(meddra_sorgan));
/* Start Date+time/number days \n End Date+time/number days */
if missing(enddate_2) then
startendt = put(startdate_2, YYMMDD10.) || " " || starthour_ae || " / " ||
strip(put(ndays_start, 6.)) || "#" ||
"Ongoing / -";
else
startendt = put(startdate_2, YYMMDD10.) || " " || starthour_ae ||
" / " || strip(put(ndays_start, 6.)) || "#" ||
put(enddate_2, YYMMDD10.) || " " || endhour_ae || " / " ||
strip(put(ndays_end, 6.));
RUN;
options orientation=landscape;
ods rtf file="/~/listing.rtf";
ods escapechar="^";
PROC REPORT data=ae_test_final
nowd headline headskip split="#" missing;
column subj_seqno reportmdra startendt;
define subj_seqno / "Subject # Seqno" order;
define reportmdra / "Reported Term # MedDRA Preferred Term #
MedDRA System Organ Class" left flow;
define startendt / "Start Date + time / number days #
End Date + time / number days" left flow;
RUN;
ods rtf close;
... View more