<?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: Imported categorical variable with values from spss now displays as numeric but when converted to character I lose values in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Imported-categorical-variable-with-values-from-spss-now-displays/m-p/217821#M53589</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I am not sure if this how best to approach it but this is what I was able to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;value familygross&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;0='Unknown or not applicable'&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;1= 'Less than 20,000'&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;3= '20,000 to 39,999'&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;8='40,000 to 59,999'&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;12='60,000 to 79,999';&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run; &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P&gt;proc freq data=FA2013_7;&lt;/P&gt;&lt;P&gt;tables familygrossincome;&lt;/P&gt;&lt;P&gt;format familygrossincome familygross.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still do not know how to display values that have been imported for the variable from spss.&lt;/P&gt;&lt;P&gt;Thank you for your response and help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Apr 2015 20:51:53 GMT</pubDate>
    <dc:creator>mitris</dc:creator>
    <dc:date>2015-04-09T20:51:53Z</dc:date>
    <item>
      <title>Imported categorical variable with values from spss now displays as numeric but when converted to character I lose values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Imported-categorical-variable-with-values-from-spss-now-displays/m-p/217819#M53587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;variable in spss is familygrossincome:&lt;/P&gt;&lt;P&gt;0='Unknown or not applicable'&lt;/P&gt;&lt;P&gt;1= 'Less than 20,000'&lt;/P&gt;&lt;P&gt;3= '20,000 to 39,999'&lt;/P&gt;&lt;P&gt;8='40,000 to 59,999'&lt;/P&gt;&lt;P&gt;12='60,000 to 79,999';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When imported, proc contents shows it is numeric. When I run proc freq it displays the levels as text i.e.&lt;/P&gt;&lt;P&gt;Unknown or not applicable&lt;/P&gt;&lt;P&gt;less than 20,000&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I do where statement I have to use numeric value (0, 1, 3, 8 12). I can only tell these are the values by looking at spss I cannot find them in sas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i make a character copy using familygrossCat= STRIP (PUT(familygrossincome, familygross.) then proc freq only displays 0,1 3, 8, 12)&lt;/P&gt;&lt;P&gt;I guess I have three questions.&lt;/P&gt;&lt;P&gt;1) How do create a categorical variable with the text values not the numbers?&lt;/P&gt;&lt;P&gt;2) If I do copy numbers, how do I get procedures to display the text values (e.g. less than 20,000) instead of numerical value?&lt;/P&gt;&lt;P&gt;3) What is the command to see what the numerical and character values are for a variable? I usually just look at the original spss file&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 20:14:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Imported-categorical-variable-with-values-from-spss-now-displays/m-p/217819#M53587</guid>
      <dc:creator>mitris</dc:creator>
      <dc:date>2015-04-08T20:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Imported categorical variable with values from spss now displays as numeric but when converted to character I lose values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Imported-categorical-variable-with-values-from-spss-now-displays/m-p/217820#M53588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It has not been changed to character and attempts to modify it are likely going to misbehave. When you ran proc contents it should have shown you that the variable has a format associated with it, and likely to be the name of the variable. Which is why reference in Where or IF statements you need the 0, 1 etc.&lt;/P&gt;&lt;P&gt;If you want proc freq to show&amp;nbsp; the 1, 2, 3 values then add a line to the code like:&lt;/P&gt;&lt;P&gt;format familygrossCat best.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc freq by default will use the currently assigned format for any of the variable values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 20:37:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Imported-categorical-variable-with-values-from-spss-now-displays/m-p/217820#M53588</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-04-08T20:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Imported categorical variable with values from spss now displays as numeric but when converted to character I lose values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Imported-categorical-variable-with-values-from-spss-now-displays/m-p/217821#M53589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I am not sure if this how best to approach it but this is what I was able to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;value familygross&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;0='Unknown or not applicable'&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;1= 'Less than 20,000'&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;3= '20,000 to 39,999'&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;8='40,000 to 59,999'&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;12='60,000 to 79,999';&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run; &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P&gt;proc freq data=FA2013_7;&lt;/P&gt;&lt;P&gt;tables familygrossincome;&lt;/P&gt;&lt;P&gt;format familygrossincome familygross.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still do not know how to display values that have been imported for the variable from spss.&lt;/P&gt;&lt;P&gt;Thank you for your response and help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 20:51:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Imported-categorical-variable-with-values-from-spss-now-displays/m-p/217821#M53589</guid>
      <dc:creator>mitris</dc:creator>
      <dc:date>2015-04-09T20:51:53Z</dc:date>
    </item>
  </channel>
</rss>

