<?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 : Excel ODS Color code Display based on the String contains in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/690227#M209971</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I was working on this before you posted your information. Something like this should work. Just make a helper variable (in my example, called HILITE) that is used to perform the color coding of the cell:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1602199139697.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50401i94B2214E6D4D4013/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1602199139697.png" alt="Cynthia_sas_0-1602199139697.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
    <pubDate>Thu, 08 Oct 2020 23:19:24 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2020-10-08T23:19:24Z</dc:date>
    <item>
      <title>proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689785#M209710</link>
      <description>&lt;P&gt;I output my sas data to ods Excel format, I have a requirement that if the variable contains a certain string, I need to do some kind of color coding ( background color, or change the color of the font) to display in excel file. I do have the idea of doing it in compute block for numeric variable &amp;gt; or &amp;lt; conditions. Never done strings, please suggest some ideas, Example coding in the compute block of proc report or directing to sources also greatly appreciated. Thanks. I am attaching the sample of how I want Variable 1, how it is there in my data. variable2 is how I want to show in excel output, If the string contains "continuous" I need to do background color yellow and/or font in red.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_0-1602116831321.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50330i05066B8661F11436/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASuserlot_0-1602116831321.png" alt="SASuserlot_0-1602116831321.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 00:28:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689785#M209710</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T00:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689809#M209721</link>
      <description>&lt;P&gt;In a Proc Report, try the following COMPUTE block:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;COMPUTE	Variable2;
	IF	INDEX(UPCASE(Variable2), 'CONTINUOUS')	THEN
		CALL DEFINE(_COL_, "style", "STYLE=[BACKGROUD=YELLOW]");
ENDCOMP; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 02:06:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689809#M209721</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-08T02:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689819#M209723</link>
      <description>&lt;P&gt;tried no luck, but its not throwing error either. attaching code, second pic is the how variable look in dataset, third excel output&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; PROC REPORT data=sdsp5 nowindows&lt;BR /&gt;style(report)=[font=("Times New Roman", 11pt) protectspecialchars=on]&lt;BR /&gt;style(header)=[font=("Times New Roman", 11pt, bold) just=center protectspecialchars=on]&lt;BR /&gt;style(column)=[font=("Times New Roman", 11pt) protectspecialchars=on];  &lt;BR /&gt;.............&lt;BR /&gt;..............&lt;BR /&gt;...............  &lt;BR /&gt;      DEFINE Study_Design/ "" display style=[just=c vjust=t cellwidth=8.882cm tagattr='type:String format:Text'];
      DEFINE Study_status /" " display style=[just=c vjust=t cellwidth=2.718cm tagattr='type:String format:Text'];
      DEFINE Study_start_date /"" display style=[just=c vjust=t cellwidth=2.818cm tagattr='type:String format:Text'];
      DEFINE Exchange_standards /"" display style=[just=c vjust=t cellwidth=3.212cm tagattr='type:String format:Text'];
      DEFINE terminology_standards /"" display style=[just=c vjust=t cellwidth=4.643cm tagattr='type:String format:Text'];
%end;
	compute before hline/ style=[font=("Times New Roman", 11pt, bold) ];
	 line @140 hline $100.;
	 if index((Study_design),"[Missing]") then call define(_col_, "style","style=[Background=Yellow]");
	endcomp;
   RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_0-1602123760193.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50339i78C37027C94C965D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASuserlot_0-1602123760193.png" alt="SASuserlot_0-1602123760193.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_1-1602123795089.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50340i7D2697696D0A3146/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASuserlot_1-1602123795089.png" alt="SASuserlot_1-1602123795089.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 02:23:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689819#M209723</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T02:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689822#M209725</link>
      <description>&lt;P&gt;Is that your entire Proc Report definition?&amp;nbsp; I am used to seeing COLUMN definitions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I'm used to seeing &lt;FONT face="courier new,courier"&gt;COMPUTE Study_Design&lt;/FONT&gt; if I'm doing a call define for the column Study_Design.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 02:32:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689822#M209725</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-08T02:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689823#M209726</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; PROC REPORT data=sdsp5 nowindows
       style(report)=[font=("Times New Roman", 11pt) protectspecialchars=on]
      style(header)=[font=("Times New Roman", 11pt, bold) just=center protectspecialchars=on]
      style(column)=[font=("Times New Roman", 11pt) protectspecialchars=on];
/*	  by ph ;*/
	  where &amp;amp;ph;
      COLUMN ph Hline Study_Identifier brief_title Study_Design Study_status Study_start_date
	   		 Exchange_standards terminology_standards;
      DEFINE ph/ " " group noprint style=[just=c vjust=t cellwidth=2.745cm tagattr='type:String format:Text'];
      DEFINE Hline/ " " group noprint style=[font=("Times New Roman",11pt)just=c vjust=t vjust=t cellwidth=2.745cm tagattr='type:String format:Text'];
 %if &amp;amp;phx=1 %then %do;
      DEFINE Study_Identifier/"Study Identifier" display style=[just=l vjust=t cellwidth=2cm tagattr='type:String format:Text'];
      DEFINE brief_title/ "Brief Title" display style=[just=c vjust=t cellwidth=3.882cm tagattr='type:String format:Text'];
      DEFINE Study_Design/ "Study Design" display style=[just=c vjust=t cellwidth=5.882cm tagattr='type:String format:Text'];
      DEFINE Study_status /" Study Status" display style=[just=c vjust=t cellwidth=2.718cm tagattr='type:String format:Text'];
      DEFINE Study_start_date /"Study Start Date" display style=[just=c vjust=t cellwidth=2.818cm tagattr='type:String format:Text'];
      DEFINE Exchange_standards /"Exchange standards" display style=[just=c vjust=t cellwidth=3.212cm tagattr='type:String format:Text'];
      DEFINE terminology_standards /"Terminology Standards" display style=[just=c vjust=t cellwidth=4.643cm tagattr='type:String format:Text'];
  %end;

%else %do;
      DEFINE Hline/ " " group noprint style=[font=("Times New Roman",11pt)just=c vjust=t cellwidth=2.745cm tagattr='type:String format:Text'];
      DEFINE Study_Identifier/"" display style=[just=l vjust=t cellwidth=2cm tagattr='type:String format:Text'];
      DEFINE brief_title/ "" display style=[just=c vjust=t cellwidth=3.882cm tagattr='type:String format:Text'];
      DEFINE Study_Design/ "" display style=[just=c vjust=t cellwidth=8.882cm tagattr='type:String format:Text'];
      DEFINE Study_status /" " display style=[just=c vjust=t cellwidth=2.718cm tagattr='type:String format:Text'];
      DEFINE Study_start_date /"" display style=[just=c vjust=t cellwidth=2.818cm tagattr='type:String format:Text'];
      DEFINE Exchange_standards /"" display style=[just=c vjust=t cellwidth=3.212cm tagattr='type:String format:Text'];
      DEFINE terminology_standards /"" display style=[just=c vjust=t cellwidth=4.643cm tagattr='type:String format:Text'];
%end;
	compute before hline/ style=[font=("Times New Roman", 11pt, bold) ];
	 line @140 hline $100.;
	IF	INDEX(UPCASE(Study_design), "[MISSING]")	THEN
		CALL DEFINE(_COL_, "style", "STYLE=[BACKGROUD=YELLOW]");
	endcomp;
   RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Oct 2020 02:35:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689823#M209726</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T02:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689827#M209730</link>
      <description>&lt;P&gt;I created as macro&amp;nbsp; first part&amp;nbsp; defines displays the headings and variables of one group later part only display the variables of different groups.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 02:40:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689827#M209730</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T02:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689828#M209731</link>
      <description>&lt;P&gt;Background appears to be misspelled.&amp;nbsp; We should correct that first.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	compute before hline/ style=[font=("Times New Roman", 11pt, bold) ];
	 line @140 hline $100.;
	IF	INDEX(UPCASE(Study_design), "[MISSING]")	THEN
		CALL DEFINE(_COL_, "style", "STYLE=[BACKGROUD=YELLOW]");
	endcomp;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And what is this code in the COMPUTE block doing?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	 line @140 hline $100.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 02:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689828#M209731</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-08T02:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689833#M209735</link>
      <description>&lt;P&gt;line is creating the header as hline variable in the excel sheet at row 4 for particular group and other places and and its alignment and row 3 is the overall heading for all studies&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_0-1602125997627.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50342i3A9392E7706353E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASuserlot_0-1602125997627.png" alt="SASuserlot_0-1602125997627.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 03:00:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689833#M209735</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T03:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689838#M209739</link>
      <description>&lt;P&gt;tried with correct spelling , no change.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 03:07:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689838#M209739</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T03:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689860#M209755</link>
      <description>&lt;P&gt;For testing remove any macro elements and use a reduced data set, or just plain new data with just one or two variables.&lt;/P&gt;
&lt;P&gt;get the color coding to work. Then build back to the bigger picture.&lt;/P&gt;
&lt;P&gt;If the question involves specific VALUES of a variable one way is to consider a format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Proc format;
value $mytextcolor
"Home" = 'pink'
"Street" = 'yellow'
;

data example;
   input row word $;
datalines;
1  Sometext
2  Home
3  .
4  Street
;

proc report data=example;
   columns row word;
   define word/display style={background=$mytextcolor.};
run;
&lt;/PRE&gt;
&lt;P&gt;You could use any of the SAS color naming conventions in the format.&lt;/P&gt;
&lt;P&gt;And if your values are actually missing, instead placing a text value placed in them you could use two formats.&lt;/P&gt;
&lt;PRE&gt;Proc format;
value $mytextcolor
"Home" = 'pink'
"Street" = 'yellow'
"Missing"     = 'red'
;
value $mytextvalue
" " = "Missing"
;
run;
data example;
   input row word $;
datalines;
1  Sometext
2  Home
3  .
4  Street
;

proc report data=example;
   columns row word;
   define word/display style={background=$mytextcolor.}
               format=$mytextvalue.
   ;
   
run;
&lt;/PRE&gt;
&lt;P&gt;The background color format uses the formatted value of the variable to determine the color.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may have to share the ODS EXCEL destination code at some point.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 04:25:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689860#M209755</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-10-08T04:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689953#M209805</link>
      <description>&lt;P&gt;your suggestion helpful but I still want to display the "Missing" my shells and color code when the shell work containing&amp;nbsp; this word.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 12:46:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689953#M209805</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T12:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689965#M209811</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The point is that if the sample program works for you to produce color coding as per the program, then you should be able to make color coding work with your data. But it is your data that I have a question about:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1602163328084.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50353i483D7EC3AED4B1EC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1602163328084.png" alt="Cynthia_sas_0-1602163328084.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Is this really your data? It looks like your data has ODS ESCAPECHAR control strings (like ^n or line feed) inside the data value. In your screen shot are you showing 1 column's value or is Missing in one column and ^nControl in another column? What about the second line? Is that one column or 3 or 4 columns? Your data does not make sense. However IF your text value is one column's value and IF you only want the word MISSING to be highlighted then you need to work with inline formatting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; But without some real sample data and a program that is not already macro-ized, you are only providing part of the picture. We'd also need your ODS EXCEL statements and to see ALL of the ODS EXCEL sub-options you're using. Your original post showed one value highlighted and in your data, I do not see the value you want highlighted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Based on your very first posting, I was able to generate this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1602164136702.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50356iF66B7B1E6C3F1BE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1602164136702.png" alt="Cynthia_sas_0-1602164136702.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;using this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data fakedata;
  length id $2 variable1 $20 variable2 $20;
  infile datalines dlm=',' dsd;
  input id $ variable1 $ variable2 $;
datalines;
1a,continuous, continuous
2b,constant, continuous
3c,continuous, continuous
4d,viscous, viscous
5e,not now, not now
6f,constant, constant
7g,but not true, but not true
;
run;

proc format;
  value $bkfmt 'continuous' = 'yellow'
              other = 'white';
  value $forefmt 'continuous' = 'red'
                 other = 'black';
run;

ods excel file='c:\temp\usefmt_color.xlsx';
proc report data=fakedata;
  column id variable1 variable2;
  define id / order;
  define variable1 / display;
  define variable2 / display 
         style(column)={background=$bkfmt. color=$forefmt.};
run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; You now have 2 programs that work to produce color coding. If your program is not working as you expect, then either post some simplified code and some real data to the forums so others can understand the exact issue and then please explain what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Thanks for clarifying and providing more context and your exact data.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 13:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689965#M209811</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-10-08T13:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689976#M209815</link>
      <description>&lt;P&gt;First I want to say thank you for looking into my post. I am fan of your ans and post. I still follow your post.&lt;/P&gt;&lt;P&gt;1. I provided my&amp;nbsp; complete proc report section, I providing the excel options used.&lt;/P&gt;&lt;PRE&gt;2.ods ESCAPECHAR = '^';
ods excel file='C:\Users\xxxu\Desktop\New folder\Guy\exa.xlsx' options(sheet_name='leveling'
 sheet_interval='none')&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; The screen shot is the data,&amp;nbsp; &amp;nbsp;I used the^n so that every word after ^n display in next line in excel output&lt;/P&gt;&lt;P&gt;3. The string you seen in screen shot , is one row string, may be its came in the picture like that because I did not widen the width. they string is just made by concatenating the words, separated by "comma"&lt;/P&gt;&lt;P&gt;4. I am&amp;nbsp; not looking for the word to highlight. I am looking if any cell in excel or dataset contains the "missing" , I want to color that. its just to alert me in excel sheet some thing missing in that particular cell. I hope I given information you looking for. Thanks again following the post.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 13:41:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689976#M209815</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T13:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689982#M209819</link>
      <description>&lt;P&gt;I really appreciate you taking take time and created a data set and show me the example. However&amp;nbsp; If you see&amp;nbsp; you fakedata set where you created dataset from excel, the second row is a string that contains the word "continuous constant" so it has to be highlighted or alert with some color. Where as in your dataset you created second row also continuous. so my question is how&amp;nbsp; create the format if you looking for a word in a string.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 13:53:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/689982#M209819</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T13:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/690007#M209830</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350312"&gt;@SASuserlot&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;your suggestion helpful but I still want to display the "Missing" my shells and color code when the shell work containing&amp;nbsp; this word.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So which part does my example not cover???&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have not provided useable&amp;nbsp; data. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;/&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And there is no way we can code against a picture that does not contain the actual values of variables in a data set.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 14:26:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/690007#M209830</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-10-08T14:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/690013#M209834</link>
      <description>&lt;P&gt;I am not expert, but not sure about the format you mentioned&amp;nbsp; works for what I am looking. I am looking for if any variable that has the string that&amp;nbsp; contains a word "Missing" need highlight that cell in output. according to your format Variable has to have the only&amp;nbsp; word that mentioned in formats. where as I am looking for finding the word Missing in string then alert with color code. Let me know if My question make sense. also is it&amp;nbsp; any way we can create&amp;nbsp; a separate variable flag based on this logic and work around!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 14:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/690013#M209834</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T14:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/690017#M209836</link>
      <description>I just started this community. Thanks for suggestion, I will learn to post the data, Thanks for the instruction, will learn a lot from you guys</description>
      <pubDate>Thu, 08 Oct 2020 14:46:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/690017#M209836</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T14:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/690057#M209854</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; My example exactly mimics your first posting, as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1602168207932.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50364i5BEB7A7459437EA8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1602168207932.png" alt="Cynthia_sas_0-1602168207932.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your second posting example has these issues that I have a hard time figuring out because there's no context for the data or the desired output:&lt;/P&gt;
&lt;P&gt;1) data shown is screen shot, data structure is not explained and can't be used with only partial code provided&lt;/P&gt;
&lt;P&gt;2) data is not explained. Is it a CSV file? Is it a SAS dataset? Why are there ODS ESCAPECHAR strings in the data?&lt;/P&gt;
&lt;P&gt;3) there is no color coding in the example that is supposed to be Excel output. The 3rd picture doesn't look like Excel output. There are not any cell boundaries and no column headers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; It is possible to do color coding with ODS EXCEL. I'm not sure that if you have multiple strings in a cell that you can do 2 different backgrounds in one cell but you CAN have 2 different font colors, as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_1-1602171423307.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50372iE331FA3EC029747C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_1-1602171423307.png" alt="Cynthia_sas_1-1602171423307.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;One thing I like to do is to remove SAS from the picture and see whether something is possible in native Excel. So for example, in this worksheet that I typed into Excel, I can change the entire background for one cell, no matter how many text strings are in the cell:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1602171749631.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50373iA2954F3441D74A5F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1602171749631.png" alt="Cynthia_sas_0-1602171749631.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; However, look at the cell B3, where I have highlighted just the word "number" in the cell, the button to change the background becomes grayed out and there's not a way to change the background color of just one piece of the string. I can still change the font color of the highlighted word, as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_1-1602171862003.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50374i67B7C366491FCDCF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_1-1602171862003.png" alt="Cynthia_sas_1-1602171862003.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; So if Excel won't let you change the background of just one piece of a text string, SAS won't be able to do it either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 15:45:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/690057#M209854</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-10-08T15:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/690077#M209866</link>
      <description>&lt;P&gt;Yes I totally agree with you. I am not looking to achieve both. I am fine with&amp;nbsp; if it just highlights the cells with color that contains the word "Missing". I am sorry if Initial post caused you any confusion.&amp;nbsp; I am&amp;nbsp; posting another, let me know if it clears to you.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50377i4BAC8942CDFF156A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OpenedWithImage.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50378i0DD3A2D60DA57842/image-size/large?v=v2&amp;amp;px=999" role="button" title="OpenedWithImage.png" alt="OpenedWithImage.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_0-1602173066143.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50379iEFBE35180B27704F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASuserlot_0-1602173066143.png" alt="SASuserlot_0-1602173066143.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 16:04:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/690077#M209866</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2020-10-08T16:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc report : Excel ODS Color code Display based on the String contains</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/690153#M209910</link>
      <description>Hi:&lt;BR /&gt; What you posted in your top picture, you say is how the data looks in the SAS dataset -- but you show it as row 21 -- that looks like a screen shot from Excel for what your data resembles. It is impossible to understand your data structure from just one row and one cell. Several examples of how to write a data step program to make fake or dummy data into a SAS dataset for testing  have been posted. It is nearly impossible to understand what your data looks like from the first picture which is essentially row 21 and just one cell on row 21.&lt;BR /&gt;  Your second screen shot shows the words [Missing], Control, Food Effect and Treatment, and your comment says that this is how you want your data displayed in Excel. But again it looks like you are just showing 1 cell in column C in Excel. You don't show columns A and B. However your first screen shot looks like it is showing row 21, Column A, so did your data suddenly shift to Column C when you did your report?  You had many more variables in your PROC REPORT code that you posted but these snippets show none of those variables or variable names and you haven't posted more than 1 or 2 cells. And in your last picture it shows continuous and continuous, content, etc. In other words, the first and second screen shots do not agree at all with what you say your data is and nothing looks like your PROC REPORT code will work with what you've posted.&lt;BR /&gt;Cynthia</description>
      <pubDate>Thu, 08 Oct 2020 19:29:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-report-Excel-ODS-Color-code-Display-based-on-the-String/m-p/690153#M209910</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-10-08T19:29:06Z</dc:date>
    </item>
  </channel>
</rss>

