<?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 Advice on proper naming standard for HEX-variable key (based on source PKs)? in Programming 1 and 2</title>
    <link>https://communities.sas.com/t5/Programming-1-and-2/Advice-on-proper-naming-standard-for-HEX-variable-key-based-on/m-p/830488#M1163</link>
    <description>&lt;P&gt;We've got a reusable SAS-script that runs 1 time per source table. It distributes each table to a corresponding target table. Some source tables have 1 primary key, others have 2-3. But we want to set 1 key per table (primarily because the reusable script can be simplified when the keys don't differ from table to table).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've used the primary keys from the source tables to create 1 unique hex value per row. Example value: "C0EA54AAB21573E07D46E9BB9E9B1C73".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally we wanted to change the hex into a numeric field (faster joins). But as Tom said: "&lt;SPAN&gt;The MD5() function returns 128 bits. So at 8 bits per byte that is 16 bytes. That is waaaaaay too many to convert into a single number. So leave it as character and use the $HEX32 format to display it."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proper naming standard is important to us, and I'm stumped on what to call the field. Considered calling it a Retained Key (w/RK-suffix) because it's set based on primary keys from the source tables. But RKs are only supposed to be integers I think. And it seems wrong to call it a Primary Key (w/PK-suffix), because each target table has a composite key that will consist of this hex-variable and a date variable -- so the hex isn't unique by itself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm thankful for any naming advice. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Aug 2022 06:22:42 GMT</pubDate>
    <dc:creator>EinarRoed</dc:creator>
    <dc:date>2022-08-26T06:22:42Z</dc:date>
    <item>
      <title>Advice on proper naming standard for HEX-variable key (based on source PKs)?</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Advice-on-proper-naming-standard-for-HEX-variable-key-based-on/m-p/830488#M1163</link>
      <description>&lt;P&gt;We've got a reusable SAS-script that runs 1 time per source table. It distributes each table to a corresponding target table. Some source tables have 1 primary key, others have 2-3. But we want to set 1 key per table (primarily because the reusable script can be simplified when the keys don't differ from table to table).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've used the primary keys from the source tables to create 1 unique hex value per row. Example value: "C0EA54AAB21573E07D46E9BB9E9B1C73".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally we wanted to change the hex into a numeric field (faster joins). But as Tom said: "&lt;SPAN&gt;The MD5() function returns 128 bits. So at 8 bits per byte that is 16 bytes. That is waaaaaay too many to convert into a single number. So leave it as character and use the $HEX32 format to display it."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proper naming standard is important to us, and I'm stumped on what to call the field. Considered calling it a Retained Key (w/RK-suffix) because it's set based on primary keys from the source tables. But RKs are only supposed to be integers I think. And it seems wrong to call it a Primary Key (w/PK-suffix), because each target table has a composite key that will consist of this hex-variable and a date variable -- so the hex isn't unique by itself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm thankful for any naming advice. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 06:22:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Advice-on-proper-naming-standard-for-HEX-variable-key-based-on/m-p/830488#M1163</guid>
      <dc:creator>EinarRoed</dc:creator>
      <dc:date>2022-08-26T06:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Advice on proper naming standard for HEX-variable key (based on source PKs)?</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Advice-on-proper-naming-standard-for-HEX-variable-key-based-on/m-p/830502#M1164</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/33000"&gt;@EinarRoed&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have seen "&lt;EM&gt;surrogate key&lt;/EM&gt;" and variables with suffix &lt;FONT face="courier new,courier"&gt;_SK&lt;/FONT&gt; for exactly this type of keys. See &lt;A href="https://support.sas.com/en/books/authors/paul-dorfman.html" target="_blank" rel="noopener"&gt;Paul Dorfman, Don Henderson: Data Management Solutions Using SAS® Hash Table Operations: A Business Intelligence Case Study&lt;/A&gt;, e.g., section&amp;nbsp;11.4.2 MD5 Key Reduction in Sample Data.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 07:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Advice-on-proper-naming-standard-for-HEX-variable-key-based-on/m-p/830502#M1164</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-08-26T07:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Advice on proper naming standard for HEX-variable key (based on source PKs)?</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/Advice-on-proper-naming-standard-for-HEX-variable-key-based-on/m-p/830516#M1165</link>
      <description>Thanks for the good suggestion, we'll likely go for SK.</description>
      <pubDate>Fri, 26 Aug 2022 09:37:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/Advice-on-proper-naming-standard-for-HEX-variable-key-based-on/m-p/830516#M1165</guid>
      <dc:creator>EinarRoed</dc:creator>
      <dc:date>2022-08-26T09:37:39Z</dc:date>
    </item>
  </channel>
</rss>

