<?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 a character to a variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Add-a-character-to-a-variable/m-p/314118#M68360</link>
    <description>Hi,&lt;BR /&gt;Depends whether your existing values are held as numeric or character variables.&lt;BR /&gt;If character then look at the CATS function.&lt;BR /&gt;If numeric then look at the PUT function to with a suitable format to convert to character first and then the CATS function.&lt;BR /&gt;Hope this helps.&lt;BR /&gt;Cheers&lt;BR /&gt;Chris</description>
    <pubDate>Thu, 24 Nov 2016 15:18:49 GMT</pubDate>
    <dc:creator>rivieralad</dc:creator>
    <dc:date>2016-11-24T15:18:49Z</dc:date>
    <item>
      <title>Add a character to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-a-character-to-a-variable/m-p/314114#M68358</link>
      <description>&lt;P&gt;Hi, I'm moving my first steps in Sas base programming. I'm trying to figure out how to solve the following problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;id &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;group_id &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;id &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;group_id&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13456 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;13456C&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12345 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ---------&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12345C&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 34567 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;34567C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, in nutshell, I want to add a character to an entire dataset variable.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2016 15:08:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-a-character-to-a-variable/m-p/314114#M68358</guid>
      <dc:creator>VonNeuman</dc:creator>
      <dc:date>2016-11-24T15:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Add a character to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-a-character-to-a-variable/m-p/314117#M68359</link>
      <description>&lt;P&gt;Is group_id a numeric variable? &amp;nbsp;If so you can't, you cannot put non numeric characters in a numeric field. &amp;nbsp;Now you can move this to a character field:&lt;/P&gt;
&lt;PRE&gt;data want (drop=old_group_id);
  length group_id $50;
  set have (rename=(group_id=old_group_id));
  group_id=cats(put(old_group_id,best.),"C");
run;&lt;/PRE&gt;
&lt;P&gt;If group_id is character then:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  group_id=cats(group_id,"C");
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Nov 2016 15:14:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-a-character-to-a-variable/m-p/314117#M68359</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-24T15:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Add a character to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-a-character-to-a-variable/m-p/314118#M68360</link>
      <description>Hi,&lt;BR /&gt;Depends whether your existing values are held as numeric or character variables.&lt;BR /&gt;If character then look at the CATS function.&lt;BR /&gt;If numeric then look at the PUT function to with a suitable format to convert to character first and then the CATS function.&lt;BR /&gt;Hope this helps.&lt;BR /&gt;Cheers&lt;BR /&gt;Chris</description>
      <pubDate>Thu, 24 Nov 2016 15:18:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-a-character-to-a-variable/m-p/314118#M68360</guid>
      <dc:creator>rivieralad</dc:creator>
      <dc:date>2016-11-24T15:18:49Z</dc:date>
    </item>
  </channel>
</rss>

