<?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 Wild card operation to include all variables that include TOXGR in PROC SQL Step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Wild-card-operation-to-include-all-variables-that-include-TOXGR/m-p/925136#M364104</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm developing a macro and converting a data step to a proc sql step. so going from this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data ae00 (keep=usubjid &amp;amp;pop.  country countryc aedecod aegdecod astdy trtp AESHOSP TRTEMFL AESOC TOXG:);
	set adam.adae;
    where &amp;amp;popflg. and country in (&amp;amp;formatted_country_list.) and &amp;amp;inds_whr.;
run;&lt;/PRE&gt;
&lt;P&gt;to this&lt;/P&gt;
&lt;PRE&gt;proc sql;
    create table ae00 as
    select usubjid, &amp;amp;pop., country, countryc, aedecod, aegdecod, astdy, trtp, AESHOSP, TRTEMFL, AESOC, TOXG:
    from adam.adae
    where &amp;amp;popflg. 
        and country in (&amp;amp;formatted_country_list.) 
        and &amp;amp;inds_whr.;
quit;
&lt;/PRE&gt;
&lt;P&gt;The only issue I'm having is the TOXGR: from the original data step. Is there a wildcard operation that would do this or do I just have to explicitly state each TOXGR variable?. Sometimes the TOXGR variables may change over different study datasets which is the rationale for doing this. I know for fuzzy matching variable values you could use SPEDIS, SOUNDEX, COMPLEV functions. &lt;SPAN&gt;However, I'm wondering if there's also a function that can be applied to finding similarities in variable names, similar to these methods,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 21 Apr 2024 13:05:22 GMT</pubDate>
    <dc:creator>smackerz1988</dc:creator>
    <dc:date>2024-04-21T13:05:22Z</dc:date>
    <item>
      <title>Wild card operation to include all variables that include TOXGR in PROC SQL Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wild-card-operation-to-include-all-variables-that-include-TOXGR/m-p/925136#M364104</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm developing a macro and converting a data step to a proc sql step. so going from this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data ae00 (keep=usubjid &amp;amp;pop.  country countryc aedecod aegdecod astdy trtp AESHOSP TRTEMFL AESOC TOXG:);
	set adam.adae;
    where &amp;amp;popflg. and country in (&amp;amp;formatted_country_list.) and &amp;amp;inds_whr.;
run;&lt;/PRE&gt;
&lt;P&gt;to this&lt;/P&gt;
&lt;PRE&gt;proc sql;
    create table ae00 as
    select usubjid, &amp;amp;pop., country, countryc, aedecod, aegdecod, astdy, trtp, AESHOSP, TRTEMFL, AESOC, TOXG:
    from adam.adae
    where &amp;amp;popflg. 
        and country in (&amp;amp;formatted_country_list.) 
        and &amp;amp;inds_whr.;
quit;
&lt;/PRE&gt;
&lt;P&gt;The only issue I'm having is the TOXGR: from the original data step. Is there a wildcard operation that would do this or do I just have to explicitly state each TOXGR variable?. Sometimes the TOXGR variables may change over different study datasets which is the rationale for doing this. I know for fuzzy matching variable values you could use SPEDIS, SOUNDEX, COMPLEV functions. &lt;SPAN&gt;However, I'm wondering if there's also a function that can be applied to finding similarities in variable names, similar to these methods,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2024 13:05:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wild-card-operation-to-include-all-variables-that-include-TOXGR/m-p/925136#M364104</guid>
      <dc:creator>smackerz1988</dc:creator>
      <dc:date>2024-04-21T13:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Wild card operation to include all variables that include TOXGR in PROC SQL Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wild-card-operation-to-include-all-variables-that-include-TOXGR/m-p/925139#M364105</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/430963"&gt;@smackerz1988&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To keep the code simple, you can use the same KEEP= dataset option in the PROC SQL step that you used in the DATA step and then &lt;FONT face="courier new,courier"&gt;select * from&lt;/FONT&gt; ...:&lt;/P&gt;
&lt;PRE&gt;proc sql;
create table ae00 (keep=usubjid ... TOXG:) as
select *
from adam.adae
...&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively (and possibly more efficient), create the variable list from DICTIONARY.COLUMNS:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select name into :toxgvars separated by ' '
from dictionary.columns
where libname='ADAM' &amp;amp; memname='ADAE' &amp;amp; upcase(name) eqt 'TOXG';
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then replace &lt;FONT face="courier new,courier"&gt;TOXG:&lt;/FONT&gt; with &lt;FONT face="courier new,courier"&gt;&amp;amp;toxgvars&lt;/FONT&gt; in your PROC SQL code.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2024 13:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wild-card-operation-to-include-all-variables-that-include-TOXGR/m-p/925139#M364105</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-04-21T13:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Wild card operation to include all variables that include TOXGR in PROC SQL Step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Wild-card-operation-to-include-all-variables-that-include-TOXGR/m-p/925140#M364106</link>
      <description>&lt;P&gt;Yeah using dicitonary.columns and eqt makes the most sense to me!. Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2024 13:28:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Wild-card-operation-to-include-all-variables-that-include-TOXGR/m-p/925140#M364106</guid>
      <dc:creator>smackerz1988</dc:creator>
      <dc:date>2024-04-21T13:28:49Z</dc:date>
    </item>
  </channel>
</rss>

