- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am generating a report using proc report and need the column header to print either A Period or B Period based on the value of the variable trtn in my dataset. An if/else statement does not work. Can anyone provide a suggestion?
thank you
KC
proc report data=final style=[outputwidth=100%];
columns trtn ord ("__Period A______________________________________________________________________________________________________"
c1 ("______________________________CTCAE Grade______________________________" c3 c4 c5 c6 c7));
/* if trtn=3 then columns trtn ord ("__Period B___________________________________________________________________________________________________" */
/* c1 ("______________________________CTCAE Grade______________________________" c3 c4 c5 c6 c7)); */
define trtn /order noprint order=internal;
define ord /order noprint order=internal;
define c1 /group display "System Organ Class/^ Preferred Term [1]" style(column)=[cellwidth=20% just=LEFT asis=on] style(header)=[just=l];
define c3 / "Grade 1/^[Events] (%)" style(column)=[cellwidth=11% just=c] flow;
define c4 / "Grade 2/^[Events] (%)" style(column)=[cellwidth=11% just=c] flow;
define c5 / "Grade 3/^[Events] (%)" style(column)=[cellwidth=11% just=c] flow;
define c6 / "Grade 4/^[Events] (%)" style(column)=[cellwidth=11% just=c] flow;
define c7 / "Grade 5/^[Events] (%)" style(column)=[cellwidth=11% just=c] flow;
break after trtn / page;
compute after ord;
line ' ';
endcomp;
run;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
Unless you used BY group processing so you could create a report for every value of TRTN, I think you might need a SAS Macro program, something like this:
This is not the exact format as your output, since it uses SASHELP.CLASS for the example, but it illustrates the general concept. There are other ways to write the macro program, of course, but I based this on an example I already had available.
Cynthia
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
Unless you used BY group processing so you could create a report for every value of TRTN, I think you might need a SAS Macro program, something like this:
This is not the exact format as your output, since it uses SASHELP.CLASS for the example, but it illustrates the general concept. There are other ways to write the macro program, of course, but I based this on an example I already had available.
Cynthia