<?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: Question about Proc sql in merging two big dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Question-about-Proc-sql-in-merging-two-big-dataset/m-p/215708#M39795</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;Using an index in table &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;momstatefips1 is one of options to reduce the processing time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;An index can reduce the time required to locate a set of rows, especially for a large data file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create index x on work.momstatefips1(x);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table ds as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select a.*&lt;/P&gt;&lt;P&gt;&amp;nbsp; from a inner join b&lt;/P&gt;&lt;P&gt;&amp;nbsp; on a.momstatefips1 = b.momstatefips;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br, Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Jun 2015 10:54:59 GMT</pubDate>
    <dc:creator>AmitRathore</dc:creator>
    <dc:date>2015-06-29T10:54:59Z</dc:date>
    <item>
      <title>Question about Proc sql in merging two big dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-Proc-sql-in-merging-two-big-dataset/m-p/215705#M39792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a data a:&lt;/P&gt;&lt;P&gt;with a lot variables a b c d e...etc. for example, I want to combine with dataset b with variable named "X". but one row of b might have around 30,000 matched "X" in a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my SAS code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt; create table ds as &lt;/P&gt;&lt;P&gt; select a.*, b.momstatefips&lt;/P&gt;&lt;P&gt; from a left join b&lt;/P&gt;&lt;P&gt; on a.momstatefips1=b.momstatefips;&lt;/P&gt;&lt;P&gt; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this code right? It always takes a long time to run this code and give me the note that "out of resource". Does that make sense???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 01:45:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-Proc-sql-in-merging-two-big-dataset/m-p/215705#M39792</guid>
      <dc:creator>Seashore</dc:creator>
      <dc:date>2015-06-29T01:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: Question about Proc sql in merging two big dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-Proc-sql-in-merging-two-big-dataset/m-p/215706#M39793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are you actually trying to do?&amp;nbsp; Your current step is not adding any information since you are only selecting that variable that already matches the existing variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;If you are doing a 1 to Many merge then use data step with a merge statement instead.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Below is the data step equivalent of your left join, plus I added the variable FOUND to indicate if there was a match.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Note that it will only work if your data is sorted.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;data DS ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; merge MOMSTATEFIPS (in=in1 rename=(MOMSTATEFIPS1 =&amp;nbsp; MOMSTATEFIPS)) B (keep=MOMSTATEFIPS in=in2) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by MOMSTATEFIPS;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if in1 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FOUND= in2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 02:50:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-Proc-sql-in-merging-two-big-dataset/m-p/215706#M39793</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-06-29T02:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Question about Proc sql in merging two big dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-Proc-sql-in-merging-two-big-dataset/m-p/215707#M39794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe you are trying to subset dataset &lt;STRONG&gt;a&lt;/STRONG&gt; to extract the rows that are mentioned in dataset &lt;STRONG&gt;b&lt;/STRONG&gt;? If so, use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;create table ds as&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;select a.*&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;from a &lt;SPAN style="text-decoration: underline;"&gt;inner&lt;/SPAN&gt; join b&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;on a.momstatefips1 = b.momstatefips;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 03:17:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-Proc-sql-in-merging-two-big-dataset/m-p/215707#M39794</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-06-29T03:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Question about Proc sql in merging two big dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Question-about-Proc-sql-in-merging-two-big-dataset/m-p/215708#M39795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;Using an index in table &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;momstatefips1 is one of options to reduce the processing time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;An index can reduce the time required to locate a set of rows, especially for a large data file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create index x on work.momstatefips1(x);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table ds as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select a.*&lt;/P&gt;&lt;P&gt;&amp;nbsp; from a inner join b&lt;/P&gt;&lt;P&gt;&amp;nbsp; on a.momstatefips1 = b.momstatefips;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br, Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2015 10:54:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Question-about-Proc-sql-in-merging-two-big-dataset/m-p/215708#M39795</guid>
      <dc:creator>AmitRathore</dc:creator>
      <dc:date>2015-06-29T10:54:59Z</dc:date>
    </item>
  </channel>
</rss>

