<?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: Convert a number to date in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290575#M19835</link>
    <description>&lt;P&gt;You're missing a letter in the format name. It's yymmdd8. not yymmd8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
    <pubDate>Tue, 09 Aug 2016 20:59:18 GMT</pubDate>
    <dc:creator>TomKari</dc:creator>
    <dc:date>2016-08-09T20:59:18Z</dc:date>
    <item>
      <title>Convert a number to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290536#M19828</link>
      <description>&lt;P&gt;Hello, I&amp;nbsp;am trying to do a&amp;nbsp;report with&amp;nbsp;Month over month% change.&amp;nbsp;Our date field is a&amp;nbsp;numeric field i.e&amp;nbsp;for example has value 20160501. I need to get priormonth same day and compare counts . I am trying to do this in sas enterprise guide. What is the function I should use to get priormonth day value out of this field? Any help is much appreciated&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 18:25:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290536#M19828</guid>
      <dc:creator>Anirudh1</dc:creator>
      <dc:date>2016-08-09T18:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a number to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290542#M19829</link>
      <description>&lt;P&gt;Use the INTNX function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;intnx('month', yourVariable, -1, 'same');&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;will return the same day in the previous month (-1)&lt;/P&gt;&lt;P&gt;Use 'b' or 'e' to return the beginning or end day of the previous month, respectively.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/INTNX" target="_self"&gt;More information and examples&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 19:04:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290542#M19829</guid>
      <dc:creator>paulkaefer</dc:creator>
      <dc:date>2016-08-09T19:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a number to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290544#M19830</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
date = input(put(numdate,8.),yymmdd8.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Aug 2016 19:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290544#M19830</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-08-09T19:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a number to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290559#M19832</link>
      <description>&lt;P&gt;I'm assuming you're asking how to find the record that is a year before, not just the date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to provide your data structure, what you want as output and ideally, if you're using the GUI in EG or coding.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post data as text, NOT as an image.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 19:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290559#M19832</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-09T19:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a number to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290563#M19833</link>
      <description>&lt;P&gt;First thing when looking at manipulating dates is to start with a SAS date valued variable. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser﻿&lt;/a&gt;&amp;nbsp;shows how to convert your number to a SAS date value.&lt;/P&gt;
&lt;P&gt;Then you can use a number of SAS functions to either increment a date, INTNX or examine the different number of time periods between two dates (or time or datetimes) with INTCK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would likely want to look a a new date of a given interval.&lt;/P&gt;
&lt;P&gt;Priormonth = INTNX('month',date,-1,'same');&lt;/P&gt;
&lt;P&gt;That says to create a new date value that is one month before the value of date for the same day of the month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to compare counts would require much more knowledge about the structure of your current data set and how you are counting. You might be better off posting some example input data and the desired result.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 19:53:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290563#M19833</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-08-09T19:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a number to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290574#M19834</link>
      <description>&lt;P&gt;Thank you all for your responses !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using GUI in the SAS EG. If I can get the prior month date value then I know how to get the record and do the comparsion...Here is what I have. I have a booking date which is a number and I think the input function posted by KurtBremser I converted to date and the next step was to get prior month same day but I am getting a blank...I am not sure what I am doing wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for helping me out !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;BOOKING_DT&lt;/TD&gt;&lt;TD&gt;put(t1.BOOKING_DT,8.)&lt;/TD&gt;&lt;TD&gt;input((put(t1.BOOKING_DT,8.)),yymmd8.)&lt;/TD&gt;&lt;TD&gt;intnx('month',(input((put(t1.BOOKING_DT,8.)),yymmd8.)),-1,'same')&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20140717&lt;/TD&gt;&lt;TD&gt;20140717&lt;/TD&gt;&lt;TD&gt;20140717&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20140808&lt;/TD&gt;&lt;TD&gt;20140808&lt;/TD&gt;&lt;TD&gt;20140808&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20140904&lt;/TD&gt;&lt;TD&gt;20140904&lt;/TD&gt;&lt;TD&gt;20140904&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20140910&lt;/TD&gt;&lt;TD&gt;20140910&lt;/TD&gt;&lt;TD&gt;20140910&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20140918&lt;/TD&gt;&lt;TD&gt;20140918&lt;/TD&gt;&lt;TD&gt;20140918&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20141013&lt;/TD&gt;&lt;TD&gt;20141013&lt;/TD&gt;&lt;TD&gt;20141013&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20141107&lt;/TD&gt;&lt;TD&gt;20141107&lt;/TD&gt;&lt;TD&gt;20141107&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 09 Aug 2016 20:49:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290574#M19834</guid>
      <dc:creator>Anirudh1</dc:creator>
      <dc:date>2016-08-09T20:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a number to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290575#M19835</link>
      <description>&lt;P&gt;You're missing a letter in the format name. It's yymmdd8. not yymmd8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 20:59:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290575#M19835</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2016-08-09T20:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a number to date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290681#M19848</link>
      <description>&lt;P&gt;Thank you !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 12:12:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-a-number-to-date/m-p/290681#M19848</guid>
      <dc:creator>Anirudh1</dc:creator>
      <dc:date>2016-08-10T12:12:19Z</dc:date>
    </item>
  </channel>
</rss>

