<?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 Why people multiple by 100 to year(date) from CRSP? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-people-multiple-by-100-to-year-date-from-CRSP/m-p/724439#M224918</link>
    <description>&lt;P&gt;Hi SAS Users,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This post is of my curiosity when reading a published code for a paper relating to finance (data from CRSP)&lt;/P&gt;
&lt;P&gt;I do not have chances to access the dataset so what I guess just a guess.&lt;/P&gt;
&lt;P&gt;The dataset has a variable name "&lt;STRONG&gt;date&lt;/STRONG&gt;". I guess this variable have the informat &lt;STRONG&gt;date9.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I saw the author does one calculation surprising me, he calculates:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ym=year(Date)*100 + month(Date);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am not sure if you deal with "date", whether you have ever seen any application of the above code?&lt;/P&gt;
&lt;P&gt;I am sorry for the ambiguous information (because I just have the code, no more than that), but I hope that I can hear something from your experience.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warmest regards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Updated: I read closer to the later code, it seems that this code is to calculate the month.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Mar 2021 09:47:03 GMT</pubDate>
    <dc:creator>Phil_NZ</dc:creator>
    <dc:date>2021-03-08T09:47:03Z</dc:date>
    <item>
      <title>Why people multiple by 100 to year(date) from CRSP?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-people-multiple-by-100-to-year-date-from-CRSP/m-p/724439#M224918</link>
      <description>&lt;P&gt;Hi SAS Users,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This post is of my curiosity when reading a published code for a paper relating to finance (data from CRSP)&lt;/P&gt;
&lt;P&gt;I do not have chances to access the dataset so what I guess just a guess.&lt;/P&gt;
&lt;P&gt;The dataset has a variable name "&lt;STRONG&gt;date&lt;/STRONG&gt;". I guess this variable have the informat &lt;STRONG&gt;date9.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I saw the author does one calculation surprising me, he calculates:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ym=year(Date)*100 + month(Date);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am not sure if you deal with "date", whether you have ever seen any application of the above code?&lt;/P&gt;
&lt;P&gt;I am sorry for the ambiguous information (because I just have the code, no more than that), but I hope that I can hear something from your experience.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warmest regards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Updated: I read closer to the later code, it seems that this code is to calculate the month.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 09:47:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-people-multiple-by-100-to-year-date-from-CRSP/m-p/724439#M224918</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-03-08T09:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why people multiple by 100 to year(date) from CRSP?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-people-multiple-by-100-to-year-date-from-CRSP/m-p/724444#M224921</link>
      <description>&lt;P&gt;Run this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  date = '08mar2021'd; /*today();*/
  format date date9.;

  y = year(Date);
  m = month(Date);

  ym=year(Date)*100 + month(Date); /* numerical value of "yeramonth", e.g. 202103 */

  put (_ALL_) (=/);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Purpose of that line is to create numerical variable with "yearmonth" value, e.g for "08mar2021'd you will get 202103&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 09:46:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-people-multiple-by-100-to-year-date-from-CRSP/m-p/724444#M224921</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2021-03-08T09:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Why people multiple by 100 to year(date) from CRSP?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-people-multiple-by-100-to-year-date-from-CRSP/m-p/724452#M224926</link>
      <description>&lt;P&gt;Personally, I would create a character variable with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put(date,yymmn6.)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Mar 2021 10:52:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-people-multiple-by-100-to-year-date-from-CRSP/m-p/724452#M224926</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-03-08T10:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why people multiple by 100 to year(date) from CRSP?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-people-multiple-by-100-to-year-date-from-CRSP/m-p/724462#M224928</link>
      <description>&lt;P&gt;Character is "1 function" and 6 bytes to store.&lt;/P&gt;
&lt;P&gt;Numeric is "2 functions" but only 4 bytes to store,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  format date date9.;
  length ym 4;

  do date = '01jan1600'd, today(), '31dec9999'd;
    ym=year(Date)*100 + month(Date); 
    put (_ALL_) (=/);
    output;
  end;
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Possible question is: "Is comparison or sorting of numeric faster than character?"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 11:23:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-people-multiple-by-100-to-year-date-from-CRSP/m-p/724462#M224928</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2021-03-08T11:23:03Z</dc:date>
    </item>
  </channel>
</rss>

