<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Proc report &amp; Color code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13651#M1624</link>
    <description>Hi,&lt;BR /&gt;
all the rows .in this case 1002,both rows to be color coded.</description>
    <pubDate>Thu, 07 Oct 2010 15:46:13 GMT</pubDate>
    <dc:creator>SASPhile</dc:creator>
    <dc:date>2010-10-07T15:46:13Z</dc:date>
    <item>
      <title>Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13649#M1622</link>
      <description>phid     name       address             qty&lt;BR /&gt;
1001    John        Philadephia         25&lt;BR /&gt;
1002    Adams     Tampa                30&lt;BR /&gt;
1002    Adams     Orlando               30&lt;BR /&gt;
1003    Mark        Austin                  30&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
In proc report how to color code those phid which are not distinct.For instance 1002.The whole row need to be color coded.</description>
      <pubDate>Thu, 07 Oct 2010 15:11:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13649#M1622</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-10-07T15:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13650#M1623</link>
      <description>Hi:&lt;BR /&gt;
  You say that for 1002 the whole ROW needs to be color coded -- but I see 2 rows for 1002 -- so which row?? The first row?? The second row?? or both rows???&lt;BR /&gt;
&lt;BR /&gt;
What if there are more than 2 rows??? would ALL the rows need to be updated?? Only the first row?? Everything but the first row??? &lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 07 Oct 2010 15:38:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13650#M1623</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-10-07T15:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13651#M1624</link>
      <description>Hi,&lt;BR /&gt;
all the rows .in this case 1002,both rows to be color coded.</description>
      <pubDate>Thu, 07 Oct 2010 15:46:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13651#M1624</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-10-07T15:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13652#M1625</link>
      <description>Will something like this work?&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
DATA TEST;&lt;BR /&gt;
LENGTH PHYID $ 4 NAME $ 10 ADDRESS $ 15;&lt;BR /&gt;
INPUT PHYID $ NAME $ ADDRESS $ QTY;&lt;BR /&gt;
DATALINES;&lt;BR /&gt;
1001 John Philadephia 25&lt;BR /&gt;
1002 Adams Tampa 30&lt;BR /&gt;
1002 Adams Orlando 30&lt;BR /&gt;
1003 Mark Austin 30&lt;BR /&gt;
;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
/* CREATE MACRO VARIABLE WITH ALL DUPLICATE PHYID VALUES */&lt;BR /&gt;
PROC SQL NOPRINT;&lt;BR /&gt;
	SELECT DISTINCT PHYID INTO: MULTIPLES SEPARATED BY '" "'&lt;BR /&gt;
	FROM &lt;BR /&gt;
		(SELECT PHYID, COUNT(*) AS COUNT&lt;BR /&gt;
		 FROM TEST&lt;BR /&gt;
		 GROUP BY PHYID&lt;BR /&gt;
		 HAVING COUNT &amp;gt; 1);&lt;BR /&gt;
QUIT;&lt;BR /&gt;
&lt;BR /&gt;
ODS LISTING CLOSE;&lt;BR /&gt;
ODS HTML FILE='TEST.HTML' STYLE=MINIMAL;&lt;BR /&gt;
&lt;BR /&gt;
PROC REPORT DATA=TEST NOWINDOWS;&lt;BR /&gt;
	COLUMNS PHYID NAME ADDRESS QTY;&lt;BR /&gt;
	COMPUTE PHYID;&lt;BR /&gt;
		IF PHYID IN ("&amp;amp;MULTIPLES") THEN CALL DEFINE(_ROW_, "STYLE", "STYLE=[BACKGROUND=HONEYDEW]");&lt;BR /&gt;
	ENDCOMP;&lt;BR /&gt;
RUN;&lt;BR /&gt;
ODS HTML CLOSE;&lt;BR /&gt;
ODS LISTING;&lt;BR /&gt;
[/pre]

Message was edited by: polingjw</description>
      <pubDate>Thu, 07 Oct 2010 16:06:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13652#M1625</guid>
      <dc:creator>polingjw</dc:creator>
      <dc:date>2010-10-07T16:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13653#M1626</link>
      <description>Thanks,But this color codes only the first row.How to color code both the rows?and is there a way if there are more than one phyid which are not distinct,we can show them in different colors?&lt;BR /&gt;
&lt;BR /&gt;
for instance two rows of 1002 is shown as honeydew.&lt;BR /&gt;
say we have 1003 which has three rows can we display yellow?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
1003      Mark     Austin     30&lt;BR /&gt;
1003      Mark     Dallas     45&lt;BR /&gt;
1003      Mark     Elpaso    35</description>
      <pubDate>Thu, 07 Oct 2010 16:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13653#M1626</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-10-07T16:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13654#M1627</link>
      <description>When I run the program, both rows with a phyid of 1002 show up as honeydew.&lt;BR /&gt;
&lt;BR /&gt;
Do you want a separate color for each phyid or a separate color for each frequency?  For example, suppose 1002 and 1005 both have two records.  Also, suppose 1003 and 1006 both have three records.  Do you want 1002 and 1005 to have one color and 1003 and 1006 to have a different color?  Or, do you want all four phyid’s to have their own distinct color?</description>
      <pubDate>Thu, 07 Oct 2010 16:57:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13654#M1627</guid>
      <dc:creator>polingjw</dc:creator>
      <dc:date>2010-10-07T16:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13655#M1628</link>
      <description>all four phyid’s to have their own distinct color&lt;BR /&gt;
1002 light yellow&lt;BR /&gt;
1003 light red&lt;BR /&gt;
1005 light brown&lt;BR /&gt;
1006 light orange</description>
      <pubDate>Thu, 07 Oct 2010 17:09:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13655#M1628</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-10-07T17:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13656#M1629</link>
      <description>If the list of duplicate IDs gets long the macro variable may become unwieldy.  Consider an indicator variable.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
DATA TEST;&lt;BR /&gt;
   LENGTH PHYID $ 4 NAME $ 10 ADDRESS $ 15;&lt;BR /&gt;
   INPUT PHYID $ NAME $ ADDRESS $ QTY;&lt;BR /&gt;
   DATALINES;&lt;BR /&gt;
1001 John Philadephia 25&lt;BR /&gt;
1002 Adams Tampa 30&lt;BR /&gt;
1002 Adams Orlando 30&lt;BR /&gt;
1003 Mark Austin 30&lt;BR /&gt;
1004 Adams Tampa 30&lt;BR /&gt;
1004 Adams Orlando 30&lt;BR /&gt;
1004 Mark Austin 30&lt;BR /&gt;
;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
   set test;&lt;BR /&gt;
   by phyid;&lt;BR /&gt;
   dup  = not(first.phyid and last.phyid);&lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
ODS LISTING CLOSE;&lt;BR /&gt;
ODS HTML FILE='TEST.HTML' STYLE=MINIMAL;&lt;BR /&gt;
&lt;BR /&gt;
PROC REPORT DATA=TEST NOWINDOWS list;&lt;BR /&gt;
	COLUMNS dup PHYID NAME ADDRESS QTY;&lt;BR /&gt;
   define dup / noprint display;&lt;BR /&gt;
   define phyid / order;&lt;BR /&gt;
	COMPUTE PHYID;&lt;BR /&gt;
/*      rc = seenum(dup);*/&lt;BR /&gt;
      IF dup THEN CALL DEFINE(_ROW_, "STYLE", "STYLE=[BACKGROUND=HONEYDEW]");&lt;BR /&gt;
      ENDCOMP;&lt;BR /&gt;
RUN;&lt;BR /&gt;
ods HTML Close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 07 Oct 2010 17:16:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13656#M1629</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-10-07T17:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13657#M1630</link>
      <description>Thats true.But the grouping is done on bunch of variables not just phyid.in such situations proc sql is more handy.</description>
      <pubDate>Thu, 07 Oct 2010 17:31:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13657#M1630</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-10-07T17:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13658#M1631</link>
      <description>How about this solution?  With this solution, you need to specify the colors that make acceptable backgrounds when calling a macro.  You could probably write code to automatically generate a new color for each phyid.  If you would like to do this instead, I would start by looking at the color macro utilities invoked by %COLORMAC.  However, I would imagine that it might be difficult to automatically generate a list of colors that all look good as cell backgrounds.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
DATA TEST;&lt;BR /&gt;
LENGTH PHYID $ 4 NAME $ 10 ADDRESS $ 15;&lt;BR /&gt;
INPUT PHYID $ NAME $ ADDRESS $ QTY;&lt;BR /&gt;
DATALINES;&lt;BR /&gt;
1001 John Philadephia 25&lt;BR /&gt;
1002 Adams Tampa 30&lt;BR /&gt;
1002 Adams Orlando 30&lt;BR /&gt;
1003 Mark Austin 30&lt;BR /&gt;
1003 Mark Dallas 45&lt;BR /&gt;
1003 Mark Elpaso 35 &lt;BR /&gt;
;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
%MACRO COLOR_REPORT(COLOR_LST);&lt;BR /&gt;
&lt;BR /&gt;
%LOCAL MULTIPLES I PHYID COLOR;&lt;BR /&gt;
&lt;BR /&gt;
/* CREATE MACRO VARIABLE WITH ALL DUPLICATE PHYID VALUES */&lt;BR /&gt;
PROC SQL NOPRINT;&lt;BR /&gt;
	SELECT DISTINCT PHYID INTO: MULTIPLES SEPARATED BY ' '&lt;BR /&gt;
	FROM &lt;BR /&gt;
		(SELECT PHYID, COUNT(*) AS COUNT&lt;BR /&gt;
		 FROM TEST&lt;BR /&gt;
		 GROUP BY PHYID&lt;BR /&gt;
		 HAVING COUNT &amp;gt; 1);&lt;BR /&gt;
QUIT;&lt;BR /&gt;
&lt;BR /&gt;
ODS LISTING CLOSE;&lt;BR /&gt;
ODS HTML FILE='TEST.HTML' STYLE=MINIMAL;&lt;BR /&gt;
&lt;BR /&gt;
PROC REPORT DATA=TEST NOWINDOWS;&lt;BR /&gt;
	COLUMNS PHYID NAME ADDRESS QTY;&lt;BR /&gt;
	COMPUTE PHYID;&lt;BR /&gt;
		%LET I=1;&lt;BR /&gt;
		%DO %UNTIL (%SCAN(&amp;amp;MULTIPLES, &amp;amp;I) =);&lt;BR /&gt;
			%LET PHYID = %SCAN(&amp;amp;MULTIPLES, &amp;amp;I);&lt;BR /&gt;
			%LET COLOR = %SCAN(&amp;amp;COLOR_LST, &amp;amp;I);&lt;BR /&gt;
			%IF &amp;amp;COLOR = %THEN %DO;&lt;BR /&gt;
				%PUT ERROR:  NOT ENOUGH COLORS PROVIDED.;&lt;BR /&gt;
				ENDCOMP; RUN; ODS HTML CLOSE; ODS LISTING;&lt;BR /&gt;
				%RETURN;&lt;BR /&gt;
			%END;&lt;BR /&gt;
			IF PHYID = "&amp;amp;PHYID" THEN CALL DEFINE(_ROW_, "STYLE", "STYLE=[BACKGROUND=&amp;amp;COLOR]");&lt;BR /&gt;
			%LET I = %EVAL(&amp;amp;I+1);&lt;BR /&gt;
		%END;&lt;BR /&gt;
	ENDCOMP;&lt;BR /&gt;
RUN;&lt;BR /&gt;
ODS HTML CLOSE;&lt;BR /&gt;
ODS LISTING;&lt;BR /&gt;
&lt;BR /&gt;
%MEND;&lt;BR /&gt;
%COLOR_REPORT(%STR(LIGHTYELLOW LIGHTRED LIGHTBROWN LIGHTORANGE))&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I just saw _null_’s program and have not yet tried to modify mine accordingly.  It definitely looks like that solution is superior if you can tweak it to make it work.</description>
      <pubDate>Thu, 07 Oct 2010 18:44:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13658#M1631</guid>
      <dc:creator>polingjw</dc:creator>
      <dc:date>2010-10-07T18:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13659#M1632</link>
      <description>It would probably be easier to use a value label format for the colors.  Then you can PUT the ID with the format to produce the color.&lt;BR /&gt;
&lt;BR /&gt;
However, I question the OP's need for a different color for each ID.  It seems like alternating between two colors would be adequate.  Then if two adjacent IDs have dups they are easily distinguished.  I could see having lots of IDs and you’re going to run out of colors.</description>
      <pubDate>Thu, 07 Oct 2010 19:11:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13659#M1632</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-10-07T19:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13660#M1633</link>
      <description>As data _null_ suggested,alternating the colors is also a good idea.have to make changes on your code to see if that's possible.</description>
      <pubDate>Thu, 07 Oct 2010 19:40:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13660#M1633</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-10-07T19:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13661#M1634</link>
      <description>Hi:&lt;BR /&gt;
  There's an easier way with PROC REPORT. Just use the COMPUTE BEFORE PHID to "grab" and save the total number of rows for each PHID -- if you put N on the report as a NOPRINT item, you can test the saved value for each PHID -- no SQL or DATA step needed.&lt;BR /&gt;
           &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
data phid;&lt;BR /&gt;
  infile datalines;&lt;BR /&gt;
  input phid name $  address  $ qty;&lt;BR /&gt;
return;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1001 John Philadephia 25&lt;BR /&gt;
1002 Adams Tampa 30&lt;BR /&gt;
1002 Adams Orlando 30&lt;BR /&gt;
1003 Mark Austin 30&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
                   &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='c:\temp\hilite_row.html' style=sasweb;&lt;BR /&gt;
proc report data=phid nowd;&lt;BR /&gt;
  column phid name address qty n;&lt;BR /&gt;
  define phid / order;&lt;BR /&gt;
  define name / order;&lt;BR /&gt;
  define address / order;&lt;BR /&gt;
  define qty / sum;&lt;BR /&gt;
  define n / 'N' noprint;&lt;BR /&gt;
  compute before phid;&lt;BR /&gt;
     ** grab the count of IDs and save in a temporary variable;&lt;BR /&gt;
     ** the summary for the N statistic is available;&lt;BR /&gt;
     ** at the break for COMPUTE BEFORE PHID;&lt;BR /&gt;
     totid = n;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute phid;&lt;BR /&gt;
     ** test the temporary variable TOTID for every PHID;&lt;BR /&gt;
     if totid gt 1 then do;&lt;BR /&gt;
        call define(_ROW_, 'style', 'style={background=pink}');&lt;BR /&gt;
     end;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 07 Oct 2010 19:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13661#M1634</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-10-07T19:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13662#M1635</link>
      <description>Thanks Cynthia.Trying to see if alternating colors can be assigned if the phyid's are adjacent to each other.</description>
      <pubDate>Thu, 07 Oct 2010 20:06:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13662#M1635</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-10-07T20:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13663#M1636</link>
      <description>Oh, well, somehow I missed that. If I understand what you mean, you want every different PHID to have a different color??? If so, I'd do it another way. See below. You can, of course, build the format list with a program.&lt;BR /&gt;
&lt;BR /&gt;
cynthia&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
** could build this format list dynamically from the data;&lt;BR /&gt;
proc format;&lt;BR /&gt;
  value ph 1001='pink'&lt;BR /&gt;
           1002='yellow'&lt;BR /&gt;
           1003='cx66FFCC';&lt;BR /&gt;
run;&lt;BR /&gt;
                           &lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file='c:\temp\alt_color1.html' style=sasweb;&lt;BR /&gt;
proc report data=phid nowd;&lt;BR /&gt;
  title '1) With this Method, the N statistic is unnecessary';&lt;BR /&gt;
  column phid name address qty ;&lt;BR /&gt;
  define phid / order;&lt;BR /&gt;
  define testphid / computed noprint;&lt;BR /&gt;
  define name / order;&lt;BR /&gt;
  define address / order;&lt;BR /&gt;
  define qty / sum;&lt;BR /&gt;
  compute before phid;&lt;BR /&gt;
     ** just grab and save the PHID value;&lt;BR /&gt;
     holdphid = phid;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute testphid;&lt;BR /&gt;
    ** create the TESTPHID which will be available on every ROW (but NOPRINT);&lt;BR /&gt;
    testphid = holdphid;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute phid;&lt;BR /&gt;
     ** use TESTPHID to set teh color of the STYVAL variable;&lt;BR /&gt;
     length styval $100;&lt;BR /&gt;
     styval = catt('style={background=',put(testphid,ph.),'}');&lt;BR /&gt;
     call define(_ROW_, 'style', styval);&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 07 Oct 2010 21:45:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13663#M1636</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-10-07T21:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13664#M1637</link>
      <description>Based on your last response, it sounds like you now want to just alternate between two colors instead of providing a different color for every duplicate phyid.  If so, this can be accomplished by making some minor modifications to the program posted by _null_.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
DATA TEST;&lt;BR /&gt;
   LENGTH PHYID $ 4 NAME $ 10 ADDRESS $ 15;&lt;BR /&gt;
   INPUT PHYID $ NAME $ ADDRESS $ QTY;&lt;BR /&gt;
   DATALINES;&lt;BR /&gt;
1001 John Philadephia 25&lt;BR /&gt;
1002 Adams Tampa 30&lt;BR /&gt;
1002 Adams Orlando 30&lt;BR /&gt;
1003 Mark Austin 30&lt;BR /&gt;
1004 Adams Tampa 30&lt;BR /&gt;
1004 Adams Orlando 30&lt;BR /&gt;
1004 Mark Austin 30&lt;BR /&gt;
;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
data test(drop=alternate_dup);&lt;BR /&gt;
   set test;&lt;BR /&gt;
   by phyid;&lt;BR /&gt;
   retain alternate_dup 0;&lt;BR /&gt;
   dup  = not(first.phyid and last.phyid);&lt;BR /&gt;
   if dup then do;&lt;BR /&gt;
     dup+alternate_dup;&lt;BR /&gt;
	 if last.phyid and not alternate_dup then alternate_dup = 1;&lt;BR /&gt;
	 else if last.phyid then alternate_dup = 0;&lt;BR /&gt;
   end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ODS LISTING CLOSE;&lt;BR /&gt;
ODS HTML FILE='TEST.HTML' STYLE=MINIMAL;&lt;BR /&gt;
&lt;BR /&gt;
PROC REPORT DATA=TEST NOWINDOWS list;&lt;BR /&gt;
	COLUMNS dup PHYID NAME ADDRESS QTY;&lt;BR /&gt;
   define dup / noprint display;&lt;BR /&gt;
   define phyid / order;&lt;BR /&gt;
	COMPUTE PHYID;&lt;BR /&gt;
      IF dup = 1 THEN CALL DEFINE(_ROW_, "STYLE", "STYLE=[BACKGROUND=HONEYDEW]");&lt;BR /&gt;
      IF dup = 2 THEN CALL DEFINE(_ROW_, "STYLE", "STYLE=[BACKGROUND=lightyellow]");&lt;BR /&gt;
      ENDCOMP;&lt;BR /&gt;
RUN;&lt;BR /&gt;
ods HTML Close;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Hopefully, either the report is not very long or having duplicates observations of the phyid variable is a rare event.  Otherwise, I suspect that you might run into some performance issues.  I remember that I once produced a long detail report using proc report and the RTF destination (about 100 legal size sheets of paper).  To improve readability of the report, I tried to modify the background color on every other report row.  After I had a working program, proc report took nearly an hour to run.  &lt;BR /&gt;
&lt;BR /&gt;
Not that it makes a difference now but, has anyone else had performance issues when doing similar tasks with proc report?</description>
      <pubDate>Mon, 11 Oct 2010 18:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13664#M1637</guid>
      <dc:creator>polingjw</dc:creator>
      <dc:date>2010-10-11T18:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report &amp; Color code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13665#M1638</link>
      <description>this looks good for now.i will let you if there is any performance issue should i run into any.</description>
      <pubDate>Mon, 11 Oct 2010 18:30:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Color-code/m-p/13665#M1638</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2010-10-11T18:30:10Z</dc:date>
    </item>
  </channel>
</rss>

