<?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: Recoding Date using Query Builder in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523478#M16205</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252533"&gt;@Kaiyyum02&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi I'm actually a new user to SAS Enterprise Guide. My issue here is that I wanted to change my dates that is 01JAN2012&lt;/P&gt;
&lt;P&gt;to 01JAN2017 using Query Builder. I tried recoding through using query builder but it just doesn't seem to work. Anyone knows any functions that I can use to soleve this? Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Use the intnx() function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newdate = intnx('year',olddate,5);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 25 Dec 2018 17:08:52 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-12-25T17:08:52Z</dc:date>
    <item>
      <title>Recoding Date using Query Builder</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523476#M16203</link>
      <description>&lt;P&gt;Hi I'm actually a new user to SAS Enterprise Guide. My issue here is that I wanted to change my dates that is 01JAN2012&lt;/P&gt;&lt;P&gt;to 01JAN2017 using Query Builder. I tried recoding through using query builder but it just doesn't seem to work. Anyone knows any functions that I can use to soleve this? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Dec 2018 16:33:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523476#M16203</guid>
      <dc:creator>Kaiyyum02</dc:creator>
      <dc:date>2018-12-25T16:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding Date using Query Builder</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523477#M16204</link>
      <description>&lt;P&gt;Are you always adding 5 years to the date?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Dec 2018 16:49:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523477#M16204</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-12-25T16:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding Date using Query Builder</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523478#M16205</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252533"&gt;@Kaiyyum02&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi I'm actually a new user to SAS Enterprise Guide. My issue here is that I wanted to change my dates that is 01JAN2012&lt;/P&gt;
&lt;P&gt;to 01JAN2017 using Query Builder. I tried recoding through using query builder but it just doesn't seem to work. Anyone knows any functions that I can use to soleve this? Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Use the intnx() function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newdate = intnx('year',olddate,5);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Dec 2018 17:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523478#M16205</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-25T17:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding Date using Query Builder</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523501#M16206</link>
      <description>&lt;P&gt;INTNX()&lt;/P&gt;
&lt;P&gt;SUM()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS dates are stored as numbers, which means you can just add values to increment. However, since months and years do not have a standard amount of days, INTNX() is more useful to increment a date. Keep an eye on the fourth&amp;nbsp;parameter which will allows you to align a date to the start, end or specific day of the month.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252533"&gt;@Kaiyyum02&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi I'm actually a new user to SAS Enterprise Guide. My issue here is that I wanted to change my dates that is 01JAN2012&lt;/P&gt;
&lt;P&gt;to 01JAN2017 using Query Builder. I tried recoding through using query builder but it just doesn't seem to work. Anyone knows any functions that I can use to soleve this? Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Dec 2018 19:53:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523501#M16206</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-25T19:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding Date using Query Builder</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523512#M16207</link>
      <description>&lt;P&gt;Yes I need to add 5 years to it&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2018 00:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523512#M16207</guid>
      <dc:creator>Kaiyyum02</dc:creator>
      <dc:date>2018-12-26T00:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding Date using Query Builder</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523514#M16208</link>
      <description>&lt;P&gt;Hi, thanks for replying but actually I need to change all of the dates that are in this column . There are different dates in this row of mine but all of the YEAR from the dates in this row is 2012 and I need to change all of it to 2017 and that they are in the same column. How do I do this? Ouh and by the way I've tried out the expression that you gave but it gave the value as 01JAN1960 instead as stated in CAPTURE02 of the file I attached.How do I do this?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2018 00:48:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523514#M16208</guid>
      <dc:creator>Kaiyyum02</dc:creator>
      <dc:date>2018-12-26T00:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding Date using Query Builder</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523515#M16209</link>
      <description>&lt;P&gt;Thanks for replying. I've attached a screenshot of the outcome of the FUNCTION that you recommend to use but actually I need to convert the YEAR of all of the dates that are in this column. There are different dates in this column but the YEAR of all the dates in this column are 2012. I need to change the YEAR of all the dates into 2017 so how do I do this? When I use the FUNCTION that you recommend which is INTNX() SAS gave out the value of 01JAN1960 instead. The INTNX function can only add values to a single particular date at a time right? May I ask if the function can be used on multiple dates at one time and if so, can you tell me how to type out the expression to do so. If not, then what other alternatives are there?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2018 01:01:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523515#M16209</guid>
      <dc:creator>Kaiyyum02</dc:creator>
      <dc:date>2018-12-26T01:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding Date using Query Builder</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523528#M16211</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252533"&gt;@Kaiyyum02&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for replying. I've attached a screenshot of the outcome of the FUNCTION that you recommend to use but actually I need to convert the YEAR of all of the dates that are in this column. There are different dates in this column but the YEAR of all the dates in this column are 2012. I need to change the YEAR of all the dates into 2017 so how do I do this? When I use the FUNCTION that you recommend which is INTNX() SAS gave out the value of 01JAN1960 instead. The INTNX function can only add values to a single particular date at a time right? May I ask if the function can be used on multiple dates at one time and if so, can you tell me how to type out the expression to do so. If not, then what other alternatives are there?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Read the log (Maxim 2) and look for unusual messages like type conversions, invalid values etc.&lt;/P&gt;
&lt;P&gt;For detailed help, post example data in usable form (data step with datalines, see my footnotes), so we can write code for it.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2018 08:06:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523528#M16211</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-26T08:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding Date using Query Builder</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523561#M16219</link>
      <description>&lt;P&gt;One thing we need to figure out is what style your date is. SAS has two "date-like" storage mechanisms; one is number of days, and one is number of seconds. The functions and formats need to be used taking this into account.&lt;/P&gt;
&lt;P&gt;Set up a new query on your table, and include only your date column. Include it three times. On the first, use a format of&lt;/P&gt;
&lt;P&gt;best15.&lt;/P&gt;
&lt;P&gt;On the second, use a format of&lt;/P&gt;
&lt;P&gt;date.&lt;/P&gt;
&lt;P&gt;On the third, use a format of&lt;/P&gt;
&lt;P&gt;datetime.&lt;/P&gt;
&lt;P&gt;Post a few lines of the result, and we'll know what your data is.&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2018 17:25:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Recoding-Date-using-Query-Builder/m-p/523561#M16219</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2018-12-26T17:25:47Z</dc:date>
    </item>
  </channel>
</rss>

