<?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: DATA merge Help Please in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DATA-merge-Help-Please/m-p/82266#M288576</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;Thanks - got it working!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason I thought the "in" command with DATA MERGE was optional.&amp;nbsp; As well, thanks for the related PROC SQL code.&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Apr 2012 15:09:17 GMT</pubDate>
    <dc:creator>SASHelpPlease</dc:creator>
    <dc:date>2012-04-13T15:09:17Z</dc:date>
    <item>
      <title>DATA merge Help Please</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATA-merge-Help-Please/m-p/82264#M288574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I'm having trouble with merging two data sets - one is a large file, bcarrier_line, with over 22 million rows.&amp;nbsp; The other file is a DESY_SORT_KEY file with 344 rows (one column).&amp;nbsp; I wish to merge the two files by DESY_SORT_KEY, so bcarrier_line file only outputs rows with desired DESY_SORT_KEY values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've ran this code with no errors, but the log output shows no row number change upon the merge (i.e. the larger file doesn't decrease in row size).&amp;nbsp; From similar, but other, files I know the merge should significantly decrease the number of rows of the bcarrier_line data set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CODE:&lt;/P&gt;&lt;P&gt;libname aaa 'M:\';&lt;BR /&gt;%let bcarrier = bcarrier_line;&lt;/P&gt;&lt;P&gt;*Already a SAS dataset;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA desy;&lt;BR /&gt; INFILE 'M:\DESY_SORT_KEY.csv';&lt;BR /&gt; INPUT DESY_SORT_KEY;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SORT data = aaa.&amp;amp;bcarrier;&lt;BR /&gt; by DESY_SORT_KEY;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SORT data=desy;&lt;BR /&gt; by DESY_SORT_KEY;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA mergeaaa;&lt;BR /&gt; merge&amp;nbsp; aaa.&amp;amp;bcarrier&lt;BR /&gt;&amp;nbsp;&amp;nbsp; desy;&lt;BR /&gt; by DESY_SORT_KEY;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC EXPORT DATA = mergeaaa&lt;BR /&gt;&amp;nbsp;&amp;nbsp; OUTFILE='M:\bcarrier_line_aaa.csv';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any tips or advice is most appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 22:48:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATA-merge-Help-Please/m-p/82264#M288574</guid>
      <dc:creator>SASHelpPlease</dc:creator>
      <dc:date>2012-04-12T22:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: DATA merge Help Please</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATA-merge-Help-Please/m-p/82265#M288575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use SQL instead for a one step process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;Create table mergeaaa as&lt;/P&gt;&lt;P&gt;select * from aaa.bcarrier&lt;/P&gt;&lt;P&gt;where DESY_SORT_KEY in (select DESY_SORT_KEY from desy);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR try the in option in your merge:&lt;/P&gt;&lt;P&gt;DATA mergeaaa;&lt;BR /&gt; merge&amp;nbsp; aaa.&amp;amp;bcarrier (in=a)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; desy(in=b);&lt;BR /&gt; by DESY_SORT_KEY;&lt;/P&gt;&lt;P&gt;if b;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 23:31:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATA-merge-Help-Please/m-p/82265#M288575</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-04-12T23:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: DATA merge Help Please</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATA-merge-Help-Please/m-p/82266#M288576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;Thanks - got it working!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason I thought the "in" command with DATA MERGE was optional.&amp;nbsp; As well, thanks for the related PROC SQL code.&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2012 15:09:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATA-merge-Help-Please/m-p/82266#M288576</guid>
      <dc:creator>SASHelpPlease</dc:creator>
      <dc:date>2012-04-13T15:09:17Z</dc:date>
    </item>
  </channel>
</rss>

