<?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 Help on how to match in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-on-how-to-match/m-p/66544#M14446</link>
    <description>Hi all! New guy trying to code in SAS here. I have this task combining 2 dataset. Shown below are the valid scenarios and invalid. All help is acceptable! Thanks!&lt;BR /&gt;
&lt;BR /&gt;
Scenario 1 - Valid&lt;BR /&gt;
File1&lt;BR /&gt;
VarA    VarB.   VarC&lt;BR /&gt;
A1.       R1.       C1.     - write output file&lt;BR /&gt;
A2.       R1.       C2.     - write output file&lt;BR /&gt;
&lt;BR /&gt;
File2&lt;BR /&gt;
A1.       R1.       C1&lt;BR /&gt;
A2.       R1.       C2&lt;BR /&gt;
&lt;BR /&gt;
Scenario 2 - Invalid&lt;BR /&gt;
File1&lt;BR /&gt;
A1.       R1.       C1.     - no action taken&lt;BR /&gt;
A2.       R1.       C2.     - no action taken&lt;BR /&gt;
&lt;BR /&gt;
File2&lt;BR /&gt;
A1.       R1.       C1&lt;BR /&gt;
A2.       R1.       C2&lt;BR /&gt;
A3.       R1.       C3&lt;BR /&gt;
&lt;BR /&gt;
Scenario 3 - Invalid&lt;BR /&gt;
File1&lt;BR /&gt;
A1.       R1.       C1 - no action taken&lt;BR /&gt;
A2.       R1.       C2 - no action taken&lt;BR /&gt;
&lt;BR /&gt;
File2&lt;BR /&gt;
A1.       R1.       C1&lt;BR /&gt;
A2.       R1.       C3&lt;BR /&gt;
&lt;BR /&gt;
Thanks all!</description>
    <pubDate>Fri, 28 Jan 2011 04:50:45 GMT</pubDate>
    <dc:creator>Jhunait</dc:creator>
    <dc:date>2011-01-28T04:50:45Z</dc:date>
    <item>
      <title>Help on how to match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-on-how-to-match/m-p/66544#M14446</link>
      <description>Hi all! New guy trying to code in SAS here. I have this task combining 2 dataset. Shown below are the valid scenarios and invalid. All help is acceptable! Thanks!&lt;BR /&gt;
&lt;BR /&gt;
Scenario 1 - Valid&lt;BR /&gt;
File1&lt;BR /&gt;
VarA    VarB.   VarC&lt;BR /&gt;
A1.       R1.       C1.     - write output file&lt;BR /&gt;
A2.       R1.       C2.     - write output file&lt;BR /&gt;
&lt;BR /&gt;
File2&lt;BR /&gt;
A1.       R1.       C1&lt;BR /&gt;
A2.       R1.       C2&lt;BR /&gt;
&lt;BR /&gt;
Scenario 2 - Invalid&lt;BR /&gt;
File1&lt;BR /&gt;
A1.       R1.       C1.     - no action taken&lt;BR /&gt;
A2.       R1.       C2.     - no action taken&lt;BR /&gt;
&lt;BR /&gt;
File2&lt;BR /&gt;
A1.       R1.       C1&lt;BR /&gt;
A2.       R1.       C2&lt;BR /&gt;
A3.       R1.       C3&lt;BR /&gt;
&lt;BR /&gt;
Scenario 3 - Invalid&lt;BR /&gt;
File1&lt;BR /&gt;
A1.       R1.       C1 - no action taken&lt;BR /&gt;
A2.       R1.       C2 - no action taken&lt;BR /&gt;
&lt;BR /&gt;
File2&lt;BR /&gt;
A1.       R1.       C1&lt;BR /&gt;
A2.       R1.       C3&lt;BR /&gt;
&lt;BR /&gt;
Thanks all!</description>
      <pubDate>Fri, 28 Jan 2011 04:50:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-on-how-to-match/m-p/66544#M14446</guid>
      <dc:creator>Jhunait</dc:creator>
      <dc:date>2011-01-28T04:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help on how to match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-on-how-to-match/m-p/66545#M14447</link>
      <description>Hi.&lt;BR /&gt;
I recommend you to use proc compare based on your exact match.&lt;BR /&gt;
If you want data step ,there is another alternative.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data temp1;&lt;BR /&gt;
 input (a b c) ($);&lt;BR /&gt;
 id+1;&lt;BR /&gt;
cards;&lt;BR /&gt;
A1. R1. C1&lt;BR /&gt;
A2. R1. C2&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
data temp2;&lt;BR /&gt;
 input (_a _b _c) ($);&lt;BR /&gt;
 id+1;&lt;BR /&gt;
cards;&lt;BR /&gt;
A1. R1. C1&lt;BR /&gt;
A2. R1. C2&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=temp1;&lt;BR /&gt;
 by id;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=temp2;&lt;BR /&gt;
 by id;&lt;BR /&gt;
run;&lt;BR /&gt;
data x;&lt;BR /&gt;
 merge temp1 temp2;&lt;BR /&gt;
 by id;&lt;BR /&gt;
run;&lt;BR /&gt;
data result;&lt;BR /&gt;
 set x end=last nobs=_nobs;&lt;BR /&gt;
 retain error 0;&lt;BR /&gt;
 array left{*} $ a b c;&lt;BR /&gt;
 array right{*} $ _a _b _c;&lt;BR /&gt;
 do i=1 to dim(left);&lt;BR /&gt;
  if left{i} ne right{i} then do;&lt;BR /&gt;
                              error=1;&lt;BR /&gt;
                              leave;&lt;BR /&gt;
                              end;&lt;BR /&gt;
 end;&lt;BR /&gt;
 if last and not error then do ;&lt;BR /&gt;
                              do j=1 to _nobs;&lt;BR /&gt;
                              set x point=j;&lt;BR /&gt;
                              output;&lt;BR /&gt;
                              end;&lt;BR /&gt;
                              keep a b c;&lt;BR /&gt;
                             end;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Fri, 28 Jan 2011 07:02:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-on-how-to-match/m-p/66545#M14447</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-01-28T07:02:44Z</dc:date>
    </item>
  </channel>
</rss>

