<?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 create a numeric and a character variables in an if statement in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/create-a-numeric-and-a-character-variables-in-an-if-statement/m-p/542615#M7587</link>
    <description>&lt;P&gt;I would like to create two variables , one numeric and one character, according to ages. For example , for age&amp;lt;=8, I would like to assign 10 to grade and median to growth.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I only know how to create one variable for one if statement, which is shown below. I want to ask if there is more efficient way to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data age;
	set age;
	grade = .;
	growth = .;
	if (age&amp;lt;=8) then grade=10;
       if (age&amp;lt;=8) then growth="median";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 13 Mar 2019 01:03:58 GMT</pubDate>
    <dc:creator>RebeccaJW</dc:creator>
    <dc:date>2019-03-13T01:03:58Z</dc:date>
    <item>
      <title>create a numeric and a character variables in an if statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/create-a-numeric-and-a-character-variables-in-an-if-statement/m-p/542615#M7587</link>
      <description>&lt;P&gt;I would like to create two variables , one numeric and one character, according to ages. For example , for age&amp;lt;=8, I would like to assign 10 to grade and median to growth.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I only know how to create one variable for one if statement, which is shown below. I want to ask if there is more efficient way to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data age;
	set age;
	grade = .;
	growth = .;
	if (age&amp;lt;=8) then grade=10;
       if (age&amp;lt;=8) then growth="median";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Mar 2019 01:03:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/create-a-numeric-and-a-character-variables-in-an-if-statement/m-p/542615#M7587</guid>
      <dc:creator>RebeccaJW</dc:creator>
      <dc:date>2019-03-13T01:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: create a numeric and a character variables in an if statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/create-a-numeric-and-a-character-variables-in-an-if-statement/m-p/542616#M7588</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 

data age;
	set age;
if (age&amp;lt;=8) then do;
         grade=10;
        growth="median";
       END;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Mar 2019 01:07:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/create-a-numeric-and-a-character-variables-in-an-if-statement/m-p/542616#M7588</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-13T01:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: create a numeric and a character variables in an if statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/create-a-numeric-and-a-character-variables-in-an-if-statement/m-p/542617#M7589</link>
      <description>It works! Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt; !</description>
      <pubDate>Wed, 13 Mar 2019 01:10:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/create-a-numeric-and-a-character-variables-in-an-if-statement/m-p/542617#M7589</guid>
      <dc:creator>RebeccaJW</dc:creator>
      <dc:date>2019-03-13T01:10:12Z</dc:date>
    </item>
  </channel>
</rss>

