<?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: odbc in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929962#M365890</link>
    <description>&lt;P&gt;Hi Patrick,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much for your help. I was not able to follow your method where you provide below as I dont know what to put after ODBC&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;libname yourlib ODBC .....;
proc contents data=yourlib.&amp;lt;table name&amp;gt;(keep=&amp;lt;varname under investigation&amp;gt;);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What my user did was just saved the files to a newly created library and proc content from there. Every entries show only 2 decimal places.&lt;/P&gt;
&lt;P&gt;I have checked all the platforms before the files reach SAS all were able to display 4decimal places. That is why I think it is to do with ODBC set up or SAS setup.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 May 2024 09:44:58 GMT</pubDate>
    <dc:creator>HeatherNewton</dc:creator>
    <dc:date>2024-05-28T09:44:58Z</dc:date>
    <item>
      <title>No of decimal positions via ODBC connection</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/927266#M364933</link>
      <description>&lt;P&gt;Hi I have a file uploaded to a big data platform showing correct d.p but somehow when our clients see the same file via ODBC, the decimal place change from 4 to 2, how did that happen? Do I need to setup schema for showing data via ODBC or there is specific settings required dealing with?&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 12:04:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/927266#M364933</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2024-05-28T12:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/927268#M364934</link>
      <description>&lt;P&gt;We can't know the details of your environment. You need to tell us. For example what is this "big data platform"? Some hadoop cluster, a database, ???&lt;/P&gt;
&lt;P&gt;From a helicopter perspective: Sounds like a display issue either caused by the table definition (DDL) or by the client application surfacing the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you access the uploaded file via SAS what do you see (using the best32. format).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 02:57:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/927268#M364934</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-05-07T02:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/927279#M364935</link>
      <description>&lt;P&gt;oh I just tried to use format best32.4 but it shows that the informat is 21.2&lt;/P&gt;
&lt;P&gt;so somewhere the informat was already setup? I didnt know ODBS has preset schema for tables..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 06:58:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/927279#M364935</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2024-05-07T06:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/927282#M364936</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I didnt know ODBS has preset schema for tables..&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;It doesn't.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please show us the code you use for loading the table into the "big data platform". Please also share the libname and/or connect statement.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If the source table is SAS then please also share a Proc Contents for this table and tell us with which variable you've got the challenge.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 08:04:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/927282#M364936</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-05-07T08:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929126#M365585</link>
      <description>&lt;P&gt;&amp;nbsp;I checked all the way before sas&lt;/P&gt;
&lt;P&gt;1. database&amp;nbsp; &amp;nbsp;2. domain&amp;nbsp; &amp;nbsp;3. interface&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. database - where the required table is stored&lt;/P&gt;
&lt;P&gt;2. domain - where text file output from the required table in database is located&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. interface - this interface is between domain in 2 and sas&amp;nbsp; (this interface is something related to setting up odbc)&lt;/P&gt;
&lt;P&gt;all 1, 2,3 are showing 4d.p., so it is sas that is the problem&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the IT guy who checked the interface confirmed it is showing 4d.p. and advised us to check setting in sas&lt;/P&gt;
&lt;P&gt;how to check?&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;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 06:33:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929126#M365585</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2024-05-21T06:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929132#M365590</link>
      <description>&lt;P&gt;&lt;EM&gt;1. database - where the required table is stored&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;- What is this "database"&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;2. domain - where text file output from the required table in database is located&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;- I don't understand what the term "domain" could mean in the context of a storage location for a text file. And how is that related to the database?&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;3. interface - this interface is between domain in 2 and sas&amp;nbsp; (this interface is something related to setting up odbc)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;- I must assume this is just the ODBC component connecting to "some database or the like"&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;all 1, 2,3 are showing 4d.p., so it is sas that is the problem&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;How is the text file sh&lt;/P&gt;
&lt;P style="line-height: 1.71429;"&gt;owing "4d.p"?&amp;nbsp;&lt;/P&gt;
&lt;P style="line-height: 1.71429;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="line-height: 1.71429;"&gt;From what you wrote (but you still haven't confirmed this!) I must assume the data you access is stored in Hadoop as a text file. If so then it's:&lt;/P&gt;
&lt;P style="line-height: 1.71429;"&gt;&lt;EM&gt;text file -&amp;gt; HIVE (the "table schema") -&amp;gt; ODBC -&amp;gt; SAS&lt;/EM&gt;&lt;/P&gt;
&lt;P style="line-height: 1.71429;"&gt;Please show some code how you access the "table".&amp;nbsp;&lt;/P&gt;
&lt;P style="line-height: 1.71429;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="line-height: 1.71429;"&gt;chatGPT has given me below architecture which somehow looks right. SAS is the 3rd Party Application, the text file would be stored under HDFS.&lt;/P&gt;
&lt;P style="line-height: 1.71429;"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1716278501454.png" style="width: 603px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96648i8C54F239D86138F3/image-dimensions/603x776?v=v2" width="603" height="776" role="button" title="Patrick_0-1716278501454.png" alt="Patrick_0-1716278501454.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P style="line-height: 1.71429;"&gt;As a next step in trying to determine what you're actually dealing with please share the SAS log and report when using below code (of course using your actual libname/libref):&lt;/P&gt;
&lt;PRE style="line-height: 1.71429;"&gt;&lt;CODE class=" language-sas"&gt;libname myref odbc &amp;lt;connection info&amp;gt;;

options sastrace=',,,d' sastraceloc=saslog nostsuffix;
libname myref list;
data work.test;
  set myref.&amp;lt;table name&amp;gt;;
  stop;
run;

proc contents data=work.test;
run;quit;

proc options group=sql;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 08:17:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929132#M365590</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-05-21T08:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929133#M365591</link>
      <description>&lt;P&gt;the database is db2&lt;/P&gt;
&lt;P&gt;the domain, is just somewhere this text file from db2 is stored, I dont think it is hadoop as out system is at least 30 years behind&lt;/P&gt;
&lt;P&gt;It is like IT system create required files in databse then output as text to this domain where downstream system or&amp;nbsp; users subscribe for these files for later use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 08:18:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929133#M365591</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2024-05-21T08:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929135#M365592</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;the database is db2&lt;/P&gt;
&lt;P&gt;the domain, is just somewhere this text file from db2 is stored, I dont think it is hadoop as out system is at least 30 years behind&lt;/P&gt;
&lt;P&gt;It is like IT system create required files in databse then output as text to this domain where downstream system or&amp;nbsp; users subscribe for these files for later use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can't connect directly to a text file via ODBC. ODBC connects applications (like allowing SAS and DB2 to communicate via ODBC with each other). &lt;BR /&gt;To WHICH application is SAS connecting to via ODBC where displayed precision is not as expected? That's the bit which needs investigation first.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A lot of things could be clarified if you run the code and then share the log and proc contents report I've asked for.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 08:42:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929135#M365592</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-05-21T08:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929136#M365593</link>
      <description>&lt;P&gt;unfortunately I cannot run SAS myself, I will ask a colleague to and get back to you but may be a bit later as he is on vacation&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 08:50:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929136#M365593</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2024-05-21T08:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929153#M365597</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;oh I just tried to use format best32.4 but it shows that the informat is 21.2&lt;/P&gt;
&lt;P&gt;so somewhere the informat was already setup? I didnt know ODBS has preset schema for tables..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Format is for display, Informat is for reading external data. The two do not have to have much in common. However if the value was reading only two decimals then showing 3 or more, which a format may specify, will basically show 0 unless the value was one that has problems with binary to decimal conversion. Setting a format will never change an informat or actual values of data as read. So I am not sure what your point about this format may be intended to be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The BESTW.D version formats from the documentation:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV id="n1mfyov4bz7y6un12xej0thksqjz" class="xisDoc-comparisons"&gt;
&lt;UL class="xisDoc-listUnordered"&gt;
&lt;LI class="xisDoc-item"&gt;The BESTD&lt;EM class="xisDoc-userSuppliedValue"&gt;w.p&lt;/EM&gt; format is a combination of the BEST&lt;EM class="xisDoc-userSuppliedValue"&gt;w&lt;/EM&gt;. format and the D&lt;EM class="xisDoc-userSuppliedValue"&gt;w.p&lt;/EM&gt; format in that it formats all numeric data, and it does a better job of aligning decimals than the BEST&lt;EM class="xisDoc-userSuppliedValue"&gt;w&lt;/EM&gt;. format.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Alignment of decimal points may be a bit tricky in actual values displayed when a large range of values are involved.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 13:49:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929153#M365597</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-05-21T13:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929770#M365812</link>
      <description>&lt;P&gt;what does &amp;lt;connection info&amp;gt; look like here? username followed by password? or some kind of strings?&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 06:11:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929770#M365812</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2024-05-27T06:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929783#M365814</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;what does &amp;lt;connection info&amp;gt; look like here? username followed by password? or some kind of strings?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just all the info you need to provide in addition to libref and the ODBC keyword.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Under docu&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/p0bu3zsz1a08ton1msxdx1jo45np.htm" target="_self"&gt;&amp;nbsp;&amp;nbsp;LIBNAME Statement for the ODBC Engine&lt;/A&gt;&amp;nbsp;you can also find sample code like:&lt;/P&gt;
&lt;PRE&gt;libname mydblib odbc user=myusr1 password=mypwd1 datasrc=mydatasource;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 May 2024 07:04:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929783#M365814</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-05-27T07:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929793#M365820</link>
      <description>&lt;P&gt;I am not sure what they are as I dont set them up. But I found the file odbc.ini as attached, does this help? all the password is XXXXXX though&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="odbc.ini_1.jpg" style="width: 990px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96790iA0C82783AC63C43B/image-size/large?v=v2&amp;amp;px=999" role="button" title="odbc.ini_1.jpg" alt="odbc.ini_1.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="odbc.ini_2.jpg" style="width: 961px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96791i20D29FB0E6D73B81/image-size/large?v=v2&amp;amp;px=999" role="button" title="odbc.ini_2.jpg" alt="odbc.ini_2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 07:54:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929793#M365820</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2024-05-27T07:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929794#M365821</link>
      <description>&lt;P&gt;actually the people who set up the odbc confirmed they can show 4d.p. and ask me to check sas setting. what kind of setting does he mean, where do we have prior format setting in SAS?&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 08:01:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929794#M365821</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2024-05-27T08:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929798#M365824</link>
      <description>&lt;P&gt;Using SAS is there a libname defined to the database with the table where you don't see the variable in the expected precision? If not then please write such a libname statement that YOU can execute.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then please share with us the output of a Proc Contents for this table. Some code you run along the line of below:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;libname yourlib ODBC .....;
proc contents data=yourlib.&amp;lt;table name&amp;gt;(keep=&amp;lt;varname under investigation&amp;gt;);
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 08:46:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929798#M365824</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-05-27T08:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929833#M365831</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;actually the people who set up the odbc confirmed they can show 4d.p. and ask me to check sas setting. what kind of setting does he mean, where do we have prior format setting in SAS?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Can you explain what "4d.p." means?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that if your variables in the external database are using DECIMAL numbers (fixed number of decimal digits) then SAS does NOT have anything that is equivalent.&amp;nbsp; All SAS numbers are stored as 64-bit binary floating point values.&amp;nbsp; &amp;nbsp;Note that some decimal fractions, like 0.3 which is 3/10, cannot be exactly represented in binary fractions.&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 16:04:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929833#M365831</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-05-27T16:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929871#M365849</link>
      <description>&lt;P&gt;4 d.p. mean I need output in 4 decimal place&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;all input before SAS (from DB2 to text file in a platform to another big data platform) are all showing 4 decimal place but SAS is showing 2 decimal place only. I need to confirm if there are settings somewhere in SAS that has change it to 2 decimal places.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I attached proc content for your reference it is highlighted in yellow the variable PD&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="proc content.jpg" style="width: 872px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96798iB0B611C5E3092A31/image-size/large?v=v2&amp;amp;px=999" role="button" title="proc content.jpg" alt="proc content.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;what governs the output format in sas via odbc?&lt;/P&gt;
&lt;P&gt;the informat show here ? was there schema somewhere already setup somewhere?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 01:44:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929871#M365849</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2024-05-28T01:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929874#M365851</link>
      <description>&lt;P&gt;How did you MAKE that dataset?&amp;nbsp; Please show the code.&lt;/P&gt;
&lt;P&gt;I do not know of anything that would change a variable that is defined to store 4 digits after the decimal place to be displayed with only 2 digits after the decimal place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS/Access to XYZ&amp;nbsp; database will generally match the format attached to a variable (the INFORMAT for existing dataset is meaningless) to the variable definition in the remote database.&amp;nbsp;So if the remote variable is designed to store N decimal digits with D of them occurring after the decimal point then in general that would translate to a value of N+1&amp;nbsp; for the Width of the format (SAS includes the decimal point in the width).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that 20 digits is MORE THAN SAS CAN STORE IN A NUMERIC VARIABLE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are having a lot of trouble with the PD variable you could try using the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/n0v4ma1zb9lu99n1728j279rjcqi.htm#:~:text=Specifies%20data%20types%20to%20override,data%20types%20during%20input%20processing.&amp;amp;text=Restriction%3A,Snowflake%20client%20and%20database%20limitations." target="_self"&gt;DBSASTYPE=&lt;/A&gt; dataset option to have the value transferred as a character string instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 01:58:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929874#M365851</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-05-28T01:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929881#M365852</link>
      <description>&lt;P&gt;Assuming you've run this Proc Contents using a libref that you defined via a libname statement (and not some pre-assigned libname that potentially uses a SAS metadata table object):&lt;/P&gt;
&lt;P&gt;With any SAS/Access engine when reading a database table the variable type, format and informat is derived from the table definition in the database (DDL). In your case that could be something like DECIMAL(21,2). If that's the case then precision would already be lost on the DB side.&lt;/P&gt;
&lt;P&gt;Next steps:&lt;/P&gt;
&lt;P&gt;1. Assign format BEST32. to variable PD and inspect if any value shows with more than two decimals.&lt;/P&gt;
&lt;P&gt;2. If no values with more than 2 decimals: Request the DDL (table definition) from the Sybase DBA so you can verify that you don't access a table where precision already is lost on the DB side.&lt;/P&gt;
&lt;P&gt;...further steps depending on the result of 1) and 2)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For 1: If there are any rows in table Test then you've got values with more than 2 decimals.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  format pd best32.;
  set &amp;lt;yourlib&amp;gt;.&amp;lt;yourtable&amp;gt;(keep=pd);
  if 100*round(pd,0.0000000001) ne int(100*pd) then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 May 2024 02:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929881#M365852</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-05-28T02:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: odbc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929883#M365853</link>
      <description>&lt;P&gt;pd is a between 0 and 1&lt;/P&gt;
&lt;P&gt;it is basically equals total bad count/total active count e.g. 4/10 so 0.4&lt;/P&gt;
&lt;P&gt;so it will never be 20 as we kept decimal place to 4 only in all the sources&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 02:24:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-of-decimal-positions-via-ODBC-connection/m-p/929883#M365853</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2024-05-28T02:24:48Z</dc:date>
    </item>
  </channel>
</rss>

