<?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 How to check in new variable is added in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-in-new-variable-is-added/m-p/23301#M3848</link>
    <description>how to check if a new variable(s) is added to the dataset and check the values of existing variables with previous month dataset.&lt;BR /&gt;
for instance:&lt;BR /&gt;
there is a dataset zip with the following variables:&lt;BR /&gt;
zip    RDT5    RDT17    RDT23    RDT51&lt;BR /&gt;
&lt;BR /&gt;
next month RDT75 is added.How to check if new variable is added. and check the values of  RDT5    RDT17    RDT23    RDT51 are the same as previous month.&lt;BR /&gt;
&lt;BR /&gt;
I'm limiting the number of variables only to 5.but in actuality there are 50 variables.&lt;BR /&gt;
also RDT  doesnt contain continous suffix.</description>
    <pubDate>Mon, 07 Mar 2011 17:40:43 GMT</pubDate>
    <dc:creator>SASPhile</dc:creator>
    <dc:date>2011-03-07T17:40:43Z</dc:date>
    <item>
      <title>How to check in new variable is added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-in-new-variable-is-added/m-p/23301#M3848</link>
      <description>how to check if a new variable(s) is added to the dataset and check the values of existing variables with previous month dataset.&lt;BR /&gt;
for instance:&lt;BR /&gt;
there is a dataset zip with the following variables:&lt;BR /&gt;
zip    RDT5    RDT17    RDT23    RDT51&lt;BR /&gt;
&lt;BR /&gt;
next month RDT75 is added.How to check if new variable is added. and check the values of  RDT5    RDT17    RDT23    RDT51 are the same as previous month.&lt;BR /&gt;
&lt;BR /&gt;
I'm limiting the number of variables only to 5.but in actuality there are 50 variables.&lt;BR /&gt;
also RDT  doesnt contain continous suffix.</description>
      <pubDate>Mon, 07 Mar 2011 17:40:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-in-new-variable-is-added/m-p/23301#M3848</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2011-03-07T17:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to check in new variable is added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-in-new-variable-is-added/m-p/23302#M3849</link>
      <description>proc compare will compare structure as well as data</description>
      <pubDate>Mon, 07 Mar 2011 19:34:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-in-new-variable-is-added/m-p/23302#M3849</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-03-07T19:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to check in new variable is added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-check-in-new-variable-is-added/m-p/23303#M3850</link>
      <description>Hello SASPhile,&lt;BR /&gt;
This code checks if a new variable has been added to dataset WORK.I compared to WORK.R:&lt;BR /&gt;
[pre] &lt;BR /&gt;
proc SQL;&lt;BR /&gt;
  select name into :l0 separated by ' '&lt;BR /&gt;
  from sashelp.vcolumn where LIBNAME="WORK" and memname="I"&lt;BR /&gt;
;quit;&lt;BR /&gt;
proc SQL;&lt;BR /&gt;
  select name into :l1 separated by ' '&lt;BR /&gt;
  from sashelp.vcolumn where LIBNAME="WORK" and memname="R"&lt;BR /&gt;
;quit;&lt;BR /&gt;
options nosymbolgen;&lt;BR /&gt;
%put l0=&amp;amp;l0;&lt;BR /&gt;
%put l1=&amp;amp;l1;&lt;BR /&gt;
%let d=%EVAL(%LENGTH(&amp;amp;l1)-%LENGTH(&amp;amp;l0));&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
To check if old variable values have been changed it is good to use suggested proc COMPARE with base=Old dataset Compare=New dataset subsetted to contain old variables only.&lt;BR /&gt;
HTH, SPR</description>
      <pubDate>Mon, 07 Mar 2011 21:03:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-check-in-new-variable-is-added/m-p/23303#M3850</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2011-03-07T21:03:12Z</dc:date>
    </item>
  </channel>
</rss>

