<?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: SAS timestamp in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570527#M160887</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let start=20190501;

data _null_;
do i = input("&amp;amp;start.",yymmdd8.) to intnx('month',input("&amp;amp;start.",yymmdd8.),0,'e');
  timestamp = dhms(i,0,0,0);
  call execute('your code for import with' !! put(timestamp,b8601dt16.));
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 02 Jul 2019 12:48:22 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-07-02T12:48:22Z</dc:date>
    <item>
      <title>SAS timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570366#M160817</link>
      <description>&lt;P&gt;I need to create a SAS timestamp starting not with today() but starting with May 01, 2019. Please help if you can.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 19:40:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570366#M160817</guid>
      <dc:creator>mauri0623</dc:creator>
      <dc:date>2019-07-01T19:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570368#M160818</link>
      <description>&lt;P&gt;Where do you want that timestamp to go?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 19:40:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570368#M160818</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-07-01T19:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570379#M160820</link>
      <description>&lt;P&gt;So if I want it based on today I can use this code,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;call symputx('timestamp', put(datetime(), B8601DT.));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I want it to start with may 01, 2019 instead.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 20:01:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570379#M160820</guid>
      <dc:creator>mauri0623</dc:creator>
      <dc:date>2019-07-01T20:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: SAS timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570386#M160823</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181538"&gt;@mauri0623&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I need to create a SAS timestamp starting not with today() but starting with May 01, 2019. Please help if you can.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A single timestamp, or a series? If a series, what interval and over what range? If single, which time?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 20:30:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570386#M160823</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-07-01T20:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAS timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570397#M160829</link>
      <description>&lt;P&gt;So you want a datetime value for the date 01MAY2019?&amp;nbsp; What time during that day? Why that day? Do you really need it in a macro variable? Why? How are you going to use the macro variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want to make a macro variable that has a string in B8601DT. style format for some time on the first of may 2019 then why not just type to value directly?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let TIMESTAMP=20190501T000000 ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 21:50:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570397#M160829</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-01T21:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570407#M160832</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
	timestamp1=DHMS("01MAY2019"d,9,23,45);
	timestamp2=DHMS("01MAY2019"d,hour(time()),minute(time()),second(time()));
	format timestamp: datetime.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Get familiar with this page:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000245860.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000245860.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't have to memorize all of them - I certainly haven't - but know that this resource is here, and try to learn the functions you will likely use the most.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 23:16:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570407#M160832</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-07-01T23:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570520#M160883</link>
      <description>&lt;P&gt;I guess I need to explain this a bit better, We receive files on a daily basis going forward. No problem with going forward with creating a timestamp. Problem is that the files we have for the month of May did not come in on a daily basis and we are in need of creating a timestamp for the May 01 through May 31. We need the timestamp as part of the naming convention for the SAS dataset that we are creating. So in fact I need a daily timestamp for the entire month of May by assuming that the data was received on a daily basis for the month of may. May 01, 2019 - May 31, 2019.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-mauri&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 12:38:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570520#M160883</guid>
      <dc:creator>mauri0623</dc:creator>
      <dc:date>2019-07-02T12:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570527#M160887</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let start=20190501;

data _null_;
do i = input("&amp;amp;start.",yymmdd8.) to intnx('month',input("&amp;amp;start.",yymmdd8.),0,'e');
  timestamp = dhms(i,0,0,0);
  call execute('your code for import with' !! put(timestamp,b8601dt16.));
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Jul 2019 12:48:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570527#M160887</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-07-02T12:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570531#M160891</link>
      <description>&lt;P&gt;datetime() returns the current system datetime as count of seconds since 1/1/1960&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A string in the form of 'ddmonyyyy h24:mm:ss'dt also returns the count of seconds since 1/1/1960 for the string in the quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below sample code showcases the concept.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  do dttm='01May2019 00:00:00'dt to '31May2019 00:00:00'dt by 86400;
    put dttm B8601DT.;
  end;
  stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Jul 2019 12:54:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570531#M160891</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-07-02T12:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: SAS timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570536#M160895</link>
      <description>&lt;P&gt;It sounds like you are saying the actual goal is to rename some SAS datasets that you already have.&lt;/P&gt;
&lt;P&gt;How are they named now?&lt;/P&gt;
&lt;P&gt;What names do you want them to have when the process is done.&lt;/P&gt;
&lt;P&gt;For 31 files why don't you just do it by hand?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 12:58:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570536#M160895</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-02T12:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS timestamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570779#M160985</link>
      <description>&lt;P&gt;I answered your question as you originally posted.&amp;nbsp; I'll leave it to others to answer your new question.&amp;nbsp; Or perhaps you can modify what I posted to suit your actual requirements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good questions == good answers.&amp;nbsp; The reverse is also true.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 00:09:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-timestamp/m-p/570779#M160985</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-07-03T00:09:26Z</dc:date>
    </item>
  </channel>
</rss>

