<?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 simple question in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/simple-question/m-p/69467#M19945</link>
    <description>Brand new to SAS programming so I am taking it slow. I have an intermediate background in SQL so I have been taking existing SAS programs and using PROC SQL to attempt recreate the actions being done in the code I have been given. Back-translating if you will, like reverse engineering something in order to learn how something works. However, I am at a loss (not the first I am sure) as to why my code is not pulling from SQL tables correctly. After I set my libraries up (libname SQL oledb udl_file="C:\dir\subdir\EXAMPLE.udl";), the code I have is:&lt;BR /&gt;
&lt;BR /&gt;
data TEST;  &lt;BR /&gt;
set SQL.TEST;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
This runs fine and I get my variables into my work library fine. I check the work.test and everything is there and all the attributes are fine. But if I try and reproduce this using proc sql, my attributes are different from what is set in the SQL table. &lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
connect to odbc (dsn=EXAMPLE);&lt;BR /&gt;
create table TEST as select * from connection to &lt;BR /&gt;
	odbc(select * from EXAMPLE.dbo.TEST);&lt;BR /&gt;
disconnect from odbc;&lt;BR /&gt;
quit ;&lt;BR /&gt;
&lt;BR /&gt;
Basically my attribute LENGTH is doubled on some of my variables and not on others. What logic am I missing here?</description>
    <pubDate>Wed, 25 May 2011 18:16:53 GMT</pubDate>
    <dc:creator>Alphanumeric</dc:creator>
    <dc:date>2011-05-25T18:16:53Z</dc:date>
    <item>
      <title>simple question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/simple-question/m-p/69467#M19945</link>
      <description>Brand new to SAS programming so I am taking it slow. I have an intermediate background in SQL so I have been taking existing SAS programs and using PROC SQL to attempt recreate the actions being done in the code I have been given. Back-translating if you will, like reverse engineering something in order to learn how something works. However, I am at a loss (not the first I am sure) as to why my code is not pulling from SQL tables correctly. After I set my libraries up (libname SQL oledb udl_file="C:\dir\subdir\EXAMPLE.udl";), the code I have is:&lt;BR /&gt;
&lt;BR /&gt;
data TEST;  &lt;BR /&gt;
set SQL.TEST;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
This runs fine and I get my variables into my work library fine. I check the work.test and everything is there and all the attributes are fine. But if I try and reproduce this using proc sql, my attributes are different from what is set in the SQL table. &lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
connect to odbc (dsn=EXAMPLE);&lt;BR /&gt;
create table TEST as select * from connection to &lt;BR /&gt;
	odbc(select * from EXAMPLE.dbo.TEST);&lt;BR /&gt;
disconnect from odbc;&lt;BR /&gt;
quit ;&lt;BR /&gt;
&lt;BR /&gt;
Basically my attribute LENGTH is doubled on some of my variables and not on others. What logic am I missing here?</description>
      <pubDate>Wed, 25 May 2011 18:16:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/simple-question/m-p/69467#M19945</guid>
      <dc:creator>Alphanumeric</dc:creator>
      <dc:date>2011-05-25T18:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: simple question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/simple-question/m-p/69468#M19946</link>
      <description>i did notice in your code that the LIBNAME names uses OLEBD to connect to SQL Server and the SQL Pass-through uses ODBC.  Try using the same connection method and see what happens.&lt;BR /&gt;
&lt;BR /&gt;
D</description>
      <pubDate>Wed, 25 May 2011 19:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/simple-question/m-p/69468#M19946</guid>
      <dc:creator>darrylovia</dc:creator>
      <dc:date>2011-05-25T19:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: simple question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/simple-question/m-p/69469#M19947</link>
      <description>Thanks. Seems that was my problem.</description>
      <pubDate>Thu, 26 May 2011 15:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/simple-question/m-p/69469#M19947</guid>
      <dc:creator>Alphanumeric</dc:creator>
      <dc:date>2011-05-26T15:13:34Z</dc:date>
    </item>
  </channel>
</rss>

