<?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 is this dosubl correct? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/is-this-dosubl-correct/m-p/748177#M234945</link>
    <description>&lt;P&gt;Hi I am passing 3 parameters from a table in the data step and passing them to a macro.&amp;nbsp; The parameter 'newtblname1' is working fine it gets the first observation then the 2nd. However the 'var1' and 'var2' it only gets the first observation and does not change on the second.&amp;nbsp; I think the statement is wrong.&amp;nbsp; I know i probably don't need the &amp;amp; signs because they are attributes of the dbtblnames_complete table , but i get an error when I don't have the &amp;amp;.&amp;nbsp; What I am doing incorrectly?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;391 data final_validation;
392     set dbtblnames_complete;
393     /*tablename=newtblname1;*/
394     /*******************/
395     /* check 1 :determine if certain columns exist in the table and populate a table value indicating whether they are or not*/
396    &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt; colexist = dosubl('%deterifcolsexist(&amp;amp;var1,&amp;amp;var2,' || strip(newtblname1) || ')');&lt;/FONT&gt;&lt;/STRONG&gt;
397     contactdtpresent = symget('contactdt');
398     externidpresent = symget('extrnlid');
399     /*********************/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 15 Jun 2021 17:08:10 GMT</pubDate>
    <dc:creator>Gayle</dc:creator>
    <dc:date>2021-06-15T17:08:10Z</dc:date>
    <item>
      <title>is this dosubl correct?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-this-dosubl-correct/m-p/748177#M234945</link>
      <description>&lt;P&gt;Hi I am passing 3 parameters from a table in the data step and passing them to a macro.&amp;nbsp; The parameter 'newtblname1' is working fine it gets the first observation then the 2nd. However the 'var1' and 'var2' it only gets the first observation and does not change on the second.&amp;nbsp; I think the statement is wrong.&amp;nbsp; I know i probably don't need the &amp;amp; signs because they are attributes of the dbtblnames_complete table , but i get an error when I don't have the &amp;amp;.&amp;nbsp; What I am doing incorrectly?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;391 data final_validation;
392     set dbtblnames_complete;
393     /*tablename=newtblname1;*/
394     /*******************/
395     /* check 1 :determine if certain columns exist in the table and populate a table value indicating whether they are or not*/
396    &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt; colexist = dosubl('%deterifcolsexist(&amp;amp;var1,&amp;amp;var2,' || strip(newtblname1) || ')');&lt;/FONT&gt;&lt;/STRONG&gt;
397     contactdtpresent = symget('contactdt');
398     externidpresent = symget('extrnlid');
399     /*********************/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Jun 2021 17:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-this-dosubl-correct/m-p/748177#M234945</guid>
      <dc:creator>Gayle</dc:creator>
      <dc:date>2021-06-15T17:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: is this dosubl correct?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-this-dosubl-correct/m-p/748183#M234950</link>
      <description>&lt;P&gt;Where are the values for the first two arguments for the macro&amp;nbsp;%deterifcolsexist() supposed to come from?&lt;/P&gt;
&lt;P&gt;Right now you tell it to use the values of macro variables named VAR1 and VAR2 that I do not see you defining anywhere.&lt;/P&gt;
&lt;P&gt;The only way the values of those macro variables could possibly change is if the macro itself changed them.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want the values to come from observations in the input dataset&amp;nbsp;dbtblnames_complete then you need to reference those variables in your code.&amp;nbsp; Just like you are referencing the variable NEWTBLNAME1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if VAR1 and VAR2 are variables in&amp;nbsp;dbtblnames_complete then your code might look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;colexist = dosubl(cats('%deterifcolsexist(',var1,',',var2,',',newtblname1,')'));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now if &amp;amp;VAR1 and &amp;amp;VAR2 contain the NAMES of variables in the dataset then the code should look like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;colexist = dosubl(cats('%deterifcolsexist(',&amp;amp;var1,',',&amp;amp;var2,',',newtblname1,')'));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also are the values of the macro variables&amp;nbsp;contactdt and&amp;nbsp;extrnlid being changed by that macro call? Seems strange for a macro with that name.&amp;nbsp; If not why did you include those lines in your example code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 17:25:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-this-dosubl-correct/m-p/748183#M234950</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-06-15T17:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: is this dosubl correct?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-this-dosubl-correct/m-p/748225#M234982</link>
      <description>Hi thanks, no I am not changing  contactdt and extrnlid are not being changed I guess i should not have included those lines.</description>
      <pubDate>Tue, 15 Jun 2021 20:49:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-this-dosubl-correct/m-p/748225#M234982</guid>
      <dc:creator>Gayle</dc:creator>
      <dc:date>2021-06-15T20:49:12Z</dc:date>
    </item>
  </channel>
</rss>

