<?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: Unicode characters in Proc Report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/695132#M212067</link>
    <description>That means your dataset don't contain 'change' variable .</description>
    <pubDate>Thu, 29 Oct 2020 11:07:12 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2020-10-29T11:07:12Z</dc:date>
    <item>
      <title>Unicode characters in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/694819#M211938</link>
      <description>&lt;P&gt;I am using Proc Report to create a list of counties grouped by a date, showing an average and change indicator (which indicates the change from the average at the prior date).&amp;nbsp; "Change" is already computed, has values -1 (down), 1 (Up), 0 (no change).&amp;nbsp; Below is my code.&amp;nbsp; This shows the correct format and everything I want to see, except I want an up/down arrow for 1 / -1 and perhaps a horizontal dash for 0.&amp;nbsp; I believe unicode characters would be most efficient.&amp;nbsp; Any idea on how to implement those for the "Change" columns in the report?&amp;nbsp; Will these export to Excel?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=change2 nowd;
columns  ('State Postal Code' state_cd) ('State Name' state)  county FIPS DATE, (average change)  ;

define state_cd /  group  ;
define state /  group  order=internal;
define county/County Name" group left order=internal;
define FIPS/ group ;
define Date/ across order =  data;
define average /   center  style(column)={background=colorraw.};
define change /  center   ;
COMPUTE state_cd;
      IF state_Cd NE "" THEN DUMMY=State_cd;
      ELSE State_cd=DUMMY;
       endcomp;
  COMPUTE state;
      IF state NE "" THEN DUMMY1=State;
      ELSE State=DUMMY1;
       endcomp;
run;quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Oct 2020 12:05:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/694819#M211938</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-10-28T12:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode characters in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/694847#M211946</link>
      <description>This could give you a start. Find the right unicode for arrow.&lt;BR /&gt;data have;&lt;BR /&gt; set sashelp.class;&lt;BR /&gt;if sex='F' then arrow=unicode('\u2264');&lt;BR /&gt; else arrow=unicode('\u2265');&lt;BR /&gt;run;&lt;BR /&gt;proc print;run;</description>
      <pubDate>Wed, 28 Oct 2020 13:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/694847#M211946</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-10-28T13:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode characters in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/694857#M211952</link>
      <description>&lt;P&gt;After searching the character map and some other posts here, I came up with this solution using Proc Format.&amp;nbsp; The characters are displaying correctly in the output (haven't yet tested the export to Excel), but the conditional formatting in the compute statement isn't working.&amp;nbsp; I get a warning message stating Change is uninitialized.&amp;nbsp; Not sure why...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc format;
value colorchngu
1  = "(*ESC*){unicode '25b2'x}"
-1 = "(*ESC*){unicode '25bc'x}"
0 = "(*ESC*){unicode '25ac'x}"
;
run;


proc report data=change2 nowd;
columns  ('State Postal Code' state_cd) ('State Name' state)  county FIPS DATE, (average change )  ;
define state_cd / 'group    ;
define state / 'group  order=internal;
define county/ group left order=internal;
define FIPS/'' group ;
define date/ across order =  data;
define average / center  style(column)={background=colorraw.};
define change/  center format=colorchngu. ;

compute change;
if change = 1 then do;
call define(_col_,'style','Style={font_size=24pt font_color=VIYPK}');
end;
if change = -1 then do;
call define(_col_,'style','Style={font_size=24pt font_color=BILG}');
end;
endcomp;


COMPUTE state_cd;
      IF state_Cd NE "" THEN DUMMY=State_cd;
      ELSE State_cd=DUMMY;
       endcomp;
  COMPUTE state;
      IF state NE "" THEN DUMMY1=State;
      ELSE State=DUMMY1;
       endcomp;
run;quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Oct 2020 13:48:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/694857#M211952</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-10-28T13:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode characters in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/695132#M212067</link>
      <description>That means your dataset don't contain 'change' variable .</description>
      <pubDate>Thu, 29 Oct 2020 11:07:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/695132#M212067</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-10-29T11:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode characters in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/695134#M212068</link>
      <description>It's definitely there, and it's in the columns statement.  &lt;BR /&gt;&lt;BR /&gt;FWIW This message does not show as a warning, but as a note.</description>
      <pubDate>Thu, 29 Oct 2020 11:17:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/695134#M212068</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-10-29T11:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode characters in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/695135#M212069</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
set sashelp.class;
if sex='F' then arrow=unicode('\u25b2');
else arrow=unicode('\u25bc');
run;
proc print;run; 



/***********************/
ods escapechar='~';
proc report data=sashelp.class nowd;
columns name sex age arrow;
define name/display;
define arrow/computed ;
compute arrow/character length=40;
if sex='F' then do;
 arrow='~{unicode 25b2}';
 call define(_col_,'style','style={foreground=red}');
end;
else do;
 arrow='~{unicode 25bc}';
 call define(_col_,'style','style={foreground=green}');
end;
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Oct 2020 11:18:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/695135#M212069</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-10-29T11:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode characters in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/695136#M212070</link>
      <description>1) the first way:  you need DISPLAY to refer to 'change':&lt;BR /&gt;define change/  display  center format=colorchngu. ;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;2)the second way : your code imply 'change' is ANALYSIS usage.&lt;BR /&gt;compute change;&lt;BR /&gt;if change.SUM = 1 then do;&lt;BR /&gt;...&lt;BR /&gt;if change.SUM = -1 then do;</description>
      <pubDate>Thu, 29 Oct 2020 11:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/695136#M212070</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-10-29T11:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode characters in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/695139#M212071</link>
      <description>I tried both of those, and I still cannot get the arrows to appear at all.  The code I posted above works for displaying the arrows, but without the conditional formatting.  Is it possible to run a compute on a variable which is being grouped by an across variable (in this case "date")?</description>
      <pubDate>Thu, 29 Oct 2020 11:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/695139#M212071</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-10-29T11:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode characters in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/695140#M212072</link>
      <description>Can you post some sample data to test your code ?</description>
      <pubDate>Thu, 29 Oct 2020 11:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/695140#M212072</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-10-29T11:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode characters in Proc Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/695142#M212073</link>
      <description>&lt;P&gt;I got it to work.&amp;nbsp; Finally.&amp;nbsp; Instead of placing the conditional formatting in a compute, I used an additional PROC FORMAT statement for just the colors and specified that format in a style statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc format;
value colorchngu
1  = "(*ESC*){unicode '25b2'x}"
-1 = "(*ESC*){unicode '25bc'x}"
0 = "(*ESC*){unicode '25ac'x}"
;
run;

proc format;
value coloru
1  = 'VIYPK'
-1 = 'BILG'
0 = 'Black';
run;

proc report data=change2 nowd;
columns  ('State Postal Code' state_cd) ('State Name' state)  county FIPS DATE, (average change )  ;
define state_cd / group    ;
define state / group  order=internal;
define county/ group left order=internal;
define FIPS/ group ;
define date/ across order =  data;
define average / center  style(column)={background=colorraw.};
define change/  center format=colorchngu  style={foreground=coloru.} ;

COMPUTE state_cd;
      IF state_Cd NE "" THEN DUMMY=State_cd;
      ELSE State_cd=DUMMY;
       endcomp;
  COMPUTE state;
      IF state NE "" THEN DUMMY1=State;
      ELSE State=DUMMY1;
       endcomp;
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Oct 2020 12:13:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unicode-characters-in-Proc-Report/m-p/695142#M212073</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-10-29T12:13:43Z</dc:date>
    </item>
  </channel>
</rss>

