<?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: change date format to a sasdate in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/300885#M17002</link>
    <description>&lt;P&gt;Nvmd.&amp;nbsp; I just answered my own question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just did a simple substraction to make my like easier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;BR /&gt;set exp.fy09;&lt;BR /&gt;date=encdate1-'01jan1960'd;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Sep 2016 22:00:14 GMT</pubDate>
    <dc:creator>jenim514</dc:creator>
    <dc:date>2016-09-26T22:00:14Z</dc:date>
    <item>
      <title>change date format to a sasdate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/300879#M16998</link>
      <description>&lt;P&gt;Hi!&amp;nbsp; How do i change a variable (X) with a date format mmddyy10. to a SAS date?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 21:39:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/300879#M16998</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2016-09-26T21:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: change date format to a sasdate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/300882#M17000</link>
      <description>&lt;P&gt;Are you sure that your current variable is not a SAS date? Run proc contents or examime the column properties. If the format is mmddyy10. then it is already a SAS date variable.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 21:47:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/300882#M17000</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-26T21:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: change date format to a sasdate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/300883#M17001</link>
      <description>&lt;P&gt;Sorry, let me clarify.&amp;nbsp; The variable is a SAS formatted date, but I want to change it to the numeric digits that calculates from 1960&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 21:50:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/300883#M17001</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2016-09-26T21:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: change date format to a sasdate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/300885#M17002</link>
      <description>&lt;P&gt;Nvmd.&amp;nbsp; I just answered my own question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just did a simple substraction to make my like easier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test;&lt;BR /&gt;set exp.fy09;&lt;BR /&gt;date=encdate1-'01jan1960'd;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 22:00:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/300885#M17002</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2016-09-26T22:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: change date format to a sasdate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/300888#M17003</link>
      <description>&lt;P&gt;Even easier: Change the format to best8. or similar.&lt;/P&gt;
&lt;P&gt;You don't need to change anything in the actual data you could just apply the format in what ever procedure, such as proc print.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 22:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/300888#M17003</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-26T22:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: change date format to a sasdate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/300897#M17004</link>
      <description>&lt;P&gt;Here's another way to look at it. &amp;nbsp;You just subtracted zero ('01Jan1960'd) from your variable, and came up with the right number. &amp;nbsp;Surely your original variable must have contained the right number to begin with ... it's just that you couldn't see it because of the format.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2016 00:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/300897#M17004</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-27T00:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: change date format to a sasdate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/300926#M17011</link>
      <description>&lt;P&gt;For display or output, you can do this in a data step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put x best.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That saves doing the conversion and creating another variable.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2016 06:04:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/300926#M17011</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-27T06:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: change date format to a sasdate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/301049#M17014</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding﻿&lt;/a&gt; Ok, but how do you remove the date format to just dispaly the number (w/o doing the subtraction)?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2016 15:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/301049#M17014</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2016-09-27T15:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: change date format to a sasdate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/301056#M17015</link>
      <description>&lt;P&gt;That is waht the FORMAT statement does. You can change the format permanently attached in the data set by using the FORMAT statement in a data step (or by using PROC DATASETS to modify an existing data step).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you can just add the FORMAT statement to the proc you are using to look at the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc means ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var mydate;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; format mydate ;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2016 15:31:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/301056#M17015</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-09-27T15:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: change date format to a sasdate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/301063#M17016</link>
      <description>&lt;P&gt;There are a few variations involved in your question. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are just using the date in calculations in a DATA step, you don't need to remove the format. &amp;nbsp;Even if these variables are formatted, the calculation works:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;duration = date_end - date_start;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are printing the date and want to see the unformatted date, add a FORMAT statement to the PROC PRINT:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;format x;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's the general way to remove a format from a variable. &amp;nbsp;If you remove the format within a SAS procedure, that's a temporary change for that procedure only. &amp;nbsp;If you remove the format in a DATA step, the change is permanent. &amp;nbsp;And as Tom mentioned, you can use PROC DATASETS instead of a DATA step to add or remove a format assignment. &amp;nbsp;That would run quickly and would save the time it takes the DATA step to run.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2016 16:10:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/change-date-format-to-a-sasdate/m-p/301063#M17016</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-27T16:10:16Z</dc:date>
    </item>
  </channel>
</rss>

