<?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: Numeric Format Changing In Macro List in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Numeric-Format-Changing-In-Macro-List/m-p/453396#M284034</link>
    <description>&lt;P&gt;Thank you so much for the swift response!&amp;nbsp; This is the perfect solution for my issue.&amp;nbsp; The previous format was 12-digit, so I never had a problem before.&amp;nbsp; Thanks again!&lt;/P&gt;</description>
    <pubDate>Wed, 11 Apr 2018 22:31:29 GMT</pubDate>
    <dc:creator>PatricktLeon</dc:creator>
    <dc:date>2018-04-11T22:31:29Z</dc:date>
    <item>
      <title>Numeric Format Changing In Macro List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numeric-Format-Changing-In-Macro-List/m-p/453389#M284032</link>
      <description>&lt;P&gt;Hello SAS Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a macro list that contains 14-digit numeric IDs.&amp;nbsp; When I %put the list in the log I am not seeing the 14-digits, but rather:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 29 observations read from the data set WORK.BIH.&lt;/P&gt;&lt;P&gt;WHERE MemID not in (1.9961106E13, 1.9961109E13, 1.9961109E13, 1.9961109E13, 1.9961109E13, 1.9961109E13, 1.9961109E13,1.9961109E13, 1.9961109E13, 1.9961109E13, 1.9961109E13, 1.996111E13, 1.996111E13, 1.996111E13, 1.996111E13, 1.996111E13,1.9961111E13,1.9961203E13, 1.9961203E13, 1.9961203E13, 1.9961203E13, 1.9961203E13, 1.9961203E13, 1.9961203E13, 1.9961203E13, 1.9961204E13...);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone advise why SAS is converting the ID to this format?&amp;nbsp; I need to keep the 14 digit format&amp;nbsp;in the macro list for further linking.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 22:18:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numeric-Format-Changing-In-Macro-List/m-p/453389#M284032</guid>
      <dc:creator>PatricktLeon</dc:creator>
      <dc:date>2018-04-11T22:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric Format Changing In Macro List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numeric-Format-Changing-In-Macro-List/m-p/453394#M284033</link>
      <description>&lt;P&gt;The problem occurred earlier, when creating the macro variable.&amp;nbsp; You have to go back to that section of code to fix it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely, you had something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;select distinct id into : my_macrovar separated by ', ' from source_data;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since macro variables are character strings, and ID is numeric, this forces SQL to make a numeric to character conversion.&amp;nbsp; And SQL uses a 12-character format when doing that.&amp;nbsp; You can control the process by changing the SELECT statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;select distinct put(id, 14.) into : my_macrovar separated by ', ' from source_data;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 22:26:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numeric-Format-Changing-In-Macro-List/m-p/453394#M284033</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-11T22:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric Format Changing In Macro List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numeric-Format-Changing-In-Macro-List/m-p/453396#M284034</link>
      <description>&lt;P&gt;Thank you so much for the swift response!&amp;nbsp; This is the perfect solution for my issue.&amp;nbsp; The previous format was 12-digit, so I never had a problem before.&amp;nbsp; Thanks again!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 22:31:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numeric-Format-Changing-In-Macro-List/m-p/453396#M284034</guid>
      <dc:creator>PatricktLeon</dc:creator>
      <dc:date>2018-04-11T22:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Numeric Format Changing In Macro List</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Numeric-Format-Changing-In-Macro-List/m-p/453408#M284035</link>
      <description>&lt;P&gt;Since the variable has a name MEMID I am guessing it is some sort of an identifier. If so you should likely make it character and long enough to hold any&amp;nbsp;expected growth 16 or 20 characters since most organizations do very little arithmetic with member identifiers. Then this issue would never arise and not run into potential issues with the precision of storage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;data junk;
   x = 12345678912345678;
   y = 12345678912345679;
run;
proc print data=junk;
format x y best32.;
run;&lt;/PRE&gt;
&lt;P&gt;with a result of&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;&lt;A name="IDX24" target="_blank"&gt;&lt;/A&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" cellspacing="0" cellpadding="3" summary="Procedure Print: Data Set USER.JUNK"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c m header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;x&lt;/TH&gt;
&lt;TH class="c m header" scope="col"&gt;y&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="l m rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="r data"&gt;12345678912345678&lt;/TD&gt;
&lt;TD class="r data"&gt;12345678912345680&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Apr 2018 23:05:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Numeric-Format-Changing-In-Macro-List/m-p/453408#M284035</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-11T23:05:04Z</dc:date>
    </item>
  </channel>
</rss>

