<?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: categorical variable in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457290#M5336</link>
    <description>&lt;P&gt;No, your code is not syntactically correct.&amp;nbsp; To correct your code:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token comment"&gt;*create categorical variable for industry;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; paper&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;ceo_firm3&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;  set&lt;/SPAN&gt; paper&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;ceo_firm2&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;  if&lt;/SPAN&gt; NAICS&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;11&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; industry&lt;SPAN class="token operator"&gt;="&lt;/SPAN&gt;outdoors"&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;  if&lt;/SPAN&gt; NAICS&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;21&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; industry&lt;SPAN class="token operator"&gt;="&lt;/SPAN&gt;mining"&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However that is a bit of a faff, and then what if you want to sort per code order.&amp;nbsp; Another way of doing it is by formats:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Apr 2018 13:59:08 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-04-25T13:59:08Z</dc:date>
    <item>
      <title>categorical variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457277#M5335</link>
      <description>&lt;P&gt;Hey!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a categorical variable for different industries using NAICS code. Naics.com identifies 20 different industries:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=11" target="_blank"&gt;11&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=11" target="_blank"&gt;Agriculture, Forestry, Fishing and Hunting&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=21" target="_blank"&gt;21&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=21" target="_blank"&gt;Mining&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=22" target="_blank"&gt;22&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=22" target="_blank"&gt;Utilities&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=23" target="_blank"&gt;23&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=23" target="_blank"&gt;Construction&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=3133" target="_blank"&gt;31-33&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=3133" target="_blank"&gt;Manufacturing&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=42" target="_blank"&gt;42&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=42" target="_blank"&gt;Wholesale Trade&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=4445" target="_blank"&gt;44-45&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=4445" target="_blank"&gt;Retail Trade&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=4849" target="_blank"&gt;48-49&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=4849" target="_blank"&gt;Transportation and Warehousing&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=51" target="_blank"&gt;51&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=51" target="_blank"&gt;Information&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=52" target="_blank"&gt;52&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=52" target="_blank"&gt;Finance and Insurance&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=53" target="_blank"&gt;53&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=53" target="_blank"&gt;Real Estate Rental and Leasing&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=54" target="_blank"&gt;54&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=54" target="_blank"&gt;Professional, Scientific, and Technical Services&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=55" target="_blank"&gt;55&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=55" target="_blank"&gt;Management of Companies and Enterprises&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=56" target="_blank"&gt;56&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=56" target="_blank"&gt;Administrative and Support and Waste Management and Remediation Services&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=61" target="_blank"&gt;61&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=61" target="_blank"&gt;Educational Services&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=62" target="_blank"&gt;62&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=62" target="_blank"&gt;Health Care and Social Assistance&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=71" target="_blank"&gt;71&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=71" target="_blank"&gt;Arts, Entertainment, and Recreation&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=72" target="_blank"&gt;72&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=72" target="_blank"&gt;Accommodation and Food Services&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=81" target="_blank"&gt;81&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=81" target="_blank"&gt;Other Services (except Public Administration)&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=92" target="_blank"&gt;92&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://www.naics.com/six-digit-naics/?code=92" target="_blank"&gt;Public Administration&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The data look just like the above codes--no extra zeros or anything.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without looking too scrupulously at the codes themselves, is this the right idea?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*create categorical variable for industry;
data paper.ceo_firm3;
	set paper.ceo_firm2;
	if NAICS=11 then industry=outdoors;
	if NAICS=21 then industry=mining;
	if NAICS=22 then industry=utilities;
	if NAICS=23 then industry=construction;
	if NAICS=31 then industry=manufacturing;
	if NAICS=32 then industry=manufacturing;
	if NAICS=33 then industry=manufacturing;
	if NAICS=42 then industry=wholesale;
	if NAICS=44 then industry=retail;
	if NAICS=45 then industry=retail;
	if NAICS=48 then industry=transportation;
	if NAICS=49 then industry=transportation;
	if NAICS=51 then industry=information;
	if NAICS=52 then industry=finance;
	if NAICS=53 then industry=real_estate;
	if NAICS=54 then industry=professional; 
	if NAICS=55 then industry=management;
	if NAICS=56 then industry=waste;
	if NAICS=61 then industry=education;
	if NAICS=62 then industry=healthcare;
	if NAICS=71 then industry=arts;
	if NAICS=72 then industry=food;
	if NAICS=81 then industry=other;
	if NAICS=92 then industry=public_admin;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks for the feedback!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-SAStuck&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 13:42:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457277#M5335</guid>
      <dc:creator>sastuck</dc:creator>
      <dc:date>2018-04-25T13:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: categorical variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457290#M5336</link>
      <description>&lt;P&gt;No, your code is not syntactically correct.&amp;nbsp; To correct your code:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token comment"&gt;*create categorical variable for industry;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; paper&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;ceo_firm3&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;  set&lt;/SPAN&gt; paper&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;ceo_firm2&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;  if&lt;/SPAN&gt; NAICS&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;11&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; industry&lt;SPAN class="token operator"&gt;="&lt;/SPAN&gt;outdoors"&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;  if&lt;/SPAN&gt; NAICS&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;21&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; industry&lt;SPAN class="token operator"&gt;="&lt;/SPAN&gt;mining"&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However that is a bit of a faff, and then what if you want to sort per code order.&amp;nbsp; Another way of doing it is by formats:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 13:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457290#M5336</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-04-25T13:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: categorical variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457320#M5337</link>
      <description>&lt;P&gt;Several websites (hint census) have this as a CSV file with the mapping’s down to the 4 &amp;amp; 6 digit NAICS. If you read in the CSV file and create a data set to pass to PROC FORMAT using CNTLIN you can avoid the manual typing out of all your codes.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 14:47:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457320#M5337</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-25T14:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: categorical variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457348#M5338</link>
      <description>&lt;P&gt;Thanks for the heads up&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;! How would I merge the census's data into my data set without any additional information on the company though, like TICKER or CONAME?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 15:15:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457348#M5338</guid>
      <dc:creator>sastuck</dc:creator>
      <dc:date>2018-04-25T15:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: categorical variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457364#M5339</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/177874"&gt;@sastuck&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for the heads up&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;! How would I merge the census's data into my data set without any additional information on the company though, like TICKER or CONAME?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why would you need ticker or coname? You are asking about values of NAICS codes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is how a custom format works:&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
value naics
11="outdoors"
21="mining"
22="utilities"
23="construction"
31="manufacturing"
32="manufacturing"
33="manufacturing"
42="wholesale"
;
run;

data junk;
   do x=11,21,22,23,33;
      output;
   end;
   format x naics.;
   label x ="Industry";
run;
proc print data=junk label;
var x;
run;
&lt;/PRE&gt;
&lt;P&gt;The source &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;mentioned would allow creating a pretty complete format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 15:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457364#M5339</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-25T15:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: categorical variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457416#M5340</link>
      <description>&lt;P&gt;i'm mentioning ticker and coname because in the end I want this data to be in my ceo_firm dataset. I'm not understanding how the code you shared would get the naics data into this new ceo_firm3 data set. Please enlighten me!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 17:36:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457416#M5340</guid>
      <dc:creator>sastuck</dc:creator>
      <dc:date>2018-04-25T17:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: categorical variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457434#M5342</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/177874"&gt;@sastuck&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;i'm mentioning ticker and coname because in the end I want this data to be in my ceo_firm dataset. I'm not understanding how the code you shared would get the naics data into this new ceo_firm3 data set. Please enlighten me!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The information is already in your data: the NAICS code value. The format just displays it in a more human understandable way. There is often no need to create an additional variable if all the information you need is contained in an existing variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do not already have the NAICS code in your ceo_firm data set then that should have been your question.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 18:12:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457434#M5342</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-25T18:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: categorical variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457435#M5343</link>
      <description>&lt;P&gt;It is in the dataset. I just want to use it to create the categorical variables&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 18:16:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457435#M5343</guid>
      <dc:creator>sastuck</dc:creator>
      <dc:date>2018-04-25T18:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: categorical variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457465#M5346</link>
      <description>&lt;P&gt;Once you create a format you just need to apply it. You have two options:&lt;/P&gt;
&lt;P&gt;1) Add a new variable, character, that contains the description.&lt;/P&gt;
&lt;P&gt;2) Apply the format using PROC PRINT.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A generic example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value age_group
low - 13 = 'Pre-Teen'
13 - 15 = 'Teen'
16 - high = 'Adult';
run;

title 'Example of an applied format';
proc print data=sashelp.class;
format age age_group.;
run;


data class;
set sashelp.class;
age_category = put(age, age_group.);
label age_category = 'Age Category';
run;

title 'Example of creating a new variable with the format';
proc print data=class;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/177874"&gt;@sastuck&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;It is in the dataset. I just want to use it to create the categorical variables&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2018 19:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/categorical-variable/m-p/457465#M5346</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-25T19:21:32Z</dc:date>
    </item>
  </channel>
</rss>

