<?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: Extreme Newbie Question: connecting to DB in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Extreme-Newbie-Question-connecting-to-DB/m-p/609731#M17963</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Try experimenting with creating some subsets from a few SASHELP datasets before you use ODBC against your big file. For example, this makes a subset of SASHELP.CLASS for the subset of rows where AGE GE 14:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;** option 1;
data work.teens_d;
  set sashelp.class;
  where age ge 14;
run;

proc print data=work.teens_d;
  title 'subset created with a dataset';
run;

** option 2;
proc sql;
  create table work.teens_s as
  select *
  from sashelp.class
  where age ge 14;
quit;

proc print data=work.teens_s;
  title 'subset created with a proc sql';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then eventually, you will do something like described here -- &lt;A href="http://support.sas.com/kb/41/888.html" target="_blank"&gt;http://support.sas.com/kb/41/888.html&lt;/A&gt; which are just variations on the above programs and utilize the LIBNAME engine to ODBC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Before you do this, I would recommend taking our free Programming 1 e-learning course: &lt;A href="https://support.sas.com/edu/schedules.html?ctry=us&amp;amp;crs=PROG1" target="_blank"&gt;https://support.sas.com/edu/schedules.html?ctry=us&amp;amp;crs=PROG1&lt;/A&gt; (click the start button under the e-learning section). You will need to log onto a SAS Profile before you complete the activation process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;adfasdf&lt;/P&gt;</description>
    <pubDate>Thu, 05 Dec 2019 16:47:01 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2019-12-05T16:47:01Z</dc:date>
    <item>
      <title>Extreme Newbie Question: connecting to DB</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extreme-Newbie-Question-connecting-to-DB/m-p/609728#M17961</link>
      <description>&lt;P&gt;Good morning!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To say that I'm new to SAS is an understatement. While I wish I had more foundational knowledge of databases and programming, the reality is that I do not and my new job requires getting up to speed with SAS. I'm confident I can get there, at some point, but I'm not there yet. Not even close.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to access a database and have explored various help guides but most assume some base level of knowledge that I simply don't have - so I'm hoping someone here can assist in getting me started. For various reasons, I cannot request someone at my new employer sit down and walk me through everything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I requested and was granted access to a large database containing roughly 114,000,000 records. The IT staffer emailed me the "libname" to access it:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname entp odbc noprompt="driver=ODBC Driver 11 for SQL Server; database=entp_rnt; server=dbque2122,2226; trusted_connection=yes" schema="dbo";&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now what? Additionally, I'm told not to "bring a whole table down" because the database is so big. How do I avoid doing that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have access to both SAS Enterprise Guide and SAS 9.4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Furthermore, do you have any recommendations for courses/books that are truly fundamental so I can develop some baseline knowledge of SAS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 16:29:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extreme-Newbie-Question-connecting-to-DB/m-p/609728#M17961</guid>
      <dc:creator>TimHenderson</dc:creator>
      <dc:date>2019-12-05T16:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Extreme Newbie Question: connecting to DB</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extreme-Newbie-Question-connecting-to-DB/m-p/609729#M17962</link>
      <description>&lt;P&gt;Did they provide any documentation on what tables (datasets) are in that database?&amp;nbsp; Did they provide any information on the columns (variables) in the tables (datasets)?&lt;/P&gt;
&lt;P&gt;What do you need to do with the data?&amp;nbsp; Is there a particular question you are trying to answer? Or statistic you are trying to generate?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To avoid pulling a whole table down make sure you are generating any summaries you need in the data base and only return the summary data instead of the detailed data.&amp;nbsp; One way is to use explicit passthru SQL code in PROC SQL.&amp;nbsp; WIth that you will need to write code that work in the remote database.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To avoid pulling too much data you need to plan ahead and know what type of results you expect your queries to generate.&amp;nbsp; Either by checking the documentation on how many distinct values a variable is allowed to take etc. Or counting before you try to pull the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example here is how you could find the MIN , MAX, number of non-missing values and number of distinct values for a variable X in a dataset Y using pass thru SQL.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
  connect using entp ;
  select * from connection to entp
( select min(X) as min_X
      , max(X) as max_X
      , count(X) as n_X
      , count(distinct X) as distinct_X
  from Y
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Dec 2019 16:39:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extreme-Newbie-Question-connecting-to-DB/m-p/609729#M17962</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-12-05T16:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extreme Newbie Question: connecting to DB</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extreme-Newbie-Question-connecting-to-DB/m-p/609731#M17963</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Try experimenting with creating some subsets from a few SASHELP datasets before you use ODBC against your big file. For example, this makes a subset of SASHELP.CLASS for the subset of rows where AGE GE 14:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;** option 1;
data work.teens_d;
  set sashelp.class;
  where age ge 14;
run;

proc print data=work.teens_d;
  title 'subset created with a dataset';
run;

** option 2;
proc sql;
  create table work.teens_s as
  select *
  from sashelp.class
  where age ge 14;
quit;

proc print data=work.teens_s;
  title 'subset created with a proc sql';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then eventually, you will do something like described here -- &lt;A href="http://support.sas.com/kb/41/888.html" target="_blank"&gt;http://support.sas.com/kb/41/888.html&lt;/A&gt; which are just variations on the above programs and utilize the LIBNAME engine to ODBC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Before you do this, I would recommend taking our free Programming 1 e-learning course: &lt;A href="https://support.sas.com/edu/schedules.html?ctry=us&amp;amp;crs=PROG1" target="_blank"&gt;https://support.sas.com/edu/schedules.html?ctry=us&amp;amp;crs=PROG1&lt;/A&gt; (click the start button under the e-learning section). You will need to log onto a SAS Profile before you complete the activation process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;adfasdf&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 16:47:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extreme-Newbie-Question-connecting-to-DB/m-p/609731#M17963</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-12-05T16:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extreme Newbie Question: connecting to DB</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extreme-Newbie-Question-connecting-to-DB/m-p/609735#M17964</link>
      <description>&lt;P&gt;Thank you. I was given a list of "extract columns" (113 in total) but I don't know if any other tables exist beyond a central one (if that makes sense).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to be able to do a variety of things with the data, but I can accomplish most of what I need to do by exporting a week's worth a data into Excel until I learn how to use SAS (the data has a column for date). That's roughly 50,000 entries, which while slow, should be able to be handled by Excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To begin, without doing anything else, are you suggesting I could enter the code below into the editor to produce a new summary table, where X is one of the extract columns? If I wanted to just pull one day's worth of data, but all the columns/info available for the day, what would you recommend?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, my apologies for my newness here.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 16:55:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extreme-Newbie-Question-connecting-to-DB/m-p/609735#M17964</guid>
      <dc:creator>TimHenderson</dc:creator>
      <dc:date>2019-12-05T16:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Extreme Newbie Question: connecting to DB</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Extreme-Newbie-Question-connecting-to-DB/m-p/609741#M17965</link>
      <description>Have you taken the free SAS e-course? I would take the first one and play around with the tasks (not coding). SAS has both a coding and GUI interface the the GUI is pretty straightforward to learn.</description>
      <pubDate>Thu, 05 Dec 2019 17:34:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Extreme-Newbie-Question-connecting-to-DB/m-p/609741#M17965</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-12-05T17:34:37Z</dc:date>
    </item>
  </channel>
</rss>

