<?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 varible name will be for oth and need to make it optional so that if there is variable present then in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/varible-name-will-be-for-oth-and-need-to-make-it-optional-so/m-p/415765#M102024</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to do the below code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%let oth=Other;

data test;
   if &amp;amp;oth ne "" then &amp;amp;oth;
run;&lt;/PRE&gt;&lt;P&gt;I am not sure what the varible name will be for oth and need to make it optional so that if there is variable present then use it else not use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Somehow this program logic doesnt work. Am i missing something. Please advice&lt;/P&gt;</description>
    <pubDate>Thu, 23 Nov 2017 08:16:46 GMT</pubDate>
    <dc:creator>mj5</dc:creator>
    <dc:date>2017-11-23T08:16:46Z</dc:date>
    <item>
      <title>varible name will be for oth and need to make it optional so that if there is variable present then</title>
      <link>https://communities.sas.com/t5/SAS-Programming/varible-name-will-be-for-oth-and-need-to-make-it-optional-so/m-p/415765#M102024</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to do the below code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%let oth=Other;

data test;
   if &amp;amp;oth ne "" then &amp;amp;oth;
run;&lt;/PRE&gt;&lt;P&gt;I am not sure what the varible name will be for oth and need to make it optional so that if there is variable present then use it else not use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Somehow this program logic doesnt work. Am i missing something. Please advice&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 08:16:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/varible-name-will-be-for-oth-and-need-to-make-it-optional-so/m-p/415765#M102024</guid>
      <dc:creator>mj5</dc:creator>
      <dc:date>2017-11-23T08:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: varible name will be for oth and need to make it optional so that if there is variable present t</title>
      <link>https://communities.sas.com/t5/SAS-Programming/varible-name-will-be-for-oth-and-need-to-make-it-optional-so/m-p/415771#M102028</link>
      <description>&lt;P&gt;Just resolve the macro variable yourself:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
   if Other ne "" then Other;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and you will see that the code is syntactically invalid and makes no sense at all.&lt;/P&gt;
&lt;P&gt;What are you trying to achieve?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 08:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/varible-name-will-be-for-oth-and-need-to-make-it-optional-so/m-p/415771#M102028</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-23T08:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: varible name will be for oth and need to make it optional so that if there is variable present t</title>
      <link>https://communities.sas.com/t5/SAS-Programming/varible-name-will-be-for-oth-and-need-to-make-it-optional-so/m-p/415772#M102029</link>
      <description>&lt;P&gt;I am trying to make a macro variable oth and not sure what the variable name will be for it. and then later in the datastep want to make sure if the variable exists and has no missing observation then assign the macro variable the variable name which will exist&lt;/P&gt;&lt;P&gt;%let oth=other; in case the variable name is other.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if other ne "" then &amp;amp;oth=other;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 08:35:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/varible-name-will-be-for-oth-and-need-to-make-it-optional-so/m-p/415772#M102029</guid>
      <dc:creator>mj5</dc:creator>
      <dc:date>2017-11-23T08:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: varible name will be for oth and need to make it optional so that if there is variable present t</title>
      <link>https://communities.sas.com/t5/SAS-Programming/varible-name-will-be-for-oth-and-need-to-make-it-optional-so/m-p/415775#M102030</link>
      <description>&lt;P&gt;Following your logic, you do exactly nothing, in a quite complicated way:&lt;/P&gt;
&lt;P&gt;You set macro variable oth to the value&lt;/P&gt;
&lt;PRE&gt;Other&lt;/PRE&gt;
&lt;P&gt;Then you check if data step variable "other" is not missing, in which case you again set the macro variable oth to&lt;/P&gt;
&lt;PRE&gt;Other&lt;/PRE&gt;
&lt;P&gt;and if not existing or missing, you do nothing, so &amp;amp;oth will keep its value, which is&lt;/P&gt;
&lt;PRE&gt;Other&lt;/PRE&gt;
&lt;P&gt;???&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 08:57:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/varible-name-will-be-for-oth-and-need-to-make-it-optional-so/m-p/415775#M102030</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-11-23T08:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: varible name will be for oth and need to make it optional so that if there is variable present t</title>
      <link>https://communities.sas.com/t5/SAS-Programming/varible-name-will-be-for-oth-and-need-to-make-it-optional-so/m-p/415788#M102036</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;and then later in the datastep want" - macro language is a separate component from datastep language.&amp;nbsp; Datastep language is the programming language of SAS, macro is an additional textual find and replace system which can help generate datastep code.&amp;nbsp; The to do not work together, but on after the other, so your statement above can never be done.&amp;nbsp; Describe your problem, start with some test data, and what you want out at the end.&amp;nbsp; There are many ways to find out if a variable is missing, however it isn't that often you would need to change your code physically based on this assumption.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 09:41:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/varible-name-will-be-for-oth-and-need-to-make-it-optional-so/m-p/415788#M102036</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-23T09:41:44Z</dc:date>
    </item>
  </channel>
</rss>

