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;
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
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
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: