<?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: SAS labeling help in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SAS-labeling-help/m-p/712500#M27056</link>
    <description>&lt;P&gt;It may shortcut some question and answer cycles by running Proc Contents on your data set in question and sharing the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another bit that may help is what do expect to do with 0/1 coding for sex that the current will not support?&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jan 2021 20:41:05 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-01-19T20:41:05Z</dc:date>
    <item>
      <title>SAS labeling help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-labeling-help/m-p/712272#M27007</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;This is probably a very basic question but I was handed a large dataset set that does not have the variables numerically coded. I have imported the file but would like to relabel the variables with numerical codes. For instance for sex, right now the categories are male and female but I would like male=0 and female=1. How would I code this? Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 23:58:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-labeling-help/m-p/712272#M27007</guid>
      <dc:creator>lawye010</dc:creator>
      <dc:date>2021-01-18T23:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAS labeling help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-labeling-help/m-p/712273#M27008</link>
      <description>&lt;P&gt;It depends. How many variables do you have to do this for? How many different options....and most importantly, why?&lt;/P&gt;
&lt;P&gt;Some applications require that you do this prior to your analysis for example, but SAS does not and can handle variables that are categorical in an analysis properly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some methods to fix this include:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Using &lt;A href="https://blogs.sas.com/content/iml/2019/07/03/create-custom-informat-sas.html" target="_self"&gt;custom informats&lt;/A&gt; and re-read the dat from the text file as needed&lt;/LI&gt;
&lt;LI&gt;Using &lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/proc_format_example.sas" target="_self"&gt;formats&lt;/A&gt; to remap the values to codes&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/proc_format_example.sas" target="_self"&gt;Apply formats&lt;/A&gt;, changes how the variables appear but not the underlying data itself. Usually this is done in reverse, values are stored as numerics but displayed as text with full descriptions. Helpful for ensuring no typos and that the order is as desired&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=n1j60arf27ll4nn1ejavv3nby4pa.htm&amp;amp;locale=en" target="_self"&gt;IF/THEN&lt;/A&gt; or &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=proccas&amp;amp;docsetTarget=p1gkruwpyaq5iln10z0ytkhpz5ub.htm&amp;amp;locale=en" target="_self"&gt;SELECT&lt;/A&gt; statements to recode the values.&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If you need to do the same remapping for multiple variables you may also want to use arrays.&lt;/P&gt;
&lt;P&gt;Here's a tutorial on using Arrays in SAS&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-arrays/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-arrays/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/363694"&gt;@lawye010&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;This is probably a very basic question but I was handed a large dataset set that does not have the variables numerically coded. I have imported the file but would like to relabel the variables with numerical codes. For instance for sex, right now the categories are male and female but I would like male=0 and female=1. How would I code this? Thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 00:06:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-labeling-help/m-p/712273#M27008</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-19T00:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS labeling help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-labeling-help/m-p/712283#M27009</link>
      <description>&lt;P&gt;proc format;&lt;/P&gt;
&lt;P&gt;value sexf&lt;/P&gt;
&lt;P&gt;0="Male"&lt;/P&gt;
&lt;P&gt;1="Female"&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data dsn;&lt;/P&gt;
&lt;P&gt;set dsn;&lt;/P&gt;
&lt;P&gt;format sex sexf.;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 01:03:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-labeling-help/m-p/712283#M27009</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-01-19T01:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAS labeling help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-labeling-help/m-p/712500#M27056</link>
      <description>&lt;P&gt;It may shortcut some question and answer cycles by running Proc Contents on your data set in question and sharing the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another bit that may help is what do expect to do with 0/1 coding for sex that the current will not support?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 20:41:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-labeling-help/m-p/712500#M27056</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-19T20:41:05Z</dc:date>
    </item>
  </channel>
</rss>

