<?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: Why not display the right formation for a20? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-not-display-the-right-formation-for-a20/m-p/628378#M185671</link>
    <description>&lt;P&gt;The display format used for a number does not change how the numbers are stored.&amp;nbsp; If your values have more than 15 decimal digits you cannot store them as a number in SAS because SAS stores all numbers as floating point values.&amp;nbsp; Once the number of significant digits exceeds the amount that can be stored in that way you will lose some of the lower order digits.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If those values are identifiers then store them as character strings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If they are numbers does it REALLY matter whether the value is&amp;nbsp;12,345,678,912,345,678,912 or&amp;nbsp;12,345,678,912,345,600,000?&amp;nbsp; How will that trivial difference impact the analysis your going to do with them?&lt;/P&gt;</description>
    <pubDate>Sat, 29 Feb 2020 05:06:56 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-02-29T05:06:56Z</dc:date>
    <item>
      <title>Why not display the right formation for a20?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-not-display-the-right-formation-for-a20/m-p/628376#M185670</link>
      <description>&lt;P&gt;Thank you for your reply&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
a9=123456789;
a15=123456789123456;
a20=12345678912345678912;
format a15 15.  a20  20.;
run&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Image.jpg" style="width: 355px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36468i11232C1C5D91B47D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Image.jpg" alt="Image.jpg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Feb 2020 03:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-not-display-the-right-formation-for-a20/m-p/628376#M185670</guid>
      <dc:creator>Cingchih</dc:creator>
      <dc:date>2020-02-29T03:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why not display the right formation for a20?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-not-display-the-right-formation-for-a20/m-p/628378#M185671</link>
      <description>&lt;P&gt;The display format used for a number does not change how the numbers are stored.&amp;nbsp; If your values have more than 15 decimal digits you cannot store them as a number in SAS because SAS stores all numbers as floating point values.&amp;nbsp; Once the number of significant digits exceeds the amount that can be stored in that way you will lose some of the lower order digits.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If those values are identifiers then store them as character strings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If they are numbers does it REALLY matter whether the value is&amp;nbsp;12,345,678,912,345,678,912 or&amp;nbsp;12,345,678,912,345,600,000?&amp;nbsp; How will that trivial difference impact the analysis your going to do with them?&lt;/P&gt;</description>
      <pubDate>Sat, 29 Feb 2020 05:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-not-display-the-right-formation-for-a20/m-p/628378#M185671</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-29T05:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why not display the right formation for a20?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-not-display-the-right-formation-for-a20/m-p/628500#M185735</link>
      <description>&lt;P&gt;Many resources are available if you want to understand how computers store numbers.&lt;/P&gt;
&lt;P&gt;For example search for SAS numerical precision.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Feb 2020 23:46:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-not-display-the-right-formation-for-a20/m-p/628500#M185735</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-02-29T23:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why not display the right formation for a20?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-not-display-the-right-formation-for-a20/m-p/630304#M186584</link>
      <description>&lt;P&gt;In fact, my question is that six big datasets merge&amp;nbsp; into a dataset. However, they do not&amp;nbsp;share variable (also known as key variable).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I converted several variables into string attributes, and then concatenated all of them to form the key variables used in the merge. So, the examples I have presented are actually simplified. I have resolved this through full join of proc sql, and thank you for your response.&lt;/P&gt;&lt;P&gt;The attached picture is my key variable. It is composed of 4 variables.&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="Image 026.png" style="width: 140px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36663i2228723DA74038CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Image 026.png" alt="Image 026.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Mar 2020 02:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-not-display-the-right-formation-for-a20/m-p/630304#M186584</guid>
      <dc:creator>Cingchih</dc:creator>
      <dc:date>2020-03-07T02:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Why not display the right formation for a20?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-not-display-the-right-formation-for-a20/m-p/630456#M186648</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/165497"&gt;@Cingchih&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;In fact, my question is that six big datasets merge&amp;nbsp; into a dataset. However, they do not&amp;nbsp;share variable (also known as key variable).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I converted several variables into string attributes, and then concatenated all of them to form the key variables used in the merge. So, the examples I have presented are actually simplified. I have resolved this through full join of proc sql, and thank you for your response.&lt;/P&gt;
&lt;P&gt;The attached picture is my key variable. It is composed of 4 variables.&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your two paragraphs are contradictory.&amp;nbsp; If the six datasets do not share key variables then how did you generate a key variable?&amp;nbsp; Why did you concatenate?&amp;nbsp; Why not just merge by the 4 variables?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  merge big1-big6;
  by a b c d;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you do have to build some type of variable to try to match them then make sure to generate it in a consistent way.&amp;nbsp; If the values of any of the original variables vary in the number of characters used to represent them then you most likely want to either force all of the values to use the same number of characters in the generated string&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;A    B  C  D    ABCD
-- ---- -- -- ------------
ab  123 xy 67 ab0123xy67
c  4567  w  8&amp;nbsp;.c4567.w08&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;, or use some type of separator.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;A    B  C  D    ABCD
-- ---- -- -- ------------
ab  123 xy 67 ab|123|xy|67
c  4567  w  8&amp;nbsp;c|4567|w|8&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS Why is it that so many users on this forum jump through hoops to post photographs of their data.&amp;nbsp; Just copy and paste the text.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2020 04:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-not-display-the-right-formation-for-a20/m-p/630456#M186648</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-08T04:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Why not display the right formation for a20?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-not-display-the-right-formation-for-a20/m-p/630496#M186662</link>
      <description>&lt;P&gt;Thank you for your reply, and I will study it later.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2020 16:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-not-display-the-right-formation-for-a20/m-p/630496#M186662</guid>
      <dc:creator>Cingchih</dc:creator>
      <dc:date>2020-03-08T16:35:44Z</dc:date>
    </item>
  </channel>
</rss>

