<?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: Help with a Data Step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-a-Data-Step/m-p/157706#M30784</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depending on sort order of the two. It helps if both datasets are sorted in the same order. A lot.&lt;/P&gt;&lt;P&gt;You should define items. Is it records or variables, or both?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc Compare Base=OldData Compare=NewData listcompobs ;run;&lt;BR /&gt;will give a list of RECORD numbers in the NewData that don't exist in the Olddataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc Compare Base=OldData Compare=NewData listcompvar ;run;&lt;/P&gt;&lt;P&gt;List variables in the NewData not in OldData&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc Compare Base=OldData Compare=NewData listcomp ;run;&lt;/P&gt;&lt;P&gt;Does what appears in both.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Jun 2014 23:46:00 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2014-06-26T23:46:00Z</dc:date>
    <item>
      <title>Help with a Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-a-Data-Step/m-p/157704#M30782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm a relatively new SAS user.&amp;nbsp; I'm trying to write a data step for the following condition:&lt;/P&gt;&lt;P&gt;I have 2 data sets.&amp;nbsp; One contains old items.&amp;nbsp; The other new items.&amp;nbsp; I need to create a file that show the items on the new file that are not on the old file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the best way to go about this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 21:25:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-a-Data-Step/m-p/157704#M30782</guid>
      <dc:creator>adamsfam1</dc:creator>
      <dc:date>2014-06-26T21:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-a-Data-Step/m-p/157705#M30783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Usually SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But a data step merge works as well, assuming you have some matching_key that is the product identifier then something like the following will work.&lt;/P&gt;&lt;P&gt;The key is the IN Data Set Option.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000131134.htm" title="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000131134.htm"&gt;SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data new_not_in_old;&lt;/P&gt;&lt;P&gt;merge new (in=newFile) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; old (in=oldFile);&lt;/P&gt;&lt;P&gt;by matching_key;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if newFile and not oldFile;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 21:34:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-a-Data-Step/m-p/157705#M30783</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-06-26T21:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-a-Data-Step/m-p/157706#M30784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depending on sort order of the two. It helps if both datasets are sorted in the same order. A lot.&lt;/P&gt;&lt;P&gt;You should define items. Is it records or variables, or both?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc Compare Base=OldData Compare=NewData listcompobs ;run;&lt;BR /&gt;will give a list of RECORD numbers in the NewData that don't exist in the Olddataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc Compare Base=OldData Compare=NewData listcompvar ;run;&lt;/P&gt;&lt;P&gt;List variables in the NewData not in OldData&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc Compare Base=OldData Compare=NewData listcomp ;run;&lt;/P&gt;&lt;P&gt;Does what appears in both.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 23:46:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-a-Data-Step/m-p/157706#M30784</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-06-26T23:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-a-Data-Step/m-p/157707#M30785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select item from new&lt;/P&gt;&lt;P&gt; except&lt;/P&gt;&lt;P&gt;select item from old ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 12:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-a-Data-Step/m-p/157707#M30785</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-06-27T12:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-a-Data-Step/m-p/157708#M30786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much!&amp;nbsp; This answer really helped me!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2014 14:07:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-a-Data-Step/m-p/157708#M30786</guid>
      <dc:creator>adamsfam1</dc:creator>
      <dc:date>2014-06-30T14:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-a-Data-Step/m-p/157709#M30787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much!&amp;nbsp; This answser really helped me!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2014 14:07:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-a-Data-Step/m-p/157709#M30787</guid>
      <dc:creator>adamsfam1</dc:creator>
      <dc:date>2014-06-30T14:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-a-Data-Step/m-p/157710#M30788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much!&amp;nbsp; This answer really helped me!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2014 14:08:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-a-Data-Step/m-p/157710#M30788</guid>
      <dc:creator>adamsfam1</dc:creator>
      <dc:date>2014-06-30T14:08:50Z</dc:date>
    </item>
  </channel>
</rss>

