Data visualization with SAS programming

ODS Proc Report - Compute not working to conditionally format cells

Accepted Solution Solved
Reply
Contributor
Posts: 31
Accepted Solution

ODS Proc Report - Compute not working to conditionally format cells

Using SAS 9.2

I am sucessfull in getting all values in a column to conditionally format.  Now I only want Female valued columns (not Males) to be highlighted.  No matter what I try, both male and females are highlighted.  Here is my latest attempt with the my SAS code and report sample!  Notice that I conditionally format cells using a a couple of proc formats!  (Plus I have changed the names of variables, etc for confidentiality)

Linda

Attachment

Accepted Solutions
Solution
‎04-30-2012 09:27 PM
SAS Super FREQ
Posts: 8,643

Re: ODS Proc Report - Compute not working to conditionally format cells

Hi:

  Items under an ACROSS variable need to be referenced with absolute column names. I've posted a couple of examples of tis in previous forum postings:

https://communities.sas.com/message/50996#50996

https://communities.sas.com/message/112134#112134

https://communities.sas.com/message/49987#49987

https://communities.sas.com/message/28822#28822

https://communities.sas.com/message/20444#20444

There seem to be a few glitches in some of the postings. The absolute column numbers are referenced as _c2_, _c3_ (underscore,c#,underscore)....but the forum mechanism seems to show them as C2 and C3 (which is incorrect). For a user group paper that discusses absolute column numbers, refer to this paper (starting on page 12-13):

http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf

You will have to work with Tech Support on the use of multi-label formats in a style override. As far as I know, you MUST specify the MLF option on your DEFINE statement to use a multi-label format in PROC REPORT. Since the STYLE override doesn't have a place of way to specify MLF, I'm not even sure that the conditional highlighting will work.

So, I see several problems with your code. As for adjusting the size of your PROC REPORT output, depending on your version of SAS, you would use either OUTPUTWIDTH= or WIDTH= to specify a size for the REPORT piece of your output.

SAS 9.1.3:

proc report data=... style(report)={outputwidth=6in};

OR

SAS 9.2/9.3:

proc report data=... style(report)={width=6in};

OUTPUTWIDTH should actually work for any version of SAS, I wanted to show both possibilities.

cynthia

View solution in original post


All Replies
Solution
‎04-30-2012 09:27 PM
SAS Super FREQ
Posts: 8,643

Re: ODS Proc Report - Compute not working to conditionally format cells

Hi:

  Items under an ACROSS variable need to be referenced with absolute column names. I've posted a couple of examples of tis in previous forum postings:

https://communities.sas.com/message/50996#50996

https://communities.sas.com/message/112134#112134

https://communities.sas.com/message/49987#49987

https://communities.sas.com/message/28822#28822

https://communities.sas.com/message/20444#20444

There seem to be a few glitches in some of the postings. The absolute column numbers are referenced as _c2_, _c3_ (underscore,c#,underscore)....but the forum mechanism seems to show them as C2 and C3 (which is incorrect). For a user group paper that discusses absolute column numbers, refer to this paper (starting on page 12-13):

http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf

You will have to work with Tech Support on the use of multi-label formats in a style override. As far as I know, you MUST specify the MLF option on your DEFINE statement to use a multi-label format in PROC REPORT. Since the STYLE override doesn't have a place of way to specify MLF, I'm not even sure that the conditional highlighting will work.

So, I see several problems with your code. As for adjusting the size of your PROC REPORT output, depending on your version of SAS, you would use either OUTPUTWIDTH= or WIDTH= to specify a size for the REPORT piece of your output.

SAS 9.1.3:

proc report data=... style(report)={outputwidth=6in};

OR

SAS 9.2/9.3:

proc report data=... style(report)={width=6in};

OUTPUTWIDTH should actually work for any version of SAS, I wanted to show both possibilities.

cynthia

Contributor
Posts: 31

Re: ODS Proc Report - Compute not working to conditionally format cells

Yes, Cynthia, width = 6in does work!  Thanks so much!

Linda

Post a Question
Discussion Stats
  • 2 replies
  • 259 views
  • 0 likes
  • 2 in conversation