<?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: function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/function/m-p/457940#M116175</link>
    <description>&lt;P&gt;I'm going to guess that this might be what you are looking for:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if scan(var, -1, '-') in ('m', 'M') then var = 'Total_M';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if scan(var, -1, '-') in ('f', 'F') then var = 'Total_F';&lt;/P&gt;</description>
    <pubDate>Thu, 26 Apr 2018 20:08:10 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-04-26T20:08:10Z</dc:date>
    <item>
      <title>function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function/m-p/457930#M116171</link>
      <description>&lt;P&gt;What kind of function can search certain character to assign a new observation name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example for observation:&amp;nbsp; iFF-F&amp;nbsp; Edd-M&amp;nbsp; Ehh-f&amp;nbsp; igg-m&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to assign&amp;nbsp; Total_F to the character that&amp;nbsp;have F/f and Total_M to the character that have M/m.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I changed all character to upcase and try to use Translate but not work.&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;Thx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 19:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function/m-p/457930#M116171</guid>
      <dc:creator>elsalam</dc:creator>
      <dc:date>2018-04-26T19:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function/m-p/457937#M116174</link>
      <description>&lt;P&gt;Hi, your question is incredibly unclear. Please start off by explaining, in detail, what you have, then what you want and anything you've tried so far. If you cannot share your real data, please mock some up to replicate your issue that accurately reflects your data.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 19:59:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function/m-p/457937#M116174</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-26T19:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function/m-p/457940#M116175</link>
      <description>&lt;P&gt;I'm going to guess that this might be what you are looking for:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if scan(var, -1, '-') in ('m', 'M') then var = 'Total_M';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if scan(var, -1, '-') in ('f', 'F') then var = 'Total_F';&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 20:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function/m-p/457940#M116175</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-26T20:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function/m-p/457950#M116180</link>
      <description>&lt;P&gt;Since your "examples" do not include the strings 'F/f' or 'M/m' the description is likely incomplete.&lt;/P&gt;
&lt;P&gt;Also "assign a new observation name." is not clear as in SAS observations to not have names. A SAS observation is all of the data on a row as one way of thinking.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you mean if the letter F or the letter f occurs in the value of variable then reset the entire value of that variable&amp;nbsp;to "Total_F" there are some other details needed.&lt;/P&gt;
&lt;P&gt;One is what is the length of the variable. The examples you show are all exactly 4 characters. If the length of the variable is 4 then "Total_F" would not fit because that has 7 characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TRANSLATE likely would not work as it replaces single characters with single characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or show more explicitly the result of this operation.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 20:34:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function/m-p/457950#M116180</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-26T20:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function/m-p/457980#M116191</link>
      <description>&lt;P&gt;thank you,&amp;nbsp; You are so knowledge on SAS.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 22:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function/m-p/457980#M116191</guid>
      <dc:creator>elsalam</dc:creator>
      <dc:date>2018-04-26T22:09:51Z</dc:date>
    </item>
  </channel>
</rss>

