<?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 Same SQL field shows different data type in SAS PC &amp;amp; EG in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Same-SQL-field-shows-different-data-type-in-SAS-PC-amp-EG/m-p/410967#M100439</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Same&amp;nbsp;SQL table field shows different data types in SAS PC &amp;amp; EG.&lt;/P&gt;&lt;P&gt;I ran same PROC CONTENTS in PC &amp;amp; EG environment and here is the output.&amp;nbsp;Check for &lt;U&gt;&lt;STRONG&gt;DATADATE&lt;/STRONG&gt;&lt;/U&gt; field:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;CONTENTS&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DATA&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=DB_NAME.TABLE_NAME;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;RUN&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;U&gt;SAS PC output:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PC.JPG" style="width: 371px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16476i3F5EC073869D95F4/image-size/large?v=v2&amp;amp;px=999" role="button" title="PC.JPG" alt="PC.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;U&gt;SAS EG output:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EG.JPG" style="width: 341px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16477iC991340C32C22CC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="EG.JPG" alt="EG.JPG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Actual SQL table definition:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SQL.JPG" style="width: 763px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16478i9C2877276463441F/image-dimensions/763x61?v=v2" width="763" height="61" role="button" title="SQL.JPG" alt="SQL.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because of this data type mismatch I'm not able to append data to this table from SAS PC.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;WARNING: Variable DataDate not appended because of type mismatch.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Nov 2017 19:17:55 GMT</pubDate>
    <dc:creator>Dreamer</dc:creator>
    <dc:date>2017-11-06T19:17:55Z</dc:date>
    <item>
      <title>Same SQL field shows different data type in SAS PC &amp; EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Same-SQL-field-shows-different-data-type-in-SAS-PC-amp-EG/m-p/410967#M100439</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Same&amp;nbsp;SQL table field shows different data types in SAS PC &amp;amp; EG.&lt;/P&gt;&lt;P&gt;I ran same PROC CONTENTS in PC &amp;amp; EG environment and here is the output.&amp;nbsp;Check for &lt;U&gt;&lt;STRONG&gt;DATADATE&lt;/STRONG&gt;&lt;/U&gt; field:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;CONTENTS&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DATA&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=DB_NAME.TABLE_NAME;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;RUN&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;U&gt;SAS PC output:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PC.JPG" style="width: 371px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16476i3F5EC073869D95F4/image-size/large?v=v2&amp;amp;px=999" role="button" title="PC.JPG" alt="PC.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;U&gt;SAS EG output:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EG.JPG" style="width: 341px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16477iC991340C32C22CC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="EG.JPG" alt="EG.JPG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Actual SQL table definition:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SQL.JPG" style="width: 763px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16478i9C2877276463441F/image-dimensions/763x61?v=v2" width="763" height="61" role="button" title="SQL.JPG" alt="SQL.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because of this data type mismatch I'm not able to append data to this table from SAS PC.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;WARNING: Variable DataDate not appended because of type mismatch.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 19:17:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Same-SQL-field-shows-different-data-type-in-SAS-PC-amp-EG/m-p/410967#M100439</guid>
      <dc:creator>Dreamer</dc:creator>
      <dc:date>2017-11-06T19:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Same SQL field shows different data type in SAS PC &amp; EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Same-SQL-field-shows-different-data-type-in-SAS-PC-amp-EG/m-p/411022#M100465</link>
      <description>&lt;P&gt;Show us the libname statements creating library DB_NAME for both environments (EG and proper SAS).&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 01:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Same-SQL-field-shows-different-data-type-in-SAS-PC-amp-EG/m-p/411022#M100465</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-11-07T01:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Same SQL field shows different data type in SAS PC &amp; EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Same-SQL-field-shows-different-data-type-in-SAS-PC-amp-EG/m-p/411326#M100551</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I have same library statement in both environment:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;libname&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; DB_NAME &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;odbc&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;dsn&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'PC_ODBC_DSN_FOR_THIS_DATABASE'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;uid&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;UID."&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;pwd&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;PWD."&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;schema&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"dbo"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;libname&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; DB_NAME &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;odbc&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;dsn&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'UNIX_ODBC_DSN_FOR_THIS_DATABASE'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;uid&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;UID."&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;pwd&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;PWD."&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;schema&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"dbo"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 19:32:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Same-SQL-field-shows-different-data-type-in-SAS-PC-amp-EG/m-p/411326#M100551</guid>
      <dc:creator>Dreamer</dc:creator>
      <dc:date>2017-11-07T19:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Same SQL field shows different data type in SAS PC &amp; EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Same-SQL-field-shows-different-data-type-in-SAS-PC-amp-EG/m-p/411415#M100579</link>
      <description>&lt;P&gt;It looks like the ODBC driver differs in both environments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS will use whatever ODBC gives it. You can use another ODBC client to confirm this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the cat() or vvalue() function to avoid reading errors when the type is uncertain:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data T1; D='01jan2016'd; format D date9.; run;

data WANT1; set T1; DATE=input(vvalue(D),date9.); run;

data T2; D='01jan2016'; run;

data WANT2; set T2; DATE=input(vvalue(D),date9.); run; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 02:51:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Same-SQL-field-shows-different-data-type-in-SAS-PC-amp-EG/m-p/411415#M100579</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-11-08T02:51:11Z</dc:date>
    </item>
  </channel>
</rss>

