<?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 VARIABLE CHARACTER in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/VARIABLE-CHARACTER/m-p/460990#M14309</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to change the month number to a season for the variable camonth&amp;nbsp;&lt;/P&gt;&lt;P&gt;month from 1 to 5 = spring&amp;nbsp;&lt;/P&gt;&lt;P&gt;month from 9 to 12 = autumn&amp;nbsp;&lt;/P&gt;&lt;P&gt;months from 6 to 8 others&amp;nbsp;&lt;/P&gt;&lt;P&gt;in data HO&lt;/P&gt;&lt;P&gt;&amp;nbsp;I did this code which results in missing data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if camonth = 1 then camonth = autumn;&lt;BR /&gt;if camonth = 2 then camonth = &lt;SPAN&gt;autumn&lt;/SPAN&gt;;&lt;BR /&gt;if camonth = 3 then camonth = &lt;SPAN&gt;autumn&lt;/SPAN&gt;;&lt;BR /&gt;if camonth = 4 then camonth = &lt;SPAN&gt;autumn&lt;/SPAN&gt;;&lt;BR /&gt;if camonth = 5 then camonth= &lt;SPAN&gt;autumn&lt;/SPAN&gt;;&lt;BR /&gt;if camonth = 6 then camonth = other;&lt;BR /&gt;if camonth = 7 then camonth = other;&lt;BR /&gt;if camonth = 8 then camonth = other;&lt;BR /&gt;if camonth = 9 then camonth = spring;&lt;BR /&gt;if camonth = 10 then camonth = spring;&lt;BR /&gt;if camonth = 11 then camonth = spring;&lt;BR /&gt;if camonth = 12 then camonth = spring;&lt;/P&gt;&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;camonth 
1
2
3
4
5
6
7
8
9
10
11
12&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 May 2018 13:06:16 GMT</pubDate>
    <dc:creator>Barkamih</dc:creator>
    <dc:date>2018-05-09T13:06:16Z</dc:date>
    <item>
      <title>VARIABLE CHARACTER</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/VARIABLE-CHARACTER/m-p/460990#M14309</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to change the month number to a season for the variable camonth&amp;nbsp;&lt;/P&gt;&lt;P&gt;month from 1 to 5 = spring&amp;nbsp;&lt;/P&gt;&lt;P&gt;month from 9 to 12 = autumn&amp;nbsp;&lt;/P&gt;&lt;P&gt;months from 6 to 8 others&amp;nbsp;&lt;/P&gt;&lt;P&gt;in data HO&lt;/P&gt;&lt;P&gt;&amp;nbsp;I did this code which results in missing data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if camonth = 1 then camonth = autumn;&lt;BR /&gt;if camonth = 2 then camonth = &lt;SPAN&gt;autumn&lt;/SPAN&gt;;&lt;BR /&gt;if camonth = 3 then camonth = &lt;SPAN&gt;autumn&lt;/SPAN&gt;;&lt;BR /&gt;if camonth = 4 then camonth = &lt;SPAN&gt;autumn&lt;/SPAN&gt;;&lt;BR /&gt;if camonth = 5 then camonth= &lt;SPAN&gt;autumn&lt;/SPAN&gt;;&lt;BR /&gt;if camonth = 6 then camonth = other;&lt;BR /&gt;if camonth = 7 then camonth = other;&lt;BR /&gt;if camonth = 8 then camonth = other;&lt;BR /&gt;if camonth = 9 then camonth = spring;&lt;BR /&gt;if camonth = 10 then camonth = spring;&lt;BR /&gt;if camonth = 11 then camonth = spring;&lt;BR /&gt;if camonth = 12 then camonth = spring;&lt;/P&gt;&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;camonth 
1
2
3
4
5
6
7
8
9
10
11
12&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 May 2018 13:06:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/VARIABLE-CHARACTER/m-p/460990#M14309</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2018-05-09T13:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: VARIABLE CHARACTER</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/VARIABLE-CHARACTER/m-p/460992#M14310</link>
      <description>&lt;P&gt;I am going to assume that cammonth is a&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;numeric&lt;/STRONG&gt;&lt;/U&gt; variable, therefore you cannot put&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;character&lt;/STRONG&gt;&lt;/U&gt; data into it.&amp;nbsp; You have a few methods to do what you want, most simple is a format which you apply to the data -&amp;nbsp; don't know what software your using so this is simple SAS code:&lt;/P&gt;
&lt;PRE&gt;proc format;
  value season
    1-5="Autumn"
    6-8="Other"
    9-12="Spring";
run;

data want;
  set have;
  format cammonth season.;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 May 2018 13:09:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/VARIABLE-CHARACTER/m-p/460992#M14310</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-05-09T13:09:47Z</dc:date>
    </item>
  </channel>
</rss>

