<?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: Compare values from one table to another in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-from-one-table-to-another/m-p/737857#M230072</link>
    <description>&lt;P&gt;DATA server; INPUT mandant generation id; CARDS; 196 202103 1 196 202103 2 196 202104 1 196 202104 2 196 202104 3 ; RUN; DATA local; INPUT mandant generation id; CARDS; 196 202104 2 ; RUN;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Apr 2021 11:09:07 GMT</pubDate>
    <dc:creator>VCucu</dc:creator>
    <dc:date>2021-04-29T11:09:07Z</dc:date>
    <item>
      <title>Compare values from one table to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-from-one-table-to-another/m-p/737852#M230068</link>
      <description>&lt;P&gt;Today is: 29.04.2021&lt;/P&gt;
&lt;P&gt;I would like to write a code&lt;/P&gt;
&lt;P&gt;1) create a variable based on currentdate generation = 202104 (yyyymm - in our example)&lt;BR /&gt;2) search the value from 1 and compare the "server" table latest ID Load value (biggest) = 3 (in our example) with the "local" table latest ID Load value (biggest) =2 (in our example)&lt;BR /&gt;3) if a newer version (bigger) value on "server" then i will run a specific macro&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VCucu_0-1619693859221.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58849iFBF38996BDB4FD57/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VCucu_0-1619693859221.png" alt="VCucu_0-1619693859221.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;can somebody help me with this ?&lt;/P&gt;
&lt;P&gt;thank you very much,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 10:59:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-from-one-table-to-another/m-p/737852#M230068</guid>
      <dc:creator>VCucu</dc:creator>
      <dc:date>2021-04-29T10:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values from one table to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-from-one-table-to-another/m-p/737856#M230071</link>
      <description>&lt;P&gt;Please supply example data in usable form (data steps with datalines). We cannot run code against pictures.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 11:03:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-from-one-table-to-another/m-p/737856#M230071</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-29T11:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values from one table to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-from-one-table-to-another/m-p/737857#M230072</link>
      <description>&lt;P&gt;DATA server; INPUT mandant generation id; CARDS; 196 202103 1 196 202103 2 196 202104 1 196 202104 2 196 202104 3 ; RUN; DATA local; INPUT mandant generation id; CARDS; 196 202104 2 ; RUN;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 11:09:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-from-one-table-to-another/m-p/737857#M230072</guid>
      <dc:creator>VCucu</dc:creator>
      <dc:date>2021-04-29T11:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values from one table to another</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-from-one-table-to-another/m-p/737860#M230075</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro yourmac(mandant,generation,s_id,l_id);
%put &amp;amp;=mandant. &amp;amp;=generation. &amp;amp;=s_id. &amp;amp;=l_id.;
%mend;

%put DATA server;
INPUT mandant generation id;
CARDS;
196 202103 1
196 202103 2
196 202104 1
196 202104 2
196 202104 3
;

DATA local;
INPUT mandant generation id;
CARDS;
196 202104 2
;

data want;
merge
  server (in=s)
  local (
    in=l
    rename=(id=l_id)
  )
;
by mandant generation;
if l and last.generation
then if id &amp;gt; l_id
then call execute(cats('%nrstr(%yourmac(',mandant,",",generation,",",id,",",l_id,'))'));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Apr 2021 11:23:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-from-one-table-to-another/m-p/737860#M230075</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-29T11:23:47Z</dc:date>
    </item>
  </channel>
</rss>

