Date: Tue, 21 Oct 2008 10:32:55 -0500
Reply-To: Mary <mlhoward@avalon.net>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mary <mlhoward@AVALON.NET>
Subject: How to do conditional formatting in SAS?
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
reply-type=original
Hi,
I've got output that I'm generating that shows a number of columns, one of
which is the change in eye vision (these are changes in logmar scores), and
my logmar scores look like this:
0.796
0.903
1.000
1.097
1.176
1.301
2.000
3.000
-0.125
0.000
0.097
0.176
0.301
0.398
0.477
0.544
0.602
0.699
0.796
0.903
1.000
I'm using Excel tagsets to write these out to an XML file and to import into
Excel.
Right now I'm using Proc Print within an Excel tagset wrapper.
ods listing close;
ods tagsets.excelxp file='C:\Work_Activities\results_sheetnames.xml'
style=analysis3
options(absolute_column_width='10,10,10,8,8,10,10,15,8,15,8,15,10,8,8,8,8,10,10,15,8,15,8,15,10,8,8,8,8,20'
sheet_label=' ');
ods tagsets.excelxp options(sheet_name="&sheetname");
proc print noobs label data=results;
var
STUDY_NBR
visit_location
DATE_OF_VISIT
AGE;
RUN;
ods tagsets.excelxp close;
ods listing;
I would like to add conditional formatting to the column of the change in
logmar scores; such as to change the background color to yellow or something
when the value is out of a certain range (such as when the value is > .25).
Is there a way that I can add conditional formatting on this column via Proc
Report or something else and then output that to XML using Excel tagsets? I
anticipate rerunning this a number of times as we update values, and thus
would like to program in the conditional formatting into my SAS program
rather than adding it once I pull the output into Excel.
-Mary
|