<?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 FYI: USEFUL SAS MACRO CODE FOR INDUSTRY CLASSIFICATION INTO 15 INDUSTRIES in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/FYI-USEFUL-SAS-MACRO-CODE-FOR-INDUSTRY-CLASSIFICATION-INTO-15/m-p/116391#M32109</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;************************************************************************************************************************;&lt;/P&gt;&lt;P&gt;* SAS MACRO CODE FOR INDUSTRY CLASSIFICATION INTO 15 INDUSTRIES (prepared by Yaniv Konchitchki, U.C. Berkeley).&lt;/P&gt;&lt;P&gt;The code is based on Konchitchki, Yaniv. 2011."Inflation and Nominal Financial Reporting:&lt;/P&gt;&lt;P&gt;Implications for Performance and Stock Prices.” The Accounting Review 86 (3), 1045–1085.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This classification is also used in Barth, Mary E., Yaniv Konchitchki, Wayne R. Landsman. 2013. “Cost of &lt;/P&gt;&lt;P&gt;Capital and Earnings Transparency.” Journal of Accounting and Economics 55 (2-3), 206–224.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please cite if using it.&amp;nbsp; This code creates a dataset "dataout" by adding to any existing dataset "datain" the &lt;/P&gt;&lt;P&gt;15-industry classification based on "varForSICcode".&amp;nbsp; The new dataset adds to your dataset an industry variable &lt;/P&gt;&lt;P&gt;denoted as specified in "varForIndDescOutput".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A suggested use:&lt;/P&gt;&lt;P&gt;%Add15KonchitchkiIndustries(datain=cstat, dataout=cstat, varForSICcode=sic, varForIndDescOutput=ind)&lt;/P&gt;&lt;P&gt;Note: The variable SIC is directly from Compustat (used to be DNUM in the historical Compustat legacy format);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro Add15KonchitchkiIndustries(datain=,dataout=,varForSICcode=,varForIndDescOutput=);&lt;/P&gt;&lt;P&gt;data &amp;amp;dataout;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set &amp;amp;datain;&lt;/P&gt;&lt;P&gt;&amp;nbsp; varForSICcodeNum = &amp;amp;varForSICcode*1;* Ensure that the input industry classification is a numeric variable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (1000&amp;lt;=varForSICcodeNum&amp;lt; 1300) or (1399&amp;lt; varForSICcodeNum&amp;lt;=1999) then &amp;amp;varForIndDescOutput = "Mining, constructi.";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (2000&amp;lt;=varForSICcodeNum&amp;lt;=2111)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Food";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (2200&amp;lt;=varForSICcodeNum&amp;lt;=2799)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Textiles, printing.";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (2800&amp;lt;=varForSICcodeNum&amp;lt;=2824) or (2840&amp;lt;=varForSICcodeNum&amp;lt;=2899) then &amp;amp;varForIndDescOutput = "Chemicals";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (2830&amp;lt;=varForSICcodeNum&amp;lt;=2836)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Pharmaceuticals";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (2900&amp;lt;=varForSICcodeNum&amp;lt;=2999) or (1300&amp;lt;=varForSICcodeNum&amp;lt;=1399) then &amp;amp;varForIndDescOutput = "Extractive Industr.";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (3000&amp;lt;=varForSICcodeNum&amp;lt; 3570) or (3579&amp;lt; varForSICcodeNum&amp;lt; 3670)&lt;/P&gt;&lt;P&gt;&amp;nbsp; or (3679&amp;lt; varForSICcodeNum&amp;lt;=3999) then &amp;amp;varForIndDescOutput = "Durable";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (7370&amp;lt;=varForSICcodeNum&amp;lt;=7379) or (3570&amp;lt;=varForSICcodeNum&amp;lt;=3579)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or (3670&amp;lt;=varForSICcodeNum&amp;lt;=3679) then &amp;amp;varForIndDescOutput = "Computers";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (4000&amp;lt;=varForSICcodeNum&amp;lt;=4899)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Transportation";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (4900&amp;lt;=varForSICcodeNum&amp;lt;=4999)&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Utilities";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (5000&amp;lt;=varForSICcodeNum&amp;lt;=5999)&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Retail";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (6000&amp;lt;=varForSICcodeNum&amp;lt;=6411)&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Financial Institut.";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (6500&amp;lt;=varForSICcodeNum&amp;lt;=6999)&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Insurance, real es.";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (7000&amp;lt;=varForSICcodeNum&amp;lt; 7370) or (7379&amp;lt; varForSICcodeNum&amp;lt;=8999) then &amp;amp;varForIndDescOutput = "Services";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (9000&amp;lt;=varForSICcodeNum) then &amp;amp;varForIndDescOutput = "Other";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else &amp;amp;varForIndDescOutput = "Other";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop varForSICcodeNum;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend Add15KonchitchkiIndustries;&lt;/P&gt;&lt;P&gt;************************************************************************************************************************;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Apr 2013 03:47:45 GMT</pubDate>
    <dc:creator>CodingMaster</dc:creator>
    <dc:date>2013-04-23T03:47:45Z</dc:date>
    <item>
      <title>FYI: USEFUL SAS MACRO CODE FOR INDUSTRY CLASSIFICATION INTO 15 INDUSTRIES</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FYI-USEFUL-SAS-MACRO-CODE-FOR-INDUSTRY-CLASSIFICATION-INTO-15/m-p/116391#M32109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;************************************************************************************************************************;&lt;/P&gt;&lt;P&gt;* SAS MACRO CODE FOR INDUSTRY CLASSIFICATION INTO 15 INDUSTRIES (prepared by Yaniv Konchitchki, U.C. Berkeley).&lt;/P&gt;&lt;P&gt;The code is based on Konchitchki, Yaniv. 2011."Inflation and Nominal Financial Reporting:&lt;/P&gt;&lt;P&gt;Implications for Performance and Stock Prices.” The Accounting Review 86 (3), 1045–1085.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This classification is also used in Barth, Mary E., Yaniv Konchitchki, Wayne R. Landsman. 2013. “Cost of &lt;/P&gt;&lt;P&gt;Capital and Earnings Transparency.” Journal of Accounting and Economics 55 (2-3), 206–224.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please cite if using it.&amp;nbsp; This code creates a dataset "dataout" by adding to any existing dataset "datain" the &lt;/P&gt;&lt;P&gt;15-industry classification based on "varForSICcode".&amp;nbsp; The new dataset adds to your dataset an industry variable &lt;/P&gt;&lt;P&gt;denoted as specified in "varForIndDescOutput".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A suggested use:&lt;/P&gt;&lt;P&gt;%Add15KonchitchkiIndustries(datain=cstat, dataout=cstat, varForSICcode=sic, varForIndDescOutput=ind)&lt;/P&gt;&lt;P&gt;Note: The variable SIC is directly from Compustat (used to be DNUM in the historical Compustat legacy format);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro Add15KonchitchkiIndustries(datain=,dataout=,varForSICcode=,varForIndDescOutput=);&lt;/P&gt;&lt;P&gt;data &amp;amp;dataout;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set &amp;amp;datain;&lt;/P&gt;&lt;P&gt;&amp;nbsp; varForSICcodeNum = &amp;amp;varForSICcode*1;* Ensure that the input industry classification is a numeric variable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (1000&amp;lt;=varForSICcodeNum&amp;lt; 1300) or (1399&amp;lt; varForSICcodeNum&amp;lt;=1999) then &amp;amp;varForIndDescOutput = "Mining, constructi.";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (2000&amp;lt;=varForSICcodeNum&amp;lt;=2111)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Food";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (2200&amp;lt;=varForSICcodeNum&amp;lt;=2799)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Textiles, printing.";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (2800&amp;lt;=varForSICcodeNum&amp;lt;=2824) or (2840&amp;lt;=varForSICcodeNum&amp;lt;=2899) then &amp;amp;varForIndDescOutput = "Chemicals";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (2830&amp;lt;=varForSICcodeNum&amp;lt;=2836)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Pharmaceuticals";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (2900&amp;lt;=varForSICcodeNum&amp;lt;=2999) or (1300&amp;lt;=varForSICcodeNum&amp;lt;=1399) then &amp;amp;varForIndDescOutput = "Extractive Industr.";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (3000&amp;lt;=varForSICcodeNum&amp;lt; 3570) or (3579&amp;lt; varForSICcodeNum&amp;lt; 3670)&lt;/P&gt;&lt;P&gt;&amp;nbsp; or (3679&amp;lt; varForSICcodeNum&amp;lt;=3999) then &amp;amp;varForIndDescOutput = "Durable";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (7370&amp;lt;=varForSICcodeNum&amp;lt;=7379) or (3570&amp;lt;=varForSICcodeNum&amp;lt;=3579)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or (3670&amp;lt;=varForSICcodeNum&amp;lt;=3679) then &amp;amp;varForIndDescOutput = "Computers";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (4000&amp;lt;=varForSICcodeNum&amp;lt;=4899)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Transportation";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (4900&amp;lt;=varForSICcodeNum&amp;lt;=4999)&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Utilities";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (5000&amp;lt;=varForSICcodeNum&amp;lt;=5999)&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Retail";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (6000&amp;lt;=varForSICcodeNum&amp;lt;=6411)&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Financial Institut.";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (6500&amp;lt;=varForSICcodeNum&amp;lt;=6999)&amp;nbsp;&amp;nbsp; then &amp;amp;varForIndDescOutput = "Insurance, real es.";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (7000&amp;lt;=varForSICcodeNum&amp;lt; 7370) or (7379&amp;lt; varForSICcodeNum&amp;lt;=8999) then &amp;amp;varForIndDescOutput = "Services";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if (9000&amp;lt;=varForSICcodeNum) then &amp;amp;varForIndDescOutput = "Other";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else &amp;amp;varForIndDescOutput = "Other";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop varForSICcodeNum;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend Add15KonchitchkiIndustries;&lt;/P&gt;&lt;P&gt;************************************************************************************************************************;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 03:47:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FYI-USEFUL-SAS-MACRO-CODE-FOR-INDUSTRY-CLASSIFICATION-INTO-15/m-p/116391#M32109</guid>
      <dc:creator>CodingMaster</dc:creator>
      <dc:date>2013-04-23T03:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: FYI: USEFUL SAS MACRO CODE FOR INDUSTRY CLASSIFICATION INTO 15 INDUSTRIES</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FYI-USEFUL-SAS-MACRO-CODE-FOR-INDUSTRY-CLASSIFICATION-INTO-15/m-p/116392#M32110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or use a format such as:&lt;/P&gt;&lt;P&gt;proc format library=work;&lt;/P&gt;&lt;P&gt;value SICCode&lt;/P&gt;&lt;P&gt;0001 - 1300, 1399 - 1999 = "Mining, constructi."&lt;/P&gt;&lt;P&gt;2000 - 2111 = "Food"&lt;/P&gt;&lt;P&gt;2200 - 2799 = "Textiles, printing."&lt;/P&gt;&lt;P&gt;2800 - 2824, 2840 - 2899&amp;nbsp; = "Chemicals"&lt;/P&gt;&lt;P&gt;2830 - 2836&amp;nbsp; = "Pharmaceuticals"&lt;/P&gt;&lt;P&gt;2900 - 2999, 1300 - 1399 = "Extractive Industr."&lt;/P&gt;&lt;P&gt;3000 - 3570, 3579 &amp;lt;-&amp;lt; 3670, 3679 &amp;lt;- 3999 = "Durable"&lt;/P&gt;&lt;P&gt;7370 - 7379, 3570 - 3579, 3670 - 3679 = "Computers"&lt;/P&gt;&lt;P&gt;4000 - 4899 = "Transportation"&lt;/P&gt;&lt;P&gt;4900 - 4999 = "Utilities"&lt;/P&gt;&lt;P&gt;5000 - 5999 = "Retail"&lt;/P&gt;&lt;P&gt;6000 - 6411 = "Financial Institut."&lt;/P&gt;&lt;P&gt;6500 - 6999 = "Insurance, real es."&lt;/P&gt;&lt;P&gt;7000 -&amp;lt; 7370, 7379 &amp;lt;- 8999 = "Services"&lt;/P&gt;&lt;P&gt;9000 &amp;lt;- HIGH = "Other"&lt;/P&gt;&lt;P&gt;other = "Other";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assign the format to the SIC variable in analysis or print.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 14:40:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FYI-USEFUL-SAS-MACRO-CODE-FOR-INDUSTRY-CLASSIFICATION-INTO-15/m-p/116392#M32110</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-04-23T14:40:01Z</dc:date>
    </item>
  </channel>
</rss>

