<?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 Having trouble with conditional color formatting using Proc Report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Having-trouble-with-conditional-color-formatting-using-Proc/m-p/943589#M369808</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am new to Proc Report in SAS and have hit a wall with this code.&lt;/P&gt;&lt;P&gt;I have a dataset and want to output an excel file with color coded cells. This data will be changing unpredictably so having the code in the most dynamic format will be the most helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/**Bring in Data**/
DATA TEST;
LENGTH VAR2 $12. VAR3 $20. VAR7 $30.;&lt;BR /&gt;LENGTH VAR1 4. VAR4 6. VAR5 6. VAR6 6.;
INPUT VAR1 VAR2 VAR3 VAR4 VAR5 VAR6 VAR7;
DATALINES;
0000&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;300&amp;nbsp; &amp;nbsp;500.2&amp;nbsp; &amp;nbsp;600&amp;nbsp; &amp;nbsp;"Apr 10th, 2024 (Wednesday)" 
0000&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;50.2&amp;nbsp; &amp;nbsp;100.5&amp;nbsp; &amp;nbsp;70&amp;nbsp; &amp;nbsp;"Apr 9th, 2024 (Tuesday)" 
0000&amp;nbsp;&amp;nbsp; XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp;50&amp;nbsp; &amp;nbsp;5&amp;nbsp;&amp;nbsp;&amp;nbsp;"Apr 8th, 2024 (Monday)" 
0001&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;300.1&amp;nbsp; &amp;nbsp;600.8&amp;nbsp; &amp;nbsp;598 "Apr 10th, 2024 (Wednesday)"
0001&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;80&amp;nbsp; &amp;nbsp;110&amp;nbsp; &amp;nbsp;90&amp;nbsp; &amp;nbsp;"Apr 9th, 2024 (Tuesday)"
0001&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;-20.3&amp;nbsp; &amp;nbsp;30&amp;nbsp; &amp;nbsp;10&amp;nbsp;&amp;nbsp;&amp;nbsp;"Apr 8th, 2024 (Monday)"
0002&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;400&amp;nbsp; &amp;nbsp;900&amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp;"Apr 10th, 2024 (Wednesday)"
0002&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; 50&amp;nbsp; &amp;nbsp;70.9&amp;nbsp; &amp;nbsp;100&amp;nbsp; &amp;nbsp;"Apr 9th, 2024 (Tuesday)"
0002&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;100&amp;nbsp; &amp;nbsp;350.5&amp;nbsp; &amp;nbsp;320&amp;nbsp;&amp;nbsp;&amp;nbsp;"Apr 8th, 2024 (Monday)"
0003&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;60&amp;nbsp; &amp;nbsp;180&amp;nbsp; &amp;nbsp;80&amp;nbsp; &amp;nbsp;"Apr 10th, 2024 (Wednesday)"
0003&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;400&amp;nbsp; &amp;nbsp;800&amp;nbsp; &amp;nbsp;700&amp;nbsp; &amp;nbsp;"Apr 9th, 2024 (Tuesday)"
0003&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp;60.2&amp;nbsp; &amp;nbsp;61&amp;nbsp;&amp;nbsp;&amp;nbsp;"Apr 8th, 2024 (Monday)"
0004&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;150&amp;nbsp; &amp;nbsp;350&amp;nbsp; &amp;nbsp;140&amp;nbsp; &amp;nbsp;"Apr 10th, 2024 (Wednesday)"
0004&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;70&amp;nbsp; &amp;nbsp;130&amp;nbsp; &amp;nbsp;80&amp;nbsp; &amp;nbsp;"Apr 9th, 2024 (Tuesday)"
0004&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;120&amp;nbsp; &amp;nbsp;360&amp;nbsp; &amp;nbsp;600&amp;nbsp;&amp;nbsp;&amp;nbsp;"Apr 8th, 2024 (Monday)" 
;
RUN;

/*CREATE ALERTS*/
DATA TEST2;
SET TEST1;
IF VAR6= 0 THEN ALERT=1;
ELSE IF VAR6&amp;lt; VAR4 THEN ALERT=2;
ELSE IF VAR4&amp;lt;= VAR6&amp;lt;= VAR5 THEN ALERT=3;
ELSE IF VAR6 &amp;gt; VAR5 THEN ALERT=4;
RUN;

/*OUTPUT*/&lt;BR /&gt;ODS EXCEL FILE = "filepath.xlsx";
PROC REPORT DATA=TEST2 NOWDS SPANROWS;
COLUMNS&amp;nbsp;VAR1 VAR2 VAR3 ALERT ('' VAR7), (VAR6 );
&amp;nbsp; &amp;nbsp; &amp;nbsp;DEFINE VAR1 / GROUP CENTER ORDER=DATA;
&amp;nbsp; &amp;nbsp; &amp;nbsp;DEFINE VAR2 / GROUP;
&amp;nbsp; &amp;nbsp; &amp;nbsp;DEFINE VAR3 / GROUP;
&amp;nbsp; &amp;nbsp; &amp;nbsp;DEFINE ALERT / NOPRINT;
&amp;nbsp; &amp;nbsp; &amp;nbsp;DEFINE VAR6 / ACROSS;
&amp;nbsp; &amp;nbsp; &amp;nbsp;DEFINE VAR7 / ACROSS;

COMPUTE VAR6;
&amp;nbsp; &amp;nbsp;IF ALERT=1 THEN DO;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CALL DEFINE (_col_,"style","style={background=lightred}"); END;
&amp;nbsp; &amp;nbsp;ELSE IF ALERT=2 THEN DO;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CALL DEFINE (_col_,"style","style={background=lightorange}"); END;
&amp;nbsp; &amp;nbsp;ELSE IF ALERT= 3 THEN DO;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CALL DEFINE (_col_,"style","style={background=lightgreen}"); END;
&amp;nbsp; &amp;nbsp;ELSE IF ALERT=4 THEN DO;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CALL DEFINE (_col_,"style","style={background=lightblue}"); END;
ENDCOMP;
RUN;&lt;BR /&gt;&lt;BR /&gt;OD EXCEL CLOSE;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I keep getting a warning that Alert is uninitialized and nothing gets color coded.&lt;/P&gt;&lt;P&gt;The format and grouping is working, but that's it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the intended Excel output.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="impostersyn_0-1726114099289.png" style="width: 445px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100246i0A606ED732E6019A/image-dimensions/445x118?v=v2" width="445" height="118" role="button" title="impostersyn_0-1726114099289.png" alt="impostersyn_0-1726114099289.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated! Thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 12 Sep 2024 04:29:03 GMT</pubDate>
    <dc:creator>impostersyn</dc:creator>
    <dc:date>2024-09-12T04:29:03Z</dc:date>
    <item>
      <title>Having trouble with conditional color formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Having-trouble-with-conditional-color-formatting-using-Proc/m-p/943589#M369808</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am new to Proc Report in SAS and have hit a wall with this code.&lt;/P&gt;&lt;P&gt;I have a dataset and want to output an excel file with color coded cells. This data will be changing unpredictably so having the code in the most dynamic format will be the most helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/**Bring in Data**/
DATA TEST;
LENGTH VAR2 $12. VAR3 $20. VAR7 $30.;&lt;BR /&gt;LENGTH VAR1 4. VAR4 6. VAR5 6. VAR6 6.;
INPUT VAR1 VAR2 VAR3 VAR4 VAR5 VAR6 VAR7;
DATALINES;
0000&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;300&amp;nbsp; &amp;nbsp;500.2&amp;nbsp; &amp;nbsp;600&amp;nbsp; &amp;nbsp;"Apr 10th, 2024 (Wednesday)" 
0000&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;50.2&amp;nbsp; &amp;nbsp;100.5&amp;nbsp; &amp;nbsp;70&amp;nbsp; &amp;nbsp;"Apr 9th, 2024 (Tuesday)" 
0000&amp;nbsp;&amp;nbsp; XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp;50&amp;nbsp; &amp;nbsp;5&amp;nbsp;&amp;nbsp;&amp;nbsp;"Apr 8th, 2024 (Monday)" 
0001&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;300.1&amp;nbsp; &amp;nbsp;600.8&amp;nbsp; &amp;nbsp;598 "Apr 10th, 2024 (Wednesday)"
0001&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;80&amp;nbsp; &amp;nbsp;110&amp;nbsp; &amp;nbsp;90&amp;nbsp; &amp;nbsp;"Apr 9th, 2024 (Tuesday)"
0001&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;-20.3&amp;nbsp; &amp;nbsp;30&amp;nbsp; &amp;nbsp;10&amp;nbsp;&amp;nbsp;&amp;nbsp;"Apr 8th, 2024 (Monday)"
0002&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;400&amp;nbsp; &amp;nbsp;900&amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp;"Apr 10th, 2024 (Wednesday)"
0002&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; 50&amp;nbsp; &amp;nbsp;70.9&amp;nbsp; &amp;nbsp;100&amp;nbsp; &amp;nbsp;"Apr 9th, 2024 (Tuesday)"
0002&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;100&amp;nbsp; &amp;nbsp;350.5&amp;nbsp; &amp;nbsp;320&amp;nbsp;&amp;nbsp;&amp;nbsp;"Apr 8th, 2024 (Monday)"
0003&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;60&amp;nbsp; &amp;nbsp;180&amp;nbsp; &amp;nbsp;80&amp;nbsp; &amp;nbsp;"Apr 10th, 2024 (Wednesday)"
0003&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;400&amp;nbsp; &amp;nbsp;800&amp;nbsp; &amp;nbsp;700&amp;nbsp; &amp;nbsp;"Apr 9th, 2024 (Tuesday)"
0003&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp;60.2&amp;nbsp; &amp;nbsp;61&amp;nbsp;&amp;nbsp;&amp;nbsp;"Apr 8th, 2024 (Monday)"
0004&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;150&amp;nbsp; &amp;nbsp;350&amp;nbsp; &amp;nbsp;140&amp;nbsp; &amp;nbsp;"Apr 10th, 2024 (Wednesday)"
0004&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;70&amp;nbsp; &amp;nbsp;130&amp;nbsp; &amp;nbsp;80&amp;nbsp; &amp;nbsp;"Apr 9th, 2024 (Tuesday)"
0004&amp;nbsp; &amp;nbsp;XXX&amp;nbsp; &amp;nbsp;XXXX&amp;nbsp; &amp;nbsp;120&amp;nbsp; &amp;nbsp;360&amp;nbsp; &amp;nbsp;600&amp;nbsp;&amp;nbsp;&amp;nbsp;"Apr 8th, 2024 (Monday)" 
;
RUN;

/*CREATE ALERTS*/
DATA TEST2;
SET TEST1;
IF VAR6= 0 THEN ALERT=1;
ELSE IF VAR6&amp;lt; VAR4 THEN ALERT=2;
ELSE IF VAR4&amp;lt;= VAR6&amp;lt;= VAR5 THEN ALERT=3;
ELSE IF VAR6 &amp;gt; VAR5 THEN ALERT=4;
RUN;

/*OUTPUT*/&lt;BR /&gt;ODS EXCEL FILE = "filepath.xlsx";
PROC REPORT DATA=TEST2 NOWDS SPANROWS;
COLUMNS&amp;nbsp;VAR1 VAR2 VAR3 ALERT ('' VAR7), (VAR6 );
&amp;nbsp; &amp;nbsp; &amp;nbsp;DEFINE VAR1 / GROUP CENTER ORDER=DATA;
&amp;nbsp; &amp;nbsp; &amp;nbsp;DEFINE VAR2 / GROUP;
&amp;nbsp; &amp;nbsp; &amp;nbsp;DEFINE VAR3 / GROUP;
&amp;nbsp; &amp;nbsp; &amp;nbsp;DEFINE ALERT / NOPRINT;
&amp;nbsp; &amp;nbsp; &amp;nbsp;DEFINE VAR6 / ACROSS;
&amp;nbsp; &amp;nbsp; &amp;nbsp;DEFINE VAR7 / ACROSS;

COMPUTE VAR6;
&amp;nbsp; &amp;nbsp;IF ALERT=1 THEN DO;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CALL DEFINE (_col_,"style","style={background=lightred}"); END;
&amp;nbsp; &amp;nbsp;ELSE IF ALERT=2 THEN DO;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CALL DEFINE (_col_,"style","style={background=lightorange}"); END;
&amp;nbsp; &amp;nbsp;ELSE IF ALERT= 3 THEN DO;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CALL DEFINE (_col_,"style","style={background=lightgreen}"); END;
&amp;nbsp; &amp;nbsp;ELSE IF ALERT=4 THEN DO;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CALL DEFINE (_col_,"style","style={background=lightblue}"); END;
ENDCOMP;
RUN;&lt;BR /&gt;&lt;BR /&gt;OD EXCEL CLOSE;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I keep getting a warning that Alert is uninitialized and nothing gets color coded.&lt;/P&gt;&lt;P&gt;The format and grouping is working, but that's it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the intended Excel output.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="impostersyn_0-1726114099289.png" style="width: 445px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100246i0A606ED732E6019A/image-dimensions/445x118?v=v2" width="445" height="118" role="button" title="impostersyn_0-1726114099289.png" alt="impostersyn_0-1726114099289.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated! Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 04:29:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Having-trouble-with-conditional-color-formatting-using-Proc/m-p/943589#M369808</guid>
      <dc:creator>impostersyn</dc:creator>
      <dc:date>2024-09-12T04:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble with conditional color formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Having-trouble-with-conditional-color-formatting-using-Proc/m-p/944403#M370023</link>
      <description>&lt;P&gt;There is servral issues.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One, you can not use a variable in proc report in compute befroe it is defined in a column. So ALERT needs to be after VAR6. You can fix this with a alias of alert.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another issue, is the since you group by var1, var2 and var3, alert is also grouped. You can se this if you output the proc report data.&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="rudfaden_0-1726664564219.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100474i01BD37E017B72C73/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rudfaden_0-1726664564219.png" alt="rudfaden_0-1726664564219.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;This works, but i gues it is not what you want.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC REPORT DATA=TEST2 SPANROWS out=test;
COLUMNS VAR1 VAR2 VAR3 ALERT=ARLET_ALIAS ('' VAR7), (VAR6 ) ALERT;
     DEFINE VAR1 / GROUP CENTER ORDER=DATA;
     DEFINE VAR2 / GROUP;
     DEFINE VAR3 / GROUP;
     DEFINE ALERT / NOPRINT ;
     DEFINE VAR6 / ACROSS;
     DEFINE VAR7 / ACROSS;

COMPUTE VAR6;
   IF ARLET_ALIAS=1 THEN DO;
         CALL DEFINE (_col_,"style","style={background=lightred}"); END;
   ELSE IF ARLET_ALIAS=9 THEN DO;
         CALL DEFINE (_col_,"style","style={background=lightorange}"); END;
   ELSE IF ARLET_ALIAS= 10 THEN DO;
         CALL DEFINE (_col_,"style","style={background=lightgreen}"); END;
   ELSE IF ARLET_ALIAS=8 THEN DO;
         CALL DEFINE (_col_,"style","style={background=lightblue}"); END;
ENDCOMP;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 13:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Having-trouble-with-conditional-color-formatting-using-Proc/m-p/944403#M370023</guid>
      <dc:creator>rudfaden</dc:creator>
      <dc:date>2024-09-18T13:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble with conditional color formatting using Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Having-trouble-with-conditional-color-formatting-using-Proc/m-p/944429#M370032</link>
      <description>&lt;P&gt;Strong suggestion: Do not place date information in character variables if you ever want to apply an order to the&amp;nbsp; resulting values.&lt;/P&gt;
&lt;P&gt;Use an actual SAS date value (numeric number of days since 1 Jan 1960) and a format to display the information.&lt;/P&gt;
&lt;P&gt;Except for the "th" (and implied "st" "nd" or "rd" which I personally find unprofessional in appearance with dates) you can get very similar date text using a custom picture format. I am assuming the day of the week text is critical so create a longer version of the SAS Worddatew. format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Proc format library=work;
picture longworddate (default=25)
low-high ='%3b %d, %Y (%F)' (datatype=date);
run;

data example;
  x=today();
  format x longworddate.;
run;&lt;/PRE&gt;
&lt;P&gt;The picture format directives, the bits that start with % above are: %3b 3-character month abbreviation with mixed case, %d is the numeric day of the month, %Y 4-digit year, %F day of week text. The other characters of space, comma and parentheses are used as they appear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example (after getting a working data set) the across order for the given values of Var7 (really need better names) is:&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Report: Detailed and/or summarized report" cellspacing="0" cellpadding="3"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH id="ch1b1b39" class="c m header" colspan="13" scope="colgroup"&gt;Apr 10th, 2024 (Wednesday)&lt;/TH&gt;
&lt;TH id="ch1b1b78" class="c m header" colspan="13" scope="colgroup"&gt;Apr 8th, 2024 (Monday)&lt;/TH&gt;
&lt;TH id="ch1b1b117" class="c m header" colspan="13" scope="colgroup"&gt;Apr 9th, 2024 (Tuesday)&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is because 1 in a character value comes before 8. Using a two-digit day with leading 0 would allow the dates to sort in day of month order but will typically not appear as desired if your dates cross a month boundary. Consider March 30 to Apr 3 for a report. The data would sort Apr 1, Apr 2, Apr 3, Mar 30, Mar 31 .&lt;/P&gt;
&lt;P&gt;If the values are actual dates they would appear in increasing order by default or you could provide instructions to have then in descending order. But with character values you are going to have problems with order.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 15:14:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Having-trouble-with-conditional-color-formatting-using-Proc/m-p/944429#M370032</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-09-18T15:14:41Z</dc:date>
    </item>
  </channel>
</rss>

