The SAS Output Delivery System and reporting techniques

Changing Row Color With Proc Report

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

Changing Row Color With Proc Report

I would like to create a PDF report that has different colored rows based on the value of my variable type. I would like the rows to be green when type='Complete', yellow when type='Planned' and red when type='At Risk'. I have tried running the following compute block:


     compute type;

     if type='Complete' then call define (_row_,'style','style=[BACKGROUND=lightGREEN]');

     if type='Planned' then call define (_row_,'style','style=[BACKGROUND=lightYELLOW]');

     if type='At Risk' then call define (_row_,'style','style=[BACKGROUND=lightRED]');

     endcomp;

I have used a run statement as well as an ods pdf close statement at the end of the proc report step but when I run this section of my code SAS indicates that Proc Report is still running and will not produce the PDF file. How can I successfully produce this report?


Accepted Solutions
Solution
‎01-17-2014 12:38 PM
Super User
Posts: 17,826

Re: Changing Row Color With Proc Report

Add the nowd (nowindows) option to your proc report statement. Proc Report can be an interactive procedure, so you want to tell SAS that you want it to be non-interactive.

proc report data=panel_1 nowd;

View solution in original post


All Replies
Super User
Posts: 17,826

Re: Changing Row Color With Proc Report

Full code please and log please.

Did you include nowd in the proc report statement as well?

Occasional Contributor
Posts: 7

Re: Changing Row Color With Proc Report

My full code looks like this:

Proc Report.jpg

I'm not very familiar with Proc Report and am not sure if I'm using any of the options correctly.

Solution
‎01-17-2014 12:38 PM
Super User
Posts: 17,826

Re: Changing Row Color With Proc Report

Add the nowd (nowindows) option to your proc report statement. Proc Report can be an interactive procedure, so you want to tell SAS that you want it to be non-interactive.

proc report data=panel_1 nowd;

Occasional Contributor
Posts: 7

Re: Changing Row Color With Proc Report

That did it! Thank you!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 650 views
  • 0 likes
  • 2 in conversation