<?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: changing date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/changing-date/m-p/624277#M183886</link>
    <description>&lt;P&gt;So you want to subtract two weeks? When you need to shift a date by a given amount of a given interval, the intnx() function is the tool of choice.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Feb 2020 18:33:31 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-02-12T18:33:31Z</dc:date>
    <item>
      <title>changing date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/changing-date/m-p/624268#M183880</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a date value under variable named DATETX like 03/13/2019 and i would like to change that date to 02/27/219. the date value now is MMDDYY10.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 18:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/changing-date/m-p/624268#M183880</guid>
      <dc:creator>Dhana18</dc:creator>
      <dc:date>2020-02-12T18:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: changing date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/changing-date/m-p/624272#M183882</link>
      <description>&lt;P&gt;Where does 219 come from?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 18:16:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/changing-date/m-p/624272#M183882</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-02-12T18:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: changing date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/changing-date/m-p/624276#M183885</link>
      <description>&lt;P&gt;Sometimes I like to find the integer for the date, and then I use the data step to change the value of a date. E.g., I would use the following step to find the number and then do something like 'if datetx = 21621 then datetx=21607' in a data step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
input date  MMDDYY10.  ;
putlog _all_; /*this prints the integer values to the log*/
cards;
03/13/2019 
02/27/2019
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Feb 2020 18:28:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/changing-date/m-p/624276#M183885</guid>
      <dc:creator>svh</dc:creator>
      <dc:date>2020-02-12T18:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: changing date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/changing-date/m-p/624277#M183886</link>
      <description>&lt;P&gt;So you want to subtract two weeks? When you need to shift a date by a given amount of a given interval, the intnx() function is the tool of choice.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 18:33:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/changing-date/m-p/624277#M183886</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-02-12T18:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: changing date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/changing-date/m-p/624291#M183892</link>
      <description>&lt;P&gt;Nope, I have a missing treatment info on 03/13/2019 and I found treatment info on another date 02/27/2019 so I wanted to do some thing like if id="123" then Datetx(treatment date) is 02/27/2019.&lt;/P&gt;&lt;P&gt;I tried &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;IF&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; cl_eventid=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"3716489"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; datetx="&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;27&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;Aug&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2019"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;d;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;it did not give me an error in log but when I proc print the result was not like how I wanted &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;it was like this&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;cl_eventid Datetx&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;3716489&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21788&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 18:51:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/changing-date/m-p/624291#M183892</guid>
      <dc:creator>Dhana18</dc:creator>
      <dc:date>2020-02-12T18:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: changing date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/changing-date/m-p/624296#M183895</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/212762"&gt;@Dhana18&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Nope, I have a missing treatment info on 03/13/2019 and I found treatment info on another date 02/27/2019 so I wanted to do some thing like if id="123" then Datetx(treatment date) is 02/27/2019.&lt;/P&gt;
&lt;P&gt;I tried &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;IF&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; cl_eventid=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"3716489"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; datetx="&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;27&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;Aug&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2019"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;d;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;it did not give me an error in log but when I proc print the result was not like how I wanted &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;it was like this&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;cl_eventid Datetx&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;3716489&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21788&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You need to apply a date format to a SAS date value to display properly. Such as DATE9. or MMDDYY10.&lt;/P&gt;
&lt;P&gt;If you do not have a default date format assigned and do not specify one in Proc Print then Print will default to BEST.&lt;/P&gt;
&lt;P&gt;Try adding&lt;/P&gt;
&lt;P&gt;foramt datetx mmddyy10. ;&lt;/P&gt;
&lt;P&gt;to your proc print code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If other values are displaying as you want but do not have a date format applied then likely you have a number that only resembles a date and more work is needed.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 18:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/changing-date/m-p/624296#M183895</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-02-12T18:56:15Z</dc:date>
    </item>
  </channel>
</rss>

