<?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: Conditionally create macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Conditionally-create-macro-variable/m-p/589028#M168405</link>
    <description>&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    if find("&amp;amp;etis_jobname",'PRT_TRA')&amp;gt;0 then call symputx('library','IFPRTEX');
    /* additional if statements here as needed */
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 16 Sep 2019 12:56:46 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-09-16T12:56:46Z</dc:date>
    <item>
      <title>Conditionally create macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditionally-create-macro-variable/m-p/589025#M168403</link>
      <description>&lt;P&gt;I want to create one macro variable called 'LIBRARY' which I want to use it to the next step to query the permanent table. Assume I've a Job Name as below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token macroname"&gt;%let&lt;/SPAN&gt; etls_jobName &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; IF_04_J_PRT_TRA_INSURANCE_RECORD_DELIVERY&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;or&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token macroname"&gt;%let&lt;/SPAN&gt; etls_jobName &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; IF_04_J_PRC_TRA_INSURANCE_RECORD_DELIVERY&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;or&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token macroname"&gt;%let&lt;/SPAN&gt; etls_jobName &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; IF_04_J_PRT_LOA_INSURANCE_RECORD_DELIVERY&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;or&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token macroname"&gt;%let&lt;/SPAN&gt; etls_jobName &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; IF_04_J_PRC_LOA_INSURANCE_RECORD_DELIVERY&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;And&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;If the Job Name contains PRT_TRA then I want the macro variable to resolve to IFPRTEXT&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;If the Job Name contains PRC_TRA then I want the macro variable to resolve to IFPRCEXT&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;If the Job Name contains PRT_LOA then I want the macro variable to resolve to IFPRTTRA&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;If the Job Name contains PRC_LOA then I want the macro variable to resolve to IFPRCTRA&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;I never created the macro variable with some conditions. Appericiate if someone of you shed some light on this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 12:53:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditionally-create-macro-variable/m-p/589025#M168403</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2019-09-16T12:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally create macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditionally-create-macro-variable/m-p/589028#M168405</link>
      <description>&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    if find("&amp;amp;etis_jobname",'PRT_TRA')&amp;gt;0 then call symputx('library','IFPRTEX');
    /* additional if statements here as needed */
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Sep 2019 12:56:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditionally-create-macro-variable/m-p/589028#M168405</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-16T12:56:46Z</dc:date>
    </item>
  </channel>
</rss>

