<?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: Adding a period for middle initials in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-period-for-middle-initials/m-p/699141#M213862</link>
    <description>&lt;P&gt;Thank you so much! That worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;</description>
    <pubDate>Mon, 16 Nov 2020 13:57:16 GMT</pubDate>
    <dc:creator>sasperson1</dc:creator>
    <dc:date>2020-11-16T13:57:16Z</dc:date>
    <item>
      <title>Adding a period for middle initials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-period-for-middle-initials/m-p/698728#M213715</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to add a period for a name column only when the name shows up as one letter.&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;middle_name;&lt;/P&gt;&lt;P&gt;datalines&lt;/P&gt;&lt;P&gt;M&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;I&lt;/P&gt;&lt;P&gt;Tina&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to do this:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;if length(strip(middle_name)) = 1 then&lt;/P&gt;&lt;P&gt;middle_name = catx('.', middle_name, 1, 1), substr(middle_nm,1));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but the middle initials show as M.M and I.I&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated! Definitely am a beginner.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 17:28:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-period-for-middle-initials/m-p/698728#M213715</guid>
      <dc:creator>sasperson1</dc:creator>
      <dc:date>2020-11-13T17:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a period for middle initials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-period-for-middle-initials/m-p/698729#M213716</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;if length(strip(middle_name)) = 1 then&lt;/P&gt;
&lt;P&gt;middle_name = cats( middle_name,'.');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CATX only places the character BETWEEN things. The CATS will append the period (or other string) and you have already checked that you only want to do that when there is only one character&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 17:32:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-period-for-middle-initials/m-p/698729#M213716</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-13T17:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a period for middle initials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-period-for-middle-initials/m-p/698741#M213721</link>
      <description>Oh thank you! That worked for the most part. I forgot to add that some values will be blank and when I ran this, it added the period to blank values. Is there a way to avoid that? Does that make sense?&lt;BR /&gt;&lt;BR /&gt;M&lt;BR /&gt;&lt;BR /&gt;Tim&lt;BR /&gt;Bob&lt;BR /&gt;&lt;BR /&gt;I&lt;BR /&gt;Tina&lt;BR /&gt;&lt;BR /&gt;Thanks for your help!</description>
      <pubDate>Fri, 13 Nov 2020 17:53:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-period-for-middle-initials/m-p/698741#M213721</guid>
      <dc:creator>sasperson1</dc:creator>
      <dc:date>2020-11-13T17:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a period for middle initials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-period-for-middle-initials/m-p/698777#M213729</link>
      <description>&lt;P&gt;if length(strip(middle_name)) = 1 and not missing(middle_name) then&lt;/P&gt;
&lt;P&gt;middle_name = cats( middle_name,'.');&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 19:38:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-period-for-middle-initials/m-p/698777#M213729</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-13T19:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a period for middle initials</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-a-period-for-middle-initials/m-p/699141#M213862</link>
      <description>&lt;P&gt;Thank you so much! That worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 13:57:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-a-period-for-middle-initials/m-p/699141#M213862</guid>
      <dc:creator>sasperson1</dc:creator>
      <dc:date>2020-11-16T13:57:16Z</dc:date>
    </item>
  </channel>
</rss>

