<?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 SAS Date Format in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676087#M23664</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set with the following format in date column:&amp;nbsp;28feb2018:00:00:00.000. How do I write a code to count all the observations with the year 2018, 2019 etc.?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Aug 2020 08:33:12 GMT</pubDate>
    <dc:creator>aditikarande</dc:creator>
    <dc:date>2020-08-12T08:33:12Z</dc:date>
    <item>
      <title>SAS Date Format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676087#M23664</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set with the following format in date column:&amp;nbsp;28feb2018:00:00:00.000. How do I write a code to count all the observations with the year 2018, 2019 etc.?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 08:33:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676087#M23664</guid>
      <dc:creator>aditikarande</dc:creator>
      <dc:date>2020-08-12T08:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676089#M23665</link>
      <description>&lt;P&gt;Is the variable numeric and a format attached displaying it as datetime, or is it an alphanumeric variable?&lt;/P&gt;
&lt;P&gt;If you already have a sas-dateime variable, try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have nway;
  class datetime_var;
  format datetime_var dtyear4.;
  output out=counted(drop=_type_ rename=(_freq_=count));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Code is untested.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 08:39:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676089#M23665</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-08-12T08:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676090#M23666</link>
      <description>&lt;P&gt;Do something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   do dt = '01jan2018 00:00:00'dt to '31dec2020 00:00:00'dt by 3600;
      output;
   end;
   format dt datetime20.;
run;

proc freq data=have;
   table dt;
   format dt dtyear.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Aug 2020 08:40:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676090#M23666</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-08-12T08:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676091#M23667</link>
      <description>&lt;P&gt;Please try the below code , please check the count dataset from proc freq&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input datetime:anydtdtm.;
format datetime datetime20.;
cards;
28feb2018:00:00:00.000
;

data want;
set have;
year=year(datepart(datetime));
run;

proc freq data=want;
table year / out=count;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Aug 2020 08:41:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676091#M23667</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-08-12T08:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676092#M23668</link>
      <description>What does have signify?</description>
      <pubDate>Wed, 12 Aug 2020 08:46:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676092#M23668</guid>
      <dc:creator>aditikarande</dc:creator>
      <dc:date>2020-08-12T08:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676093#M23669</link>
      <description>have is the input dataset, since you did not provide the sample dataset, i created a sample dataset names as have and then used in subsequently</description>
      <pubDate>Wed, 12 Aug 2020 08:47:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676093#M23669</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-08-12T08:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676101#M23670</link>
      <description>I am getting an error with the do statement</description>
      <pubDate>Wed, 12 Aug 2020 09:41:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676101#M23670</guid>
      <dc:creator>aditikarande</dc:creator>
      <dc:date>2020-08-12T09:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676102#M23671</link>
      <description>&lt;P&gt;Post your log please.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 09:42:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676102#M23671</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-08-12T09:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676104#M23672</link>
      <description>also, what does cards signify?</description>
      <pubDate>Wed, 12 Aug 2020 10:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676104#M23672</guid>
      <dc:creator>aditikarande</dc:creator>
      <dc:date>2020-08-12T10:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676105#M23673</link>
      <description>&lt;P&gt;What about good, old RTM?&lt;/P&gt;
&lt;P&gt;SAS-Docs are at &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=pgmsashome&amp;amp;docsetTarget=home.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=pgmsashome&amp;amp;docsetTarget=home.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 10:06:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676105#M23673</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-08-12T10:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676108#M23674</link>
      <description>In order to put the data using the input statement we can use either cards or datalines , indicating that after these statements the data portion starts</description>
      <pubDate>Wed, 12 Aug 2020 10:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Date-Format/m-p/676108#M23674</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-08-12T10:27:26Z</dc:date>
    </item>
  </channel>
</rss>

