<?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 Check variable in two datasets are same variable type in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Check-variable-in-two-datasets-are-same-variable-type/m-p/916373#M360950</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have got two datasets and want to check that where a variable appears in both (can ignore if a variable just appears in one dataset), the variable type is the same in both to create something like the screenshot below. From there, there could be a created 'Match' variable to let me know if a variable has the same variable type ('Match') or if they are different ('No Match'). Can someone tell me the code that would be able to do this please (as there are likely to be over 500 variables to check)?&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="Justin9_0-1708033157458.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93808iF0B467633369134F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Justin9_0-1708033157458.png" alt="Justin9_0-1708033157458.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Feb 2024 21:39:25 GMT</pubDate>
    <dc:creator>Justin9</dc:creator>
    <dc:date>2024-02-15T21:39:25Z</dc:date>
    <item>
      <title>Check variable in two datasets are same variable type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-variable-in-two-datasets-are-same-variable-type/m-p/916373#M360950</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have got two datasets and want to check that where a variable appears in both (can ignore if a variable just appears in one dataset), the variable type is the same in both to create something like the screenshot below. From there, there could be a created 'Match' variable to let me know if a variable has the same variable type ('Match') or if they are different ('No Match'). Can someone tell me the code that would be able to do this please (as there are likely to be over 500 variables to check)?&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="Justin9_0-1708033157458.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93808iF0B467633369134F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Justin9_0-1708033157458.png" alt="Justin9_0-1708033157458.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 21:39:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-variable-in-two-datasets-are-same-variable-type/m-p/916373#M360950</guid>
      <dc:creator>Justin9</dc:creator>
      <dc:date>2024-02-15T21:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Check variable in two datasets are same variable type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-variable-in-two-datasets-are-same-variable-type/m-p/916380#M360951</link>
      <description>&lt;P&gt;So, assuming the variable names are the same in both data sets&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=dataset1 noprint out=_contents1_;
run;
proc contents data=dataset2 noprint out=_contents2_;
run;
proc format;
    value typef 1='Numeric' 2='Char';
run;
data compare;
    length match $ 8;
    merge _contents1_(rename=(type=type1)) _contents2_(rename=(type=type2));
    by name;
    if type1=type2 then match='Match';
    else match='No Match';
    format type1 type2 typef.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Feb 2024 22:30:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-variable-in-two-datasets-are-same-variable-type/m-p/916380#M360951</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-02-15T22:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Check variable in two datasets are same variable type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-variable-in-two-datasets-are-same-variable-type/m-p/916381#M360952</link>
      <description>Thanks for your help!</description>
      <pubDate>Thu, 15 Feb 2024 22:51:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-variable-in-two-datasets-are-same-variable-type/m-p/916381#M360952</guid>
      <dc:creator>Justin9</dc:creator>
      <dc:date>2024-02-15T22:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Check variable in two datasets are same variable type</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-variable-in-two-datasets-are-same-variable-type/m-p/916383#M360953</link>
      <description>&lt;P&gt;Proc compare has some nice reports related to the variables in the data being compared.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
   set sashelp.class;
   length _age $8;
   _age=left(vvalue(age));
   drop age;
   rename _age=Age;
   run;
proc compare note 
      data=sashelp.classfit(obs=0) 
      compare=class(obs=0) 
      listvars novalues brief;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 411px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93811i0A0C2A8351D034D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 23:04:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-variable-in-two-datasets-are-same-variable-type/m-p/916383#M360953</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2024-02-15T23:04:33Z</dc:date>
    </item>
  </channel>
</rss>

