<?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: Need Date Format like YYYYMMDDHH for the previous hour in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-Date-Format-like-YYYYMMDDHH-for-the-previous-hour/m-p/139574#M28172</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can create your own datetime format to get the what you want. The INTNX function can be used to add or subtract datetime intervals, see sample&lt;/P&gt;&lt;P&gt;below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; picture xyyyymmddhh (default=10)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; low - high = '%Y%m%0d%0H' (datatype=datetime)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; now = datetime();&lt;/P&gt;&lt;P&gt;&amp;nbsp; length now_c10 $ 10;&lt;/P&gt;&lt;P&gt;&amp;nbsp; now_c10 = put(now, xyyyymmddhh.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; now1h = intnx("dthour", now, -1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; now_c101h = put(now1h, xyyyymmddhh.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; format now datetime22.3;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Oct 2014 20:59:39 GMT</pubDate>
    <dc:creator>BrunoMueller</dc:creator>
    <dc:date>2014-10-23T20:59:39Z</dc:date>
    <item>
      <title>Need Date Format like YYYYMMDDHH for the previous hour</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Date-Format-like-YYYYMMDDHH-for-the-previous-hour/m-p/139573#M28171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create a variable which shows the previous hour.&lt;/P&gt;&lt;P&gt;The format of this variable will be YYYYMMDDHH. --&amp;gt; (&lt;SPAN style="font-size: 11.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;$CHAR10.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Assume that; now it is 2014102322, and I want to create my variable with 2014102321 which means it is one hour before the current time.&lt;/P&gt;&lt;P&gt;If it is 2014102400 then the value should be 2014102323.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I code that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Onuralp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 19:43:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Date-Format-like-YYYYMMDDHH-for-the-previous-hour/m-p/139573#M28171</guid>
      <dc:creator>o_p</dc:creator>
      <dc:date>2014-10-23T19:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need Date Format like YYYYMMDDHH for the previous hour</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Date-Format-like-YYYYMMDDHH-for-the-previous-hour/m-p/139574#M28172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can create your own datetime format to get the what you want. The INTNX function can be used to add or subtract datetime intervals, see sample&lt;/P&gt;&lt;P&gt;below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; picture xyyyymmddhh (default=10)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; low - high = '%Y%m%0d%0H' (datatype=datetime)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; now = datetime();&lt;/P&gt;&lt;P&gt;&amp;nbsp; length now_c10 $ 10;&lt;/P&gt;&lt;P&gt;&amp;nbsp; now_c10 = put(now, xyyyymmddhh.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; now1h = intnx("dthour", now, -1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; now_c101h = put(now1h, xyyyymmddhh.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; format now datetime22.3;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 20:59:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Date-Format-like-YYYYMMDDHH-for-the-previous-hour/m-p/139574#M28172</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2014-10-23T20:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Need Date Format like YYYYMMDDHH for the previous hour</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Date-Format-like-YYYYMMDDHH-for-the-previous-hour/m-p/139575#M28173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Bruno.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is definitely what I was looking for. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Olp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 21:38:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Date-Format-like-YYYYMMDDHH-for-the-previous-hour/m-p/139575#M28173</guid>
      <dc:creator>o_p</dc:creator>
      <dc:date>2014-10-23T21:38:10Z</dc:date>
    </item>
  </channel>
</rss>

