<?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 Issue while creating 0 /1 variable from categorical variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Issue-while-creating-0-1-variable-from-categorical-variable/m-p/243767#M45367</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi ,&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am facing the below problem while creating the dummy variable for the variable age_restriction&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;1- The variable is a character variable and contains 9 records (3,4,34,35,45,3U,4U and 5U)....&lt;/DIV&gt;&lt;DIV&gt;2-when i try to create the dummy variable it does not take the 3 as character variable and assumes it as numeric variable.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;3- The code which i use for creating dummy variable is &amp;nbsp;below&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;if age_restriction='3' then Age_R1=1; &amp;nbsp;else Age_R1=0;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;i always get the value of Age_R1 &amp;nbsp;=0 even though if age_restriction contains 3 as its value .&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;can you please help me on this error&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Fri, 15 Jan 2016 13:27:51 GMT</pubDate>
    <dc:creator>gaurav9839</dc:creator>
    <dc:date>2016-01-15T13:27:51Z</dc:date>
    <item>
      <title>Issue while creating 0 /1 variable from categorical variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-while-creating-0-1-variable-from-categorical-variable/m-p/243767#M45367</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi ,&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am facing the below problem while creating the dummy variable for the variable age_restriction&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;1- The variable is a character variable and contains 9 records (3,4,34,35,45,3U,4U and 5U)....&lt;/DIV&gt;&lt;DIV&gt;2-when i try to create the dummy variable it does not take the 3 as character variable and assumes it as numeric variable.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;3- The code which i use for creating dummy variable is &amp;nbsp;below&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;if age_restriction='3' then Age_R1=1; &amp;nbsp;else Age_R1=0;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;i always get the value of Age_R1 &amp;nbsp;=0 even though if age_restriction contains 3 as its value .&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;can you please help me on this error&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 15 Jan 2016 13:27:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-while-creating-0-1-variable-from-categorical-variable/m-p/243767#M45367</guid>
      <dc:creator>gaurav9839</dc:creator>
      <dc:date>2016-01-15T13:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Issue while creating 0 /1 variable from categorical variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-while-creating-0-1-variable-from-categorical-variable/m-p/243769#M45368</link>
      <description>&lt;P&gt;You most probably have an alignment problem (the '3' is not the first character in age_restriction).&lt;/P&gt;
&lt;P&gt;Use the left() function to left-align the variable before checking for its contents.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 13:35:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-while-creating-0-1-variable-from-categorical-variable/m-p/243769#M45368</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-01-15T13:35:19Z</dc:date>
    </item>
  </channel>
</rss>

