<?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 Using Unicodes in a data step for Proc report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-Unicodes-in-a-data-step-for-Proc-report/m-p/994764#M380539</link>
    <description>&lt;P&gt;Good day&lt;/P&gt;
&lt;P&gt;I have a data set with multiple parameters each parameter&amp;nbsp; with its own specification that I want to reflect on a report using proc report. Other parameter has only ONE specification whilst others have a range between two extremes. How do I show the specifications for the parameters in a data set for reporting using proc report? The code I used is as below:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc format;&lt;BR /&gt;value $LessThan&lt;BR /&gt;"LE" = "(*ESC*){unicode 2264}";&lt;/P&gt;
&lt;P&gt;value $GreaterThan&lt;BR /&gt;"GE" = "(*ESC*){unicode 2265}";&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;%Let Spec_Determ1 = 10;&lt;BR /&gt;%Let Lower_Spec_Determ2 = 15;&lt;BR /&gt;%Let Upper_Spec_Determ2 = 25;&lt;/P&gt;
&lt;P&gt;Data dataset2;&lt;BR /&gt;set challenge;&lt;BR /&gt;format Specification $40.;&lt;BR /&gt;if Determ = 'Determ1' then do;Specification =catx(" ",put("LE", $LessThan.),&amp;amp;Spec_Determ1); end; else&lt;BR /&gt;if Determ = 'Determ2' then do;Specification =catx(" ",put("GE", $GreaterThan.),&amp;amp;Lower_Spec_Determ2,'to',put("LE",$LessThan.),&amp;amp;Upper_Spec_Determ2); end; &lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc report datadata=dataset2;&lt;BR /&gt;columns Determ Specification Result;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Oct 2026 09:33:59 GMT</pubDate>
    <dc:creator>mmohotsi</dc:creator>
    <dc:date>2026-10-12T09:33:59Z</dc:date>
    <item>
      <title>Using Unicodes in a data step for Proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Unicodes-in-a-data-step-for-Proc-report/m-p/994764#M380539</link>
      <description>&lt;P&gt;Good day&lt;/P&gt;
&lt;P&gt;I have a data set with multiple parameters each parameter&amp;nbsp; with its own specification that I want to reflect on a report using proc report. Other parameter has only ONE specification whilst others have a range between two extremes. How do I show the specifications for the parameters in a data set for reporting using proc report? The code I used is as below:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc format;&lt;BR /&gt;value $LessThan&lt;BR /&gt;"LE" = "(*ESC*){unicode 2264}";&lt;/P&gt;
&lt;P&gt;value $GreaterThan&lt;BR /&gt;"GE" = "(*ESC*){unicode 2265}";&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;%Let Spec_Determ1 = 10;&lt;BR /&gt;%Let Lower_Spec_Determ2 = 15;&lt;BR /&gt;%Let Upper_Spec_Determ2 = 25;&lt;/P&gt;
&lt;P&gt;Data dataset2;&lt;BR /&gt;set challenge;&lt;BR /&gt;format Specification $40.;&lt;BR /&gt;if Determ = 'Determ1' then do;Specification =catx(" ",put("LE", $LessThan.),&amp;amp;Spec_Determ1); end; else&lt;BR /&gt;if Determ = 'Determ2' then do;Specification =catx(" ",put("GE", $GreaterThan.),&amp;amp;Lower_Spec_Determ2,'to',put("LE",$LessThan.),&amp;amp;Upper_Spec_Determ2); end; &lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc report datadata=dataset2;&lt;BR /&gt;columns Determ Specification Result;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2026 09:33:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Unicodes-in-a-data-step-for-Proc-report/m-p/994764#M380539</guid>
      <dc:creator>mmohotsi</dc:creator>
      <dc:date>2026-10-12T09:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using Unicodes in a data step for Proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Unicodes-in-a-data-step-for-Proc-report/m-p/994774#M380540</link>
      <description>&lt;P&gt;Can you show the results from your current code, and describe what is wrong with the results?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can make a small example dataset, with CARDS statement, that will make it easier for people to help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm surprised you're using macro variables to store the limits.&amp;nbsp; Assuming each parameter has it's own limits, I would think it would be easier to store the limits as variables in the dataset (LowerLimit and UpperLimit).&amp;nbsp; If you have the limits in the dataset, it should be straight forward to generate the specification text, either as a variable in the dataset or using a PROC REPORT compute block.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2026 15:15:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Unicodes-in-a-data-step-for-Proc-report/m-p/994774#M380540</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2026-10-12T15:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using Unicodes in a data step for Proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Unicodes-in-a-data-step-for-Proc-report/m-p/994793#M380543</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/77934"&gt;@mmohotsi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you for attaching the data set, that made it easy to reproduce. I ran your code against it, and the good news is that your Unicode approach is correct. Three smaller things keep the Specification column from showing:&lt;/P&gt;&lt;P&gt;1. The values of Determ end with a tab character. Because of it, Determ = 'Determ1' is never true and Specification stays blank. This often happens when data comes from Excel or a tab-delimited file.&lt;/P&gt;&lt;P&gt;2. The length of 40 is too short for Determ2.&lt;BR /&gt;The text (*ESC*){unicode 2265} takes 21 characters by itself, so the range for Determ2 needs 52. The log shows "WARNING: In a call to the CATX function, the buffer allocated for the result was not long enough..." and CATX returns a blank value.&lt;/P&gt;&lt;P&gt;3. A small typo in PROC REPORT.&lt;BR /&gt;proc report datadata=dataset2 should be data=dataset2.&lt;/P&gt;&lt;P&gt;Here is your program with these three points corrected. I kept your formats as they are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC FORMAT;
  VALUE $lessthan    "LE" = "(*ESC*){unicode 2264}";
  VALUE $greaterthan "GE" = "(*ESC*){unicode 2265}";
RUN;

%LET spec_determ1       = 10;
%LET lower_spec_determ2 = 15;
%LET upper_spec_determ2 = 25;

DATA dataset2_spec;
  SET work.dataset2;
  LENGTH specification $100;
  /* The values of determ end with a tab, so remove control characters first */
  determ = COMPRESS(determ, , "c");
       IF determ = "Determ1" THEN specification = CATX(" ", PUT("LE", $lessthan.) , &amp;amp;spec_determ1.);
  ELSE IF determ = "Determ2" THEN specification = CATX(" ", PUT("GE", $greaterthan.), &amp;amp;lower_spec_determ2.
                                                    , "to", PUT("LE", $lessthan.), &amp;amp;upper_spec_determ2.);
RUN;

PROC REPORT DATA=dataset2_spec;
  COLUMNS determ specification result;
  DEFINE determ        / DISPLAY "Determination";
  DEFINE specification / DISPLAY "Specification";
  DEFINE result        / DISPLAY "Result";
RUN;

ODS PDF FILE="/&amp;lt;PATH&amp;gt;/dataset2_spec.pdf";

PROC REPORT DATA=dataset2_spec;
  COLUMNS determ specification result;
RUN;

ODS PDF CLOSE;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this, Determ1 shows "≤ 10" and Determ2 shows "≥ 15 to ≤ 25".&lt;/P&gt;&lt;P&gt;The symbols appear in ODS output such as HTML, RTF, PDF or Excel. In the data set itself and in the plain listing output you will still see the text (*ESC*){unicode 2264}, which is expected.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I hope this helps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Yosia&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;P.S. A tip for problems like this one: step through the DATA step in a debugger and watch the variables. Here you would see Specification still blank after the IF statement, which points straight at the comparison. SAS Studio and Enterprise Guide both have a DATA step debugger. If you prefer VS Code, I wrote an extension called DataStep Studio that adds a DATA step debugger and a macro debugger there: &lt;A href="https://datastep-studio.pages.dev" target="_blank"&gt;https://datastep-studio.pages.dev&lt;/A&gt; (disclosure: I am the author).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yosiahds_0-1791843315748.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/118281i0C6D7F6F1DEA1881/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yosiahds_0-1791843315748.png" alt="yosiahds_0-1791843315748.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2026 22:18:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Unicodes-in-a-data-step-for-Proc-report/m-p/994793#M380543</guid>
      <dc:creator>yosiahds</dc:creator>
      <dc:date>2026-10-12T22:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using Unicodes in a data step for Proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Unicodes-in-a-data-step-for-Proc-report/m-p/994799#M380546</link>
      <description>Good day yosiahds&lt;BR /&gt;&lt;BR /&gt;Thank you for this response.&lt;BR /&gt;&lt;BR /&gt;This is the solution to my problem. I think the length was the major problem. Thank you once more&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Oct 2026 07:19:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Unicodes-in-a-data-step-for-Proc-report/m-p/994799#M380546</guid>
      <dc:creator>mmohotsi</dc:creator>
      <dc:date>2026-10-13T07:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using Unicodes in a data step for Proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Unicodes-in-a-data-step-for-Proc-report/m-p/994800#M380547</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/77934"&gt;@mmohotsi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Good day yosiahds&lt;BR /&gt;&lt;BR /&gt;Thank you for this response.&lt;BR /&gt;&lt;BR /&gt;This is the solution to my problem. I think the length was the major problem. Thank you once more&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Glad you got it working.&amp;nbsp; Please mark&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/345249"&gt;@yosiahds&lt;/a&gt;'s answer as the correct solution, to close out this question.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2026 09:20:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Unicodes-in-a-data-step-for-Proc-report/m-p/994800#M380547</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2026-10-13T09:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using Unicodes in a data step for Proc report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Unicodes-in-a-data-step-for-Proc-report/m-p/994863#M380562</link>
      <description>&lt;P&gt;It’s helpful that the solution identified several issues rather than focusing only on Unicode. The hidden tab characters, insufficient variable length, and typo in PROC REPORT were easy to overlook. Increasing the length and cleaning the input data seem especially important here. It’s a good reminder to check the SAS log and inspect the actual variable &lt;A href="https://abonnements-iptv8k.com/" target="_self"&gt;&lt;FONT color="#808080"&gt;site&lt;/FONT&gt;&lt;/A&gt; values when a computed column unexpectedly comes out blank.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2026 14:17:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Unicodes-in-a-data-step-for-Proc-report/m-p/994863#M380562</guid>
      <dc:creator>BriceGrandis</dc:creator>
      <dc:date>2026-10-14T14:17:46Z</dc:date>
    </item>
  </channel>
</rss>

