<?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 color cells value based on variable value in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590065#M23283</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have done a proc compare bettween 2 datasets.&amp;nbsp; i select variables of values that have changed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;my aim is to highlights those changed values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in my compare datasets i have a new variable : "datflag" that contains the variables that had been modified for each row.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now with proc report i want to color those values cells.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My idea is to search in this variable datflag and color the variable cells :&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32608i06D54C29EBAEABA7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;My dataset like : E.g if "VAR22" in "DATFLAG" then color the 4th cells of variable "VAR22"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 328px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32612iFC22DDB7A87AB5DC/image-dimensions/328x236?v=v2" width="328" height="236" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I&amp;nbsp;want to do it with an array in proc compute that, loop for each variable . but array didn't work .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any Suggestions ..&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2019 15:35:13 GMT</pubDate>
    <dc:creator>amager</dc:creator>
    <dc:date>2019-09-19T15:35:13Z</dc:date>
    <item>
      <title>color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590065#M23283</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have done a proc compare bettween 2 datasets.&amp;nbsp; i select variables of values that have changed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;my aim is to highlights those changed values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in my compare datasets i have a new variable : "datflag" that contains the variables that had been modified for each row.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now with proc report i want to color those values cells.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My idea is to search in this variable datflag and color the variable cells :&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32608i06D54C29EBAEABA7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;My dataset like : E.g if "VAR22" in "DATFLAG" then color the 4th cells of variable "VAR22"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 328px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32612iFC22DDB7A87AB5DC/image-dimensions/328x236?v=v2" width="328" height="236" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I&amp;nbsp;want to do it with an array in proc compute that, loop for each variable . but array didn't work .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any Suggestions ..&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 15:35:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590065#M23283</guid>
      <dc:creator>amager</dc:creator>
      <dc:date>2019-09-19T15:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590067#M23284</link>
      <description>&lt;P&gt;Please show us the entire LOG (not just the errors or warnings) for this PROC, as text, not as an image. Please preserve the formatting and make it readable by clicking on the {i} icon and pasting the text of the log into that window.&amp;nbsp;&lt;STRONG&gt;Please do not skip this step.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, show us a portion of your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note for the future, when you say "it didn't work", that's never enough information. We usually will need to see the code/log and probably a portion of your data.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 15:30:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590067#M23284</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-19T15:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590073#M23285</link>
      <description>Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13573"&gt;@Paige&lt;/a&gt; , "didin't work" means no error no warning but no highlighting color in output html. Sorry i can't give any portion of data because it's private. i'm answering for any explantions</description>
      <pubDate>Thu, 19 Sep 2019 15:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590073#M23285</guid>
      <dc:creator>amager</dc:creator>
      <dc:date>2019-09-19T15:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590096#M23286</link>
      <description>We don't need real data. Show your code and if you can't share data test it it on SASHELP.CLASS and show that code. It's also a good way to debug - when doing this I often find the answer before posting my questions.</description>
      <pubDate>Thu, 19 Sep 2019 16:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590096#M23286</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-19T16:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590102#M23287</link>
      <description>&lt;P&gt;I found why index parameters was switched. now i can color the cells of the variable if it found in "datflag". BUT, must set all colonne in the compute of dataflag variable. if anyone have a best solution ??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 790px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32614i1017D4017B0EF586/image-dimensions/790x104?v=v2" width="790" height="104" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;But, i have an error with the numeric variable "Unit_amount " .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR : invalid column specification in call define.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080"&gt;i check in column statement, the variable 'unit_amount' is declared. if set without quote can pass with any error, E.G :&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call define( Unit_amount,'style', ...)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Any help ?!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 16:30:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590102#M23287</guid>
      <dc:creator>amager</dc:creator>
      <dc:date>2019-09-19T16:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590103#M23288</link>
      <description>Is it an ACROSS variable? &lt;BR /&gt;Where is it located in the COLUMN list? That can affect the usage. &lt;BR /&gt;</description>
      <pubDate>Thu, 19 Sep 2019 16:32:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590103#M23288</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-19T16:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590105#M23289</link>
      <description>is not an ACROSS variable, indeed,is declared both in column and define statements.</description>
      <pubDate>Thu, 19 Sep 2019 16:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590105#M23289</guid>
      <dc:creator>amager</dc:creator>
      <dc:date>2019-09-19T16:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590111#M23290</link>
      <description>&lt;P&gt;I repeat that we need to see the log for the ENTIRE PROC, not just the part where you think the error is. And we would like it as text, please, and not a screen capture.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 16:51:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590111#M23290</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-19T16:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590112#M23291</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11076"&gt;@amager&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;is not an ACROSS variable, indeed,is declared both in column and define statements.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And now you know one reason you were asked to post the entire code. We are having to pull details, such as column position, one item at a time because you did not post the actual entire code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Report is very order dependent. The procedure builds the actual report from left to right using the column order. Any thing done in a variable call define block that references a variable to the right of that column does not "work" as that value is not available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also the roles of specific variables can limit what use may be made. So&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" size="4"&gt;&lt;STRONG&gt;Post the entire Proc Report code.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 16:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590112#M23291</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-19T16:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590123#M23292</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt;Yes, AND as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; has indicated, the order of the variables in the COLUMN statement and the usage of the variable (DISPLAY, ORDER, GROUP, SUM, etc) will both impact how you do the coding in your COMPUTE block.&lt;BR /&gt;&lt;BR /&gt;Please search in the forum for previous postings on "left-to-right" rule or "left to right" rule. There have been several postings that show how the COLUMN statement order impacts your COMPUTE, like this one &lt;A href="https://communities.sas.com/t5/SAS-Programming/PROC-REPORT-COMPUTE/td-p/477670" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/PROC-REPORT-COMPUTE/td-p/477670&lt;/A&gt;&lt;BR /&gt;Cynthia&lt;BR /&gt;&lt;BR /&gt;Here's a program that illustrates how COLUMN order makes a difference:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title '1) Example left-to-right rule NOT work for Alfred';
title2 'because of left to right rule about COLUMN statement';
proc report data=sashelp.class;
  column age sex name height weight ;
  define age / display;
  define sex / display;
  define name / order;
  define height / display;
  define weight / display;
  compute age;
    if name = 'Alfred' then
	   call define(_col_,'style','style={background=lightyellow}');
  endcomp;
  compute weight;
    if name in ('Alice' 'Henry') then
	   call define(_col_,'style','style={background=lightblue}');
  endcomp;
run;
  
title '2) Example left-to-right rule NOW works for all';
proc report data=sashelp.class;
  column age sex name height weight ;
  define age / display;
  define sex / display;
  define name / order;
  define height / display;
  define weight / display;
  compute weight;
    if name in ('Alice' 'Henry') then
	   call define(_col_,'style','style={background=lightblue}');
    else if name = 'Alfred' then
	   call define('name','style','style={background=lightyellow}');
  endcomp;
run;

  
title '3) Example left-to-right rule with dummy var';
title2 'Variable at end of COLUMN statement can "touch" all other items on the row';
proc report data=sashelp.class;
  column age sex name height weight dummy;
  define age / display;
  define sex / display;
  define name / order;
  define height / display;
  define weight / display;
  define dummy / computed noprint;
  compute dummy;
    dummy=1;
    if name = 'Barbara' then do;
	   call define('name','style','style={background=lightgreen}');
	   call define('height','style','style={background=lightred}');
	   call define('weight','style','style={background=lightblue}');
    end;
    else if name = 'Alfred' then
	   call define('name','style','style={background=lightyellow}');
    else if name in ('Alice' 'Henry') then
	   call define('weight','style','style={background=lightblue}');
  endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Sep 2019 17:20:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590123#M23292</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-09-19T17:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590132#M23294</link>
      <description>Paige, i would to but i work from a virtual machine copy-paste didn't work ,,sorry.</description>
      <pubDate>Thu, 19 Sep 2019 17:33:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590132#M23294</guid>
      <dc:creator>amager</dc:creator>
      <dc:date>2019-09-19T17:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590174#M23301</link>
      <description>I still think our comments are valid. You need to make a reproducible example we can work with. If you can't from your system, use SAS OnDemand for Academics, create an example and test it there. Once you have it working, you can apply it to your actual data. Otherwise, you can consider talking to a colleague or SAS tech support directly to get help, since you should be allowed to share the data with them. &lt;BR /&gt;</description>
      <pubDate>Thu, 19 Sep 2019 19:57:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/590174#M23301</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-19T19:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/591214#M23327</link>
      <description>&lt;P&gt;HI,&amp;nbsp;Voilà my proc report , I wonder why the datflag variable can be coloried and datflagN No.. something wrong here ?!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc report data= data_dif  nowd out=work.test02
style(header) = [ background = $col_header. font_size= 10pt ];
column STUDY NAMING_CONVENTION_CHANGE DTER	DELIVERABLE_UNIT_CODE UNIT_AMOUNT Planned_delivery_date
STUDY_MILESTONES IRIS_COMMENT CRO_COMMENTS AGREEMENT_CRO_ON_ORDER EFFECTIVE_DELIVERY_DATE	
DELIVERED_AMOUNT STATUS	IRIS_ACCEPTATION KPI1_VOLUME KPI2_DELAY	KPI3_QUALITY QUALITY_DETAILS
DATE_OF_INVOICE	STADE_PGM1_PGM2	DELETED Record_Type datflag datflagn;

define	STUDY 					 /    style(header) = [ background =lightblue font_size= 10pt ] ;	
define 	NAMING_CONVENTION_CHANGE /    style(header) = [ background =lightblue font_size= 10pt ] ;	
define 	DTER 					 /    style(header) = [ background =lightblue font_size= 10pt ] ;	
define	DELIVERABLE_UNIT_CODE 	 /    style(header) = [ background =lightblue font_size= 10pt ] ;	
define	UNIT_AMOUNT				 /    style(header) = [ background =lightblue font_size= 10pt ] ;	
define	Planned_delivery_date	 /    style(header) = [ background =lightblue font_size= 10pt ] ;	
define	STUDY_MILESTONES		 /    style(header) = [ background =lightblue font_size= 10pt ] ;	
define	IRIS_COMMENT			 /    style(header) = [ background =lightblue font_size= 10pt ]  ;	
define	CRO_COMMENTS			 /    style(header) = [ background =lightgreen font_size= 10pt ] ;	
define	AGREEMENT_CRO_ON_ORDER	 /    style(header) = [ background =lightgreen font_size= 10pt ] ;	
define	EFFECTIVE_DELIVERY_DATE	 /    style(header) = [ background =lightgreen font_size= 10pt ] ;	
define	DELIVERED_AMOUNT		 /    style(header) = [ background =lightgreen font_size= 10pt ] ;	
define	STATUS					 /    style(header) = [ background =lightgreen font_size= 10pt ] ;	
define	IRIS_ACCEPTATION		 /    style(header) = [ background =lightblue font_size= 10pt ] ;	
define	KPI1_VOLUME				 /    style(header) = [ background =lightgreen font_size= 10pt ] ;	
define	KPI2_DELAY				 /    style(header) = [ background =lightgreen font_size= 10pt ] ;	
define	KPI3_QUALITY			 /    style(header) = [ background =lightblue font_size= 10pt ] ;	
define	QUALITY_DETAILS			 /    style(header) = [ background =lightblue font_size= 10pt ] ;	
define	DATE_OF_INVOICE			 /    style(header) = [ background =lightgreen font_size= 10pt ] ;	
define	STADE_PGM1_PGM2			 /    style(header) = [ background =lightgreen font_size= 10pt ] ;	
define	DELETED					 /    style(header) = [ background =lightblue font_size= 10pt ] ;	
define	Record_Type				 /    style(header) = [ background =red font_size= 10pt ] ;	

compute Record_Type; 
		if 	  Record_Type in  ("Manuel" "M" )   then call define(_row_,"style","style={background=Lightred}") ;
		if 	  Record_Type in  ("Automatique" "A")    then call define(_row_,"style","style={background=Lightblue}") ;
endcomp; 
 compute CRO_COMMENTS; 
	call define(_COL_,"style","style={background=lightgreen}"); 
endcomp;
compute AGREEMENT_CRO_ON_ORDER; 
	call define(_COL_,"style","style={background=lightgreen}"); 
endcomp;
compute EFFECTIVE_DELIVERY_DATE; 
 	call define(_COL_,"style","style={background=lightgreen}"); 
endcomp;
compute DELIVERED_AMOUNT; 
	call define(_COL_,"style","style={background=lightgreen}"); 
endcomp;
compute STATUS; 
	call define(_COL_,"style","style={background=lightgreen}"); 
endcomp;
compute KPI1_VOLUME; 
	call define(_COL_,"style","style={background=lightgreen}"); 
endcomp;
compute KPI2_DELAY; 
	call define(_COL_,"style","style={background=lightgreen}"); 
endcomp;
compute DATE_OF_INVOICE; 
	call define(_COL_,"style","style={background=lightgreen}"); 
endcomp;
compute STADE_PGM1_PGM2; 
	call define(_COL_,"style","style={background=lightgreen}"); 
endcomp;
compute datflagn; 
	 if index(datflagn,'UNIT_AMOUNT')  then  call define(UNIT_AMOUNT,"style","style={background=red}");
	 if index(datflagn,'PLANNED_DELIVERY_DATE')  then  call define(PLANNED_DELIVERY_DATE,"style","style={background=red}"); 
endcomp;
compute datflag; 
	 if index(datflag,'DTER')  				    then  call define("DTER","style","style={background=red}"); 
	 if index(datflag,'DELIVERABLE_UNIT_CODE')  then  call define("DELIVERABLE_UNIT_CODE","style","style={background=red}"); 
	 if index(datflag,'STUDY_MILESTONES')  		then  call define("STUDY_MILESTONES","style","style={background=red}"); 
	 if index(datflag,'IRIS_COMMENTS')  		then  call define("IRIS_COMMENTS","style","style={background=red}"); 
	 if index(datflag,'CRO_COMMENTS')  			then  call define("CRO_COMMENTS","style","style={background=red}"); 
	 if index(datflag,'AGREEMENT_CRO_ON_ORDER') then  call define("AGREEMENT_CRO_ON_ORDER","style","style={background=red}"); 
	 if index(datflag,'STATUS')  				then  call define("STATUS","style","style={background=red}"); 
	 if index(datflag,'IRIS_ACCEPTATION')  		then  call define("IRIS_ACCEPTATION","style","style={background=red}"); 
endcomp;


run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Sep 2019 16:21:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/591214#M23327</guid>
      <dc:creator>amager</dc:creator>
      <dc:date>2019-09-24T16:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/591868#M23334</link>
      <description>Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;, Can help me in this report with my code below. why numeric variable didn't display but the character variables can ? .</description>
      <pubDate>Thu, 26 Sep 2019 14:22:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/591868#M23334</guid>
      <dc:creator>amager</dc:creator>
      <dc:date>2019-09-26T14:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/591907#M23335</link>
      <description>the entire Proc Report code in the last comments.</description>
      <pubDate>Thu, 26 Sep 2019 15:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/591907#M23335</guid>
      <dc:creator>amager</dc:creator>
      <dc:date>2019-09-26T15:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/591917#M23336</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Sorry -- there's no clue in your code which variables are numeric and which are character. Usually, I can tell based on the usage, but your DEFINE statements don't have a usage, which means that the default usage is involved -- DISPLAY for character and ANALYSIS for numeric (with a default analysis statistic of sum).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; In addition to the left-to-right rule of PROC REPORT, you also have to be aware of the naming conventions for PROC REPORT. GROUP, ORDER or DISPLAY usage items can be referenced in a COMPUTE block by their item names. So for example, in SASHELP.CLASS, the variables NAME and SEX, both character variables would have a default usage of DISPLAY, which means I can refer to them as just NAME and SEX in an IF statement or a CALL DEFINE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; But, AGE, HEIGHT and WEIGHT are numeric variables. If I don't have a usage of DISPLAY or ORDER or GROUP for them in a DEFINE statement, I have to reference them by their "compound" names: AGE.SUM, HEIGHT.SUM and WEIGHT.SUM in an IF statement or a CALL DEFINE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I don't see any usages in your code -- nothing is defined to be either DISPLAY or ORDER or GROUP or ANALYSIS. So that means all the default usages are being used by PROC REPORT. Since your code has only a few clues about which items are numeric and which are character, it's hard to say why you code isn't working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My guess is that these variables are character: datflagn, datflag, Record_Type. I would expect issues with these COMPUTE blocks&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="some_problems.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32754i549FDD5113D1D078/image-size/large?v=v2&amp;amp;px=999" role="button" title="some_problems.png" alt="some_problems.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DATFLAGN COMPUTE block will have issues because the 1st argument to CALL DEFINE must be quoted as a variable name if you are not using _COL_ or _ROW_. The DATFLAG COMPUTE block is probably working OK for character variables because you've quoted the variable names in the CALL DEFINE statement. If any of those variables in the COMPUTE blocks are numeric variables, then whether the CALL DEFINE will work ultimately depends on whether you have a usage of DISPLAY or not for the numeric variables. I don't see any usages in your DEFINE statements, so any numeric variables probably are not going to work because numeric variables have a default usage of analysis with the default statistic of SUM. You either need a usage of DISPLAY or you need to use the compound name in your COMPUTE block as shown below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; So, as an example in SASHELP.CLASS if I have THIS for the AGE variable:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;define age / style(header)={background=lightyellow};&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without a default usage my COMPUTE block would need an IF statement like this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;if age.sum ge 14 ...&lt;/FONT&gt;&lt;/STRONG&gt; or&lt;/P&gt;
&lt;P&gt;my CALL DEFINE statement would need to be:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;call define('age.sum','style','...');&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; But, if I have a usage of DISPLAY for the AGE variable:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;define age / &lt;FONT color="#FF00FF"&gt;display&lt;/FONT&gt; style(header)={background=lightyellow};&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then with a usage of DISPLAY, my COMPUTE block would need an IF statement like this:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;if age ge 14 ...&lt;/FONT&gt;&lt;/STRONG&gt; or&lt;/P&gt;
&lt;P&gt;my CALL DEFINE statement would need to be:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;call define('age','style','...');&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;But without data to test with, and without usages in your code, it's really hard to make more than general suggestions. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&amp;nbsp; Try this code and note that #1 does NOT work correctly for the WEIGHT compute block but does work for the HEIGHT compute block. In Example #2, the CALL DEFINE works for both HEIGHT and WEIGHT.&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=sashelp.class;
  title '1) Code for WEIGHT numeric variable NOT work but code for HEIGHT is OK';
  column name age sex height weight;
  define name / style(header)={background=peachpuff};
  define age / style(header)={background=lightyellow};
  define sex / style(header)={background=peachpuff};
  define height / style(header)={background=lightyellow};
  define weight / style(header)={background=lightyellow};
  compute height;
     if age.sum ge 13 and height.sum gt 65 and name ne 'Alfred' then do;
	   call define(_col_,'style','style={font_weight=bold color=green font_size=14pt');
	   call define('name','style','style={font_weight=bold color=green font_size=14pt');
     end;
	 else if name = 'Alfred' then do;
	   call define('name','style','style={font_weight=bold color=red font_size=14pt');
	   call define(_col_,'style','style={font_weight=bold color=red font_size=14pt');
	 end;
  endcomp;
  compute weight;
    if age lt 15 and weight gt 100 then do;
	   call define(_col_,'style','style={font_weight=bold color=purple font_size=14pt');
	   call define('sex','style','style={font_weight=bold color=purple font_size=14pt');
	   call define('name','style','style={font_weight=bold color=purple font_size=14pt');
     end;
  endcomp;
run;

proc report data=sashelp.class;
  title '2) Use compound name for numeric variables with default usage';
  column name age sex height weight;
  define name / style(header)={background=peachpuff};
  define age / style(header)={background=lightyellow};
  define sex / style(header)={background=peachpuff};
  define height / style(header)={background=lightyellow};
  define weight / style(header)={background=lightyellow};
  compute height;
     if age.sum ge 13 and height.sum gt 65 and name ne 'Alfred' then do;
	   call define(_col_,'style','style={font_weight=bold color=green font_size=14pt');
	   call define('name','style','style={font_weight=bold color=green font_size=14pt');
     end;
	 else if name = 'Alfred' then do;
	   call define('name','style','style={font_weight=bold color=red font_size=14pt');
	   call define(_col_,'style','style={font_weight=bold color=red font_size=14pt');
	 end;
  endcomp;
  compute weight;
    if age.sum lt 15 and weight.sum gt 100 then do;
	   call define(_col_,'style','style={font_weight=bold color=purple font_size=14pt');
	   call define('sex','style','style={font_weight=bold color=purple font_size=14pt');
	   call define('name','style','style={font_weight=bold color=purple font_size=14pt');
     end;
  endcomp;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Hope this helps,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Cynthia&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 16:29:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/591917#M23336</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-09-26T16:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: color cells value based on variable value</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/592184#M23340</link>
      <description>this the answer for my question : &lt;BR /&gt;"If any of those variables in the COMPUTE blocks are numeric variables, then whether the CALL DEFINE will work ultimately depends on whether you have a usage of DISPLAY or not for the numeric variables."&lt;BR /&gt;THANK YOU @ Cynthia_sas,</description>
      <pubDate>Fri, 27 Sep 2019 14:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/color-cells-value-based-on-variable-value/m-p/592184#M23340</guid>
      <dc:creator>amager</dc:creator>
      <dc:date>2019-09-27T14:48:14Z</dc:date>
    </item>
  </channel>
</rss>

