<?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: SAS data into Ms SQL in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-data-into-Ms-SQL/m-p/764211#M20063</link>
    <description>&lt;P&gt;As you are using best17.15 in SAS, use&amp;nbsp; numeric(17,15) format in MS SQL&lt;/P&gt;</description>
    <pubDate>Thu, 26 Aug 2021 14:17:38 GMT</pubDate>
    <dc:creator>Sajid01</dc:creator>
    <dc:date>2021-08-26T14:17:38Z</dc:date>
    <item>
      <title>SAS data into Ms SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-data-into-Ms-SQL/m-p/764190#M20062</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am writing SAS dataset into an Ms SQL table. I have 2 SAS columns that have type&amp;nbsp;best17.15 in SAS and type numeric(15) in Ms SQL. When it inserts the data these 2 columns populate as NULL in Ms SQL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why this does happen and how can I resolve the issue?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 13:42:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-data-into-Ms-SQL/m-p/764190#M20062</guid>
      <dc:creator>Citrine10</dc:creator>
      <dc:date>2021-08-26T13:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS data into Ms SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-data-into-Ms-SQL/m-p/764211#M20063</link>
      <description>&lt;P&gt;As you are using best17.15 in SAS, use&amp;nbsp; numeric(17,15) format in MS SQL&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 14:17:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-data-into-Ms-SQL/m-p/764211#M20063</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-08-26T14:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS data into Ms SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-data-into-Ms-SQL/m-p/764300#M20064</link>
      <description>&lt;P&gt;You don't say how the data are being loaded or how the MS SQL Server table was created, which would be useful information.&amp;nbsp; But suppose you are creating the table in a data step using SAS/Access:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the DBTYPE= data set option to create an MS SQL column of the appropriate type.&amp;nbsp; An example from the documentation is&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydblib.newdept(dbtype=(deptno='number(10,2)' city='char(25)'));
   set mydblib.dept;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There's another option that controls translation in the other direction, DBSASTYPE.&amp;nbsp; You should read the documentation on both of those options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't say that the documentation for SAS/Access is great - some of it seems designed to remind someone of details they're forgotten rather than to show for the first time - but still, there's a lot of good stuff in there, and you would be well served to read both the MS SQL section and the more general relational database section in the help file.&amp;nbsp; In Windows, they can be found here, and there's an equivalent online somewhere.&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="JackHamilton_0-1630002121724.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63068iF682E28FC38098A2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JackHamilton_0-1630002121724.png" alt="JackHamilton_0-1630002121724.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 18:22:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-data-into-Ms-SQL/m-p/764300#M20064</guid>
      <dc:creator>JackHamilton</dc:creator>
      <dc:date>2021-08-26T18:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS data into Ms SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-data-into-Ms-SQL/m-p/764463#M20065</link>
      <description>Hi Sajid, that give me an error.&lt;BR /&gt;ERROR: CLI execute error: [SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Arithmetic overflow error converting&lt;BR /&gt;float to data type numeric. : [SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]The statement has been&lt;BR /&gt;terminated.</description>
      <pubDate>Fri, 27 Aug 2021 14:01:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-data-into-Ms-SQL/m-p/764463#M20065</guid>
      <dc:creator>Citrine10</dc:creator>
      <dc:date>2021-08-27T14:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS data into Ms SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-data-into-Ms-SQL/m-p/764473#M20066</link>
      <description>&lt;P&gt;No worries. You are now near the solution.&lt;/P&gt;
&lt;P&gt;You have two options&lt;/P&gt;
&lt;P&gt;Option 1&lt;/P&gt;
&lt;P&gt;Use FLOAT(n) format as the data type for SQL.&lt;BR /&gt;What should be the values of n?&lt;BR /&gt;You can look here for the precision you require &lt;A href="https://docs.microsoft.com/en-us/sql/t-sql/data-types/float-and-real-transact-sql?view=sql-server-ver15" target="_blank"&gt;https://docs.microsoft.com/en-us/sql/t-sql/data-types/float-and-real-transact-sql?view=sql-server-ver15&lt;/A&gt; &lt;BR /&gt;For single precision&amp;nbsp; the value of n=24 should be sufficient. For double precision n =53..&lt;/P&gt;
&lt;P&gt;Option 2&lt;/P&gt;
&lt;P&gt;Another suggestion, you can convert the numbers to string in SAS and use CHAR(n) of VARCHAR(n) as per your preference. Here n=17 should server your purpose as you are using best17.15.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 14:29:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-data-into-Ms-SQL/m-p/764473#M20066</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-08-27T14:29:05Z</dc:date>
    </item>
  </channel>
</rss>

