<?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 assigning numberic statemetn to character observation and visa versa in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/assigning-numberic-statemetn-to-character-observation-and-visa/m-p/14100#M2180</link>
    <description>when using the if then statements, can you assign a character statemetn to a numberic variable adn visa versa?</description>
    <pubDate>Wed, 01 Apr 2009 19:54:14 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-04-01T19:54:14Z</dc:date>
    <item>
      <title>assigning numberic statemetn to character observation and visa versa</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/assigning-numberic-statemetn-to-character-observation-and-visa/m-p/14100#M2180</link>
      <description>when using the if then statements, can you assign a character statemetn to a numberic variable adn visa versa?</description>
      <pubDate>Wed, 01 Apr 2009 19:54:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/assigning-numberic-statemetn-to-character-observation-and-visa/m-p/14100#M2180</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-01T19:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: assigning numberic statemetn to character observation and visa versa</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/assigning-numberic-statemetn-to-character-observation-and-visa/m-p/14101#M2181</link>
      <description>why would you want to do that?</description>
      <pubDate>Wed, 01 Apr 2009 20:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/assigning-numberic-statemetn-to-character-observation-and-visa/m-p/14101#M2181</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-01T20:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: assigning numberic statemetn to character observation and visa versa</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/assigning-numberic-statemetn-to-character-observation-and-visa/m-p/14102#M2182</link>
      <description>this will make it easier to check the data once it has been run and make it easier to read for example i was trying to do this if age &amp;gt;= 1 and age &amp;lt; 4 then agegroup = toddler, but it didn't work.</description>
      <pubDate>Thu, 02 Apr 2009 00:31:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/assigning-numberic-statemetn-to-character-observation-and-visa/m-p/14102#M2182</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-02T00:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: assigning numberic statemetn to character observation and visa versa</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/assigning-numberic-statemetn-to-character-observation-and-visa/m-p/14103#M2183</link>
      <description>Hi:&lt;BR /&gt;
  You have a good idea. The way I would describe what you want to do is: create a new character variable or new category variable based on the VALUE of a numeric variable. Technically, you are not assigning a numeric statement to a character variable or a character value to a numeric variable.&lt;BR /&gt;
 &lt;BR /&gt;
  There are 2 ways to do what you want:&lt;BR /&gt;
1) is to create your own format and then use either the PUT function or INPUT function to create either a character or numeric variable&lt;BR /&gt;
2) use a series of IF statements to assign a value to either a character or numeric variable.&lt;BR /&gt;
&lt;BR /&gt;
  There are some rules about creating variables. For example:&lt;BR /&gt;
[pre]&lt;BR /&gt;
newnumvar = 10;  &amp;lt;-- numeric variable being created&lt;BR /&gt;
newcharvar = 'Wombat';  &amp;lt;--character variable being created&lt;BR /&gt;
  &lt;BR /&gt;
OR&lt;BR /&gt;
   &lt;BR /&gt;
** NUMERIC variable AGECAT being created;&lt;BR /&gt;
if age gt 0 and age lt 4 then agecat = 1;&lt;BR /&gt;
  else agecat = 2;&lt;BR /&gt;
 &lt;BR /&gt;
OR&lt;BR /&gt;
     &lt;BR /&gt;
** CHARACTER variable AGECAT2 being created;&lt;BR /&gt;
if age gt 0 and age lt 4 then agecat2 = 'toddler  ';&lt;BR /&gt;
  else agecat2 = 'pre-school';&lt;BR /&gt;
   &lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Note that character variables are -usually- assigned quoted strings or assigned the values of other character variables. So when you had something like: &lt;BR /&gt;
agegroup = toddler&lt;BR /&gt;
&lt;BR /&gt;
SAS thought that toddler was a variable and you wanted to assign the value of the toddler variable to the new variable agegroup.&lt;BR /&gt;
 &lt;BR /&gt;
You might want to look in the documentation for the section about variables and how to create them and how to use them.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 02 Apr 2009 02:21:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/assigning-numberic-statemetn-to-character-observation-and-visa/m-p/14103#M2183</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-04-02T02:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: assigning numberic statemetn to character observation and visa versa</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/assigning-numberic-statemetn-to-character-observation-and-visa/m-p/14104#M2184</link>
      <description>thankyou for the information. I will run it and see how it comes out.</description>
      <pubDate>Thu, 02 Apr 2009 19:51:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/assigning-numberic-statemetn-to-character-observation-and-visa/m-p/14104#M2184</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-02T19:51:19Z</dc:date>
    </item>
  </channel>
</rss>

