<?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 Proc Report Compute to Change Text Color in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Compute-to-Change-Text-Color/m-p/167900#M43486</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought this code would change the font color of a fieldf based on the value of another field in the columns:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compute id_rssd;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if changed_event = '0' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define (_col_, 'style', 'style=[foreground=blue]');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if changed_event = '1' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define (_col_, 'style', 'style=[foreground=green]');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it didn't do anything.&amp;nbsp; The text came out black.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Jan 2015 20:36:44 GMT</pubDate>
    <dc:creator>mikersas</dc:creator>
    <dc:date>2015-01-02T20:36:44Z</dc:date>
    <item>
      <title>Proc Report Compute to Change Text Color</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Compute-to-Change-Text-Color/m-p/167900#M43486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought this code would change the font color of a fieldf based on the value of another field in the columns:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compute id_rssd;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if changed_event = '0' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define (_col_, 'style', 'style=[foreground=blue]');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if changed_event = '1' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define (_col_, 'style', 'style=[foreground=green]');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it didn't do anything.&amp;nbsp; The text came out black.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2015 20:36:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Compute-to-Change-Text-Color/m-p/167900#M43486</guid>
      <dc:creator>mikersas</dc:creator>
      <dc:date>2015-01-02T20:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Compute to Change Text Color</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Compute-to-Change-Text-Color/m-p/167901#M43487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because id_rssd is before changed_event in COLUMN,&amp;nbsp; you can't ask change something behind id_rssd when you compute id_rssd .so change compute name .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;compute &lt;STRONG style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;changed_event&lt;/STRONG&gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if changed_event = '0' then do;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define (_col_, 'style', 'style=[foreground=blue]');&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if changed_event = '1' then do;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define (_col_, 'style', 'style=[foreground=green]');&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;endcomp;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;And better post questions about proc report at &lt;A _jive_internal="true" data-containerid="2007" data-containertype="14" data-objectid="6" data-objecttype="14" href="https://communities.sas.com/community/support-communities/ods_and_base_reporting" style="color: #0e66ba; background-color: #f0f8fb;"&gt;ODS and Base Reporting&lt;/A&gt;&amp;nbsp; later on. Cynthia will give you professional service .&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2015 07:37:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Compute-to-Change-Text-Color/m-p/167901#M43487</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-03T07:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Compute to Change Text Color</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Compute-to-Change-Text-Color/m-p/167902#M43488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No improvement.&lt;/P&gt;&lt;P&gt;I also tried the following but it didn't help either:&lt;/P&gt;&lt;P&gt;Let me better explain what I'm trying to do:&lt;/P&gt;&lt;P&gt;I've got to define a display field to point to a url (this is working).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;compute rssd_url;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define ('id_rssd','url',rssd_url);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endcomp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then need to change the color of the text based on the value of another field (which is &lt;STRONG&gt;not&lt;/STRONG&gt; working):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;compute id_rssd;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If changed_event = '0' then do:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define (_col_, 'style', 'style=[foreground=blue]');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If changed_event = '1' then do;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call define (_col_, 'style', 'style=[foreground=green]');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endcomp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 16:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Compute-to-Change-Text-Color/m-p/167902#M43488</guid>
      <dc:creator>mikersas</dc:creator>
      <dc:date>2015-01-05T16:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Compute to Change Text Color</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Compute-to-Change-Text-Color/m-p/167903#M43489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then post some sample data and code as short as you can , so I can test if it is worked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 06:47:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Compute-to-Change-Text-Color/m-p/167903#M43489</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-06T06:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Compute to Change Text Color</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Compute-to-Change-Text-Color/m-p/167904#M43490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; It is not entirely clear to me what you want to do. It seems that you want to do 2 things in 1 cell -- make the cell contents a clickable hyperlink and change the color of the text in the cell. But, depending on the destination, you may not be able to change the color of URL text. URL hyperlinks are generally set off from "regular" text in some way, like this: &lt;A href="http://www.sas.com/"&gt;http://www.sas.com&lt;/A&gt; -- note how most of my text is black but the hyperlink is colored blue. Once you designate some text as a hyperlink, it takes on the hyperlink characteristics. I do not believe you can change the color. You might check with Tech Support, though. For HTML-based destinations, there are some style attributes LINKCOLOR and VISITEDLINKCOLOR that I believe will work to change the color of hyperlink/URL text, but I notice that you are not creating HTML output, so I don't think that LINKCOLOR will work with TAGSETS.EXCELXP -- but that is a question for Tech Support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 14:29:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Compute-to-Change-Text-Color/m-p/167904#M43490</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-01-06T14:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Compute to Change Text Color</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Compute-to-Change-Text-Color/m-p/167905#M43491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It works if &lt;EM&gt;changed_event&lt;/EM&gt; is placed before &lt;EM&gt;id_rssd&lt;/EM&gt; in the columns statement and if you do it all in one compute statement:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="CorrectCompute.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/8586_CorrectCompute.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 15:54:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Compute-to-Change-Text-Color/m-p/167905#M43491</guid>
      <dc:creator>mikersas</dc:creator>
      <dc:date>2015-01-06T15:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Compute to Change Text Color</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Compute-to-Change-Text-Color/m-p/167906#M43492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; That makes sense. CHANGED_EVENT would have to appear &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;before&lt;/STRONG&gt;&lt;/SPAN&gt; ID_RSSD in the column statement for the COMPUTE block to work. PROC REPORT works on a left-to-right basis and it only generates 1 report row at a time, one column at a time. So if you have this COLUMN statement:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;column name age height weight;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Then, based on how PROC REPORT works, in a COMPUTE block for NAME, you could NOT test AGE. That's because at the point in time when PROC REPORT is writing NAME to the report row, it has not yet written AGE. So AGE is technically NOT available to be tested.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; But if you had this COLUMN statement:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;column age name height weight;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; Then, you COULD test AGE in the COMPUTE block for NAME because at the point in time when NAME is being handled, the value for AGE has already been put on the report row. PROC REPORT does NOT have a "program data vector" like a DATA step program, so there is only visibility of what has been placed on the report row, working from left to right, based on the COLUMN statement order of variables.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is something about PROC REPORT that is explained in the documentation and in our Report Writing class. The relevant documentation topics are: "Concepts: REPORT Procedure"&lt;BR /&gt; and "How Proc Report Builds A Report" -- you should be able to find them for your version of SAS by searching on the support.sas.com web site.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 19:22:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Report-Compute-to-Change-Text-Color/m-p/167906#M43492</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-01-06T19:22:26Z</dc:date>
    </item>
  </channel>
</rss>

