<?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 Unexpected Behavior or Bug in PROC HPBIN in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Behavior-or-Bug-in-PROC-HPBIN/m-p/967315#M48603</link>
    <description>&lt;P&gt;I encountered a rather odd issue when using &lt;CODE&gt;PROC HPBIN&lt;/CODE&gt; that I’d like to share.&lt;/P&gt;&lt;P&gt;First, I used &lt;CODE&gt;PROC HPBIN&lt;/CODE&gt; to perform binning on a dataset &lt;CODE&gt;TEMP01&lt;/CODE&gt;and saved the resulting binning information into a mapping table (&lt;CODE&gt;TEMP_MAPPING&lt;/CODE&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA TEMP01;
	LENGTH ID 8;

	DO ID=1 TO 1000;
		X1 = RANUNI(101);
		X2 = 10*RANUNI(201);
		X3 = 100*RANUNI(301);
		OUTPUT;
	END;
RUN;

PROC HPBIN DATA=TEMP01 OUTPUT=BIN_TEMP01 NUMBIN=10 BUCKET;
	INPUT X1-X3;
	ODS OUTPUT MAPPING=TEMP_MAPPING;
RUN;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This part worked as expected.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ThaoLinh_0-1748005807328.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107283iB68F5E6797DD83C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ThaoLinh_0-1748005807328.png" alt="ThaoLinh_0-1748005807328.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I tried to apply the same binning to a &lt;STRONG&gt;different dataset (&lt;CODE&gt;TEMP02&lt;/CODE&gt;) using the saved mapping&lt;/STRONG&gt;, the process failed — &lt;STRONG&gt;but only when the variable order in the new dataset was different&lt;/STRONG&gt; from the original&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC SQL NOPRINT;
	CREATE TABLE TEMP02 AS SELECT X3, X2, X1 FROM TEMP01;
QUIT;

PROC HPBIN DATA=TEMP02 BINS_META=TEMP_MAPPING OUTPUT=BIN_TEMP02 NUMBIN=10 BUCKET;
	INPUT X1-X3;
RUN;&lt;/PRE&gt;&lt;P&gt;The result:&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="ThaoLinh_1-1748005870460.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107284i8C55FEB113E80E3F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ThaoLinh_1-1748005870460.png" alt="ThaoLinh_1-1748005870460.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It also makes the issue &lt;STRONG&gt;very difficult to detect and debug.&amp;nbsp;I believe this behavior should be addressed, or at the very least clearly documented, as it can lead to significant confusion and incorrect processing.&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 23 May 2025 13:14:56 GMT</pubDate>
    <dc:creator>NguyenThanhTra</dc:creator>
    <dc:date>2025-05-23T13:14:56Z</dc:date>
    <item>
      <title>Unexpected Behavior or Bug in PROC HPBIN</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Behavior-or-Bug-in-PROC-HPBIN/m-p/967315#M48603</link>
      <description>&lt;P&gt;I encountered a rather odd issue when using &lt;CODE&gt;PROC HPBIN&lt;/CODE&gt; that I’d like to share.&lt;/P&gt;&lt;P&gt;First, I used &lt;CODE&gt;PROC HPBIN&lt;/CODE&gt; to perform binning on a dataset &lt;CODE&gt;TEMP01&lt;/CODE&gt;and saved the resulting binning information into a mapping table (&lt;CODE&gt;TEMP_MAPPING&lt;/CODE&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA TEMP01;
	LENGTH ID 8;

	DO ID=1 TO 1000;
		X1 = RANUNI(101);
		X2 = 10*RANUNI(201);
		X3 = 100*RANUNI(301);
		OUTPUT;
	END;
RUN;

PROC HPBIN DATA=TEMP01 OUTPUT=BIN_TEMP01 NUMBIN=10 BUCKET;
	INPUT X1-X3;
	ODS OUTPUT MAPPING=TEMP_MAPPING;
RUN;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This part worked as expected.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ThaoLinh_0-1748005807328.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107283iB68F5E6797DD83C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ThaoLinh_0-1748005807328.png" alt="ThaoLinh_0-1748005807328.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I tried to apply the same binning to a &lt;STRONG&gt;different dataset (&lt;CODE&gt;TEMP02&lt;/CODE&gt;) using the saved mapping&lt;/STRONG&gt;, the process failed — &lt;STRONG&gt;but only when the variable order in the new dataset was different&lt;/STRONG&gt; from the original&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC SQL NOPRINT;
	CREATE TABLE TEMP02 AS SELECT X3, X2, X1 FROM TEMP01;
QUIT;

PROC HPBIN DATA=TEMP02 BINS_META=TEMP_MAPPING OUTPUT=BIN_TEMP02 NUMBIN=10 BUCKET;
	INPUT X1-X3;
RUN;&lt;/PRE&gt;&lt;P&gt;The result:&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="ThaoLinh_1-1748005870460.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107284i8C55FEB113E80E3F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ThaoLinh_1-1748005870460.png" alt="ThaoLinh_1-1748005870460.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It also makes the issue &lt;STRONG&gt;very difficult to detect and debug.&amp;nbsp;I believe this behavior should be addressed, or at the very least clearly documented, as it can lead to significant confusion and incorrect processing.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 13:14:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Behavior-or-Bug-in-PROC-HPBIN/m-p/967315#M48603</guid>
      <dc:creator>NguyenThanhTra</dc:creator>
      <dc:date>2025-05-23T13:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected Behavior or Bug in PROC HPBIN</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Behavior-or-Bug-in-PROC-HPBIN/m-p/967437#M48612</link>
      <description>&lt;P&gt;If you want an official response to your issue then raising a Tech Support track is the best option.&lt;/P&gt;</description>
      <pubDate>Sun, 25 May 2025 20:44:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Unexpected-Behavior-or-Bug-in-PROC-HPBIN/m-p/967437#M48612</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2025-05-25T20:44:13Z</dc:date>
    </item>
  </channel>
</rss>

