<?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: Add underscore if variable has input or put function or best. format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490806#M128532</link>
    <description>&lt;P&gt;You mean this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
x='input(Oldvar,best.)';
want=tranwrd(x,',','_,');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 29 Aug 2018 12:13:37 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2018-08-29T12:13:37Z</dc:date>
    <item>
      <title>Add underscore if variable has input or put function or best. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490622#M128403</link>
      <description>&lt;P&gt;&amp;nbsp; Variable_name&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; input(Oldvar,best.)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put(Oldvar,best.)&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Variable_name_1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; input(Oldvar_,best.)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put(Oldvar_,best.)&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;How to add an underscore after oldvar so variable_1 becomes&amp;nbsp; input(Oldvar_,best.) put(Oldvar_,best.)&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 21:01:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490622#M128403</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2018-08-28T21:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Add underscore if variable has input or put function or best. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490626#M128407</link>
      <description>&lt;P&gt;Some context would help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you trying to create a new variable from something where you don't actually know the name of the variable? If so, how are you getting "oldvar" to begin with?&lt;/P&gt;
&lt;P&gt;What if there is already a variable "oldvar_" in the data set in use?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 21:07:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490626#M128407</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-28T21:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Add underscore if variable has input or put function or best. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490628#M128408</link>
      <description>&lt;P&gt;Yes creating a new variable,but this is how the variable is given by user ,but it has to be changed to an underscore as all other variables will be changes to an underscore as well.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 21:12:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490628#M128408</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2018-08-28T21:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Add underscore if variable has input or put function or best. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490631#M128410</link>
      <description>&lt;P&gt;Is it given by the user as a macro variable? How is it specified. We need a lot more details here. It could be as simple as macro variables with a period.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16600"&gt;@SASPhile&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes creating a new variable,but this is how the variable is given by user ,but it has to be changed to an underscore as all other variables will be changes to an underscore as well.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 21:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490631#M128410</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-28T21:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Add underscore if variable has input or put function or best. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490633#M128412</link>
      <description>&lt;P&gt;Not a macro variable. but in dataset&lt;/P&gt;&lt;P&gt;Out_Variable&amp;nbsp; In_variable&lt;/P&gt;&lt;P&gt;New_Var&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input(oldvar,best.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The input dataset has oldvar_ as variable name instead.so the new_var equals to input(oldvar_,best.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 21:29:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490633#M128412</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2018-08-28T21:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: Add underscore if variable has input or put function or best. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490639#M128416</link>
      <description>&lt;P&gt;More details. How do you know that oldvar will be converted?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 21:42:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490639#M128416</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-28T21:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Add underscore if variable has input or put function or best. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490662#M128430</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16600"&gt;@SASPhile&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes creating a new variable,but this is how the variable is given by user ,but it has to be changed to an underscore as all other variables will be changes to an underscore as well.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This doesn't quite make sense to me. If "all other variables will be changed(sic) to an underscore" then where does a user providing a name have any impact? It sounds like you are doing the same thing for all variables in the data set.&lt;/P&gt;
&lt;P&gt;And HOW does the user provide the information on the variable name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you are specifying a BEST format how can you be sure that the "user" never specifies a character variable that BEST will not work for? And it actually appears as if at least two variables are concerned: Variable_name AND Oldvar.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 22:42:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490662#M128430</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-28T22:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Add underscore if variable has input or put function or best. format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490806#M128532</link>
      <description>&lt;P&gt;You mean this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
x='input(Oldvar,best.)';
want=tranwrd(x,',','_,');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Aug 2018 12:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-underscore-if-variable-has-input-or-put-function-or-best/m-p/490806#M128532</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-08-29T12:13:37Z</dc:date>
    </item>
  </channel>
</rss>

