<?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: check if multiple appended column values match  values in another dataset in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/307069#M61076</link>
    <description>&lt;P&gt;IN addition to the RENAME statement the following is problematic. Not sure what you're expecting.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;data &amp;amp;indsn;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;set &amp;amp;key;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;amp;indsn;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;set &amp;amp;indsn;&lt;BR /&gt;merge_key= _n_;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;These are the same so overwrite each other.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So far I've pointed out two mistakes. Fix them and then see what errors still exist.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Oct 2016 09:12:37 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-10-25T09:12:37Z</dc:date>
    <item>
      <title>check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306288#M60989</link>
      <description>&lt;P&gt;below code checks if the values of exported_dsn and outdsn are not matching if they are not matching then print the non matching observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro grp_key(lib=,lib2=,varlist=,indsn=,exported_dsn=,outdsn=,result_dsn=);&lt;BR /&gt;%local&lt;BR /&gt;key&lt;BR /&gt;hash&lt;BR /&gt;;&lt;BR /&gt;proc sql noprint;&lt;BR /&gt; select distinct catx(".",libname,memname) into: key separated by " "&lt;BR /&gt; from dictionary.columns&lt;BR /&gt; where libname ="&amp;amp;lib" and findw("&amp;amp;varlist",strip(name), ' ','i')&amp;gt;0;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;%put &amp;amp;key;&lt;/P&gt;
&lt;P&gt;data &amp;amp;indsn;&lt;BR /&gt; set &amp;amp;key;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data &amp;amp;indsn;&lt;BR /&gt; set &amp;amp;indsn;&lt;BR /&gt; merge_key= _n_;&lt;BR /&gt;run;&lt;BR /&gt;proc sql noprint;&lt;BR /&gt; select distinct catx(".",libname,memname) into: hash separated by " "&lt;BR /&gt; from dictionary.columns&lt;BR /&gt; where libname ="&amp;amp;lib2" and findw("&amp;amp;varlist",strip(name),' ','i')&amp;gt;0;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;%put &amp;amp;hash;&lt;/P&gt;
&lt;P&gt;data &amp;amp;exported_dsn;&lt;BR /&gt; set &amp;amp;hash;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;%let newvarlist=;&lt;BR /&gt; %do i=1 %to %sysfunc(countw(&amp;amp;varlist));&lt;BR /&gt; rename %scan(&amp;amp;varlist,&amp;amp;i)=%scan(&amp;amp;varlist,&amp;amp;i).str;&lt;BR /&gt; %let newvarlist=&amp;amp;newvarlist%scan(&amp;amp;varlist,&amp;amp;i).str;&lt;BR /&gt;%end;&lt;/P&gt;
&lt;P&gt;data &amp;amp;exported_dsn;&lt;BR /&gt; set &amp;amp;exported_dsn;&lt;BR /&gt; merge_key=_n_;&lt;BR /&gt; rename &amp;amp;varlist =&amp;amp;newvarlist;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data both;&lt;BR /&gt;merge &amp;amp;indsn &amp;amp;exported_dsn;&lt;BR /&gt; by merge_key;&lt;BR /&gt;run;&lt;BR /&gt;PROC SORT DATA = both OUT = &amp;amp;outdsn NODUPKEY; BY &amp;amp;varlist &amp;amp;newvarlist; RUN;&lt;/P&gt;
&lt;P&gt;PROC FREQ DATA=&amp;amp;outdsn;&lt;BR /&gt; TABLES &amp;amp;varlist*&amp;amp;newvarlist / noprint nopercent out=&amp;amp;outdsnfreq;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc sort data = &amp;amp;outdsnfreq nodupkey;&lt;BR /&gt; by &amp;amp;varlist &amp;amp;newvarlist;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data &amp;amp;outdsnfreq;&lt;BR /&gt; set &amp;amp;outdsnfreq;&lt;BR /&gt; by &amp;amp;varlist &amp;amp;newvarlist;&lt;BR /&gt; if first.&amp;amp;varlist ne last.&amp;amp;varlist then do;&lt;BR /&gt;error = 1;&lt;BR /&gt;output;&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc print data = &amp;amp;outdsnfreq;&lt;BR /&gt; var &amp;amp;varlist &amp;amp;newvarlist;&lt;BR /&gt; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%mend grp_key;&lt;/P&gt;
&lt;P&gt;%grp_key(lib=GRP,lib2=GKEY, varlist= name height,indsn=team1,exported_dsn=teams2,outdsn=total1,result_dsn=Gkey);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;NOTE: Line generated by the macro variable "VARLIST".&lt;BR /&gt;1 name height&lt;BR /&gt; ------&lt;BR /&gt; 79&lt;BR /&gt;ERROR 79-322: Expecting a -.&lt;/P&gt;
&lt;P&gt;NOTE: Line generated by the macro variable "NEWVARLIST".&lt;BR /&gt;1 name.strheight.str&lt;BR /&gt; ------------------&lt;BR /&gt; 24&lt;BR /&gt;ERROR: Missing numeric suffix on a numbered variable list (name-height).&lt;BR /&gt;ERROR: Invalid variable specification, name.strheight.str.&lt;BR /&gt; Variable names of the form X.X must be either FIRST.X or LAST.X.&lt;BR /&gt;MPRINT(GRP_KEY): rename name height =name.strheight.str ;&lt;BR /&gt;ERROR: Old and new variable name specifications for RENAME must be of the same type. Statement is&lt;BR /&gt; ignored.&lt;BR /&gt;MPRINT(GRP_KEY): run;&lt;/P&gt;
&lt;P&gt;ERROR 24-322: Variable name is not valid&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;both libs hav 1 ds in them each with name height ID as columns in them,&amp;nbsp;above code is appending data of indsn &amp;amp; exported_dsn and its merged in both dataset. in the proc compare am checking if values of both dataset are equal. But code gives error for &amp;amp;varlist.str and it doesnot check the specific each value from exported_dsn is matching to &amp;amp;outdsn.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can i check if all exact specific values from exportdsn matc outdsn .....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 07:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306288#M60989</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2016-10-24T07:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306295#M60991</link>
      <description>&lt;P&gt;When you use a contruct like &amp;amp;varlist.str it places STR at the end of the value for varlist&lt;/P&gt;
&lt;P&gt;Run this code and see the result in the log:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0080" face="SAS Monospace" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; varlist = var1 var2 var3;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0080" face="SAS Monospace" size="2"&gt;&lt;FONT color="#ff0080" face="SAS Monospace" size="2"&gt;&lt;FONT color="#ff0080" face="SAS Monospace" size="2"&gt;%put&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;&lt;FONT face="SAS Monospace" size="2"&gt; Resolves to: &amp;amp;varlist.str;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;&lt;FONT face="SAS Monospace" size="2"&gt;I really can't tell what you may have intended but if the goal was to get a result like:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;&lt;FONT face="SAS Monospace" size="2"&gt;Var1str Var2str Var3str you have a bit of work involved.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;&lt;FONT face="SAS Monospace" size="2"&gt;If you run your macros with:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;&lt;FONT face="SAS Monospace" size="2"&gt;options mprint symbolgen;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;&lt;FONT face="SAS Monospace" size="2"&gt;%ey(lib=GP,lib2=GK, varlist= name height,indsn=t1,exported_dsn=t2,outdsn=tot1,result&lt;WBR /&gt;_dsn=Gy);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;&lt;FONT face="SAS Monospace" size="2"&gt;The error message should appear in a location that makes sense and will show what your macro variables look like at execution.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;&lt;FONT face="SAS Monospace" size="2"&gt;BTW is there any reason you don't do:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;&lt;FONT face="SAS Monospace" size="2"&gt;data &amp;amp;exported_dsn;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set &amp;amp;hash;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;&lt;FONT face="SAS Monospace" size="2"&gt;&amp;nbsp;&amp;nbsp; merge_key = _n_;&lt;BR /&gt;run;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;&lt;FONT face="SAS Monospace" size="2"&gt;Instead of going through the data twice?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;&lt;FONT face="SAS Monospace" size="2"&gt;Proc compare is sort of notorious for sensitivity to sort differences as well. I can't tell from your code if the sets you are comparing are actually sorted the same. If the sets are not the same size you'll have a number of mismatches. Also since your shown proc compare is outside of the macro there could be an issue about the value of the dataset names in the macro variables due to scope.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 14:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306295#M60991</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-21T14:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306303#M60993</link>
      <description>&lt;P&gt;Out of interest, are you intending to re-write the whole SAS package using your own macro code?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 14:37:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306303#M60993</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-21T14:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306305#M60994</link>
      <description>@RW9sorry can't understand wat u asking?</description>
      <pubDate>Fri, 21 Oct 2016 14:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306305#M60994</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2016-10-21T14:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306306#M60995</link>
      <description>@balladrw i have different data in both the datasets i first append data then i merge them, i want to check the data from exportdsn is matching the data in &amp;amp;outdsn &amp;amp; also see each unique value is matching another.</description>
      <pubDate>Fri, 21 Oct 2016 14:44:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306306#M60995</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2016-10-21T14:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306310#M60997</link>
      <description>&lt;P&gt;All of your posts are: I am writing macro code to do function xyz. &amp;nbsp;Base SAS is the programming language, it has all the data constructs, the functions, the processing, and can (and does, even in the case of macro code) do everything. &amp;nbsp;Hence why I am asking if it is some learning course or something where you have to re-write the whole Base SAS package, but using only macro language? &amp;nbsp;Otherwise almost all of you posts can be done far simpler in Base SAS, and half of the question become irrelevant.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 14:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306310#M60997</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-21T14:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306312#M60998</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9﻿&lt;/a&gt;&amp;nbsp;yes creating my own set of macros to perform certain specific function..So i do the base code then convert it into a generic macro, i.e to call the macro &amp;amp; perform its intended function instead of writing the code again &amp;amp; again.... in the above code am stuck at the point to check if specific unique values are matching particular values in both datasets...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 15:03:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306312#M60998</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2016-10-21T15:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306327#M61001</link>
      <description>&lt;P&gt;Please post the working SAS procedure code that wrote &lt;STRONG&gt;before&lt;/STRONG&gt; attempting to use macro code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you run the first two example lines I provided that will show the most likely reasong that &amp;amp;varlist.str is not working?&lt;/P&gt;
&lt;P&gt;What value do you expecte &amp;amp;varlist.str to produce?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 15:20:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306327#M61001</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-21T15:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306329#M61002</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw﻿&lt;/a&gt; varlist values can't be renamed is the error.. can i do the check of unique values of export DS are matching unique values of outdsn. in diff way? can u suggest thanks&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 15:29:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306329#M61002</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2016-10-21T15:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306335#M61004</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60507"&gt;@RTelang&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; varlist values can't be renamed is the error.. can i do the check of unique values of export DS are matching unique values of outdsn. in diff way? can u suggest thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I can tell that the value is an error. What I cannot tell is what was actually intended. You placed it in code so you should have some idea what the ACTUAL value it should be for the example provided.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you cannot tell us what the resolved value of the &amp;amp;varlist.str was supposed to look like then how can we help?&lt;/P&gt;
&lt;P&gt;You should be able to say I wanted:&lt;/P&gt;
&lt;P&gt;Namestr heightstr&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BUT your use is incorrect in any case:&lt;/P&gt;
&lt;P&gt;You have rename &amp;amp;varlist=&amp;amp;varlist.str&lt;/P&gt;
&lt;P&gt;The syntax for rename would be&lt;/P&gt;
&lt;P&gt;Rename Var1=NewVar1 Var2=NewVar2 Var3=NewVar3.&lt;/P&gt;
&lt;P&gt;So you would above have to pull varlist apart, counting the number of elements and write separate bits:&lt;/P&gt;
&lt;P&gt;The code for that would look something like:&lt;/P&gt;
&lt;P&gt;%let newvarlist=;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; %do i = 1 %to %sysfunc(countw(&amp;amp;varlist));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Rename&amp;nbsp; %scan(&amp;amp;varlist, &amp;amp;i) = %scan(&amp;amp;varlist,&amp;amp;i).str&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let newvarlist = &amp;amp;newvarlist %scan(&amp;amp;varlist,&amp;amp;i).str ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;
&lt;P&gt;That will write one RENAME statement for each variable in &amp;amp;varlist and then create a new variable with the values of the renamed&lt;/P&gt;
&lt;P&gt;variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Later you would refer to &amp;amp;newvarlist instead of &amp;amp;varlist.str&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;But&lt;/STRONG&gt; I am guessing because you have not shown what the value you actually expect &amp;amp;varlist.str to be.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 15:47:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306335#M61004</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-21T15:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306340#M61005</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60507"&gt;@RTelang&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;yes creating my own set of macros to perform certain specific function..&lt;U&gt;&lt;STRONG&gt;So i do the base code then convert it into a generic macro,&lt;/STRONG&gt;&lt;/U&gt; i.e to call the macro &amp;amp; perform its intended function instead of writing the code again &amp;amp; again.... in the above code am stuck at the point to check if specific unique values are matching particular values in both datasets...&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If this is the case post your base code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But again, you're doing thing inefficiently. At some point this will come back to bite you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look ok at the documentation for SAS 9.4 macros for examples on how to loop macro variables.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 15:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306340#M61005</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-21T15:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306702#M61044</link>
      <description>I have updated my code and the error can u help in correcting the error.....</description>
      <pubDate>Mon, 24 Oct 2016 06:50:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306702#M61044</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2016-10-24T06:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306703#M61045</link>
      <description>&lt;P&gt;When you run macro code and get errors make sure to run with debugging options on so you can see your code and include the relevant section of the log, not just the error. Otherwise it's difficult to see which line generates the error.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 06:53:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306703#M61045</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-24T06:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306716#M61049</link>
      <description>&lt;P&gt;This is a problem. It doesn't appear in a valid step as far as I can see.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%do i=1 %to %sysfunc(countw(&amp;amp;varlist));&lt;BR /&gt;rename %scan(&amp;amp;varlist,&amp;amp;i)=%scan(&amp;amp;varlist,&amp;amp;i).str;&lt;BR /&gt;%let newvarlist=&amp;amp;newvarlist%scan(&amp;amp;varlist,&amp;amp;i).str;&lt;BR /&gt;%end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When developing a macro you should be testing step by step rather than write a whole bunch of code and hoping it works. Go back to a step that works and move forward from there.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 07:33:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/306716#M61049</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-24T07:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/307065#M61075</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw﻿&lt;/a&gt;&amp;nbsp;I tried your code still error exists and it doesn't check if any mismatch in the values.. cn u tak a look i hav posted updated code...&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 08:48:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/307065#M61075</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2016-10-25T08:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: check if multiple appended column values match  values in another dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/307069#M61076</link>
      <description>&lt;P&gt;IN addition to the RENAME statement the following is problematic. Not sure what you're expecting.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;data &amp;amp;indsn;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;set &amp;amp;key;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;amp;indsn;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;set &amp;amp;indsn;&lt;BR /&gt;merge_key= _n_;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;These are the same so overwrite each other.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So far I've pointed out two mistakes. Fix them and then see what errors still exist.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 09:12:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/check-if-multiple-appended-column-values-match-values-in-another/m-p/307069#M61076</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-25T09:12:37Z</dc:date>
    </item>
  </channel>
</rss>

