title: SAS macro for date in dhms format
body: <p>I have two resolved macro variables:</p>
  
  <pre><code>&amp;beg is “01MAY2017”
  &amp;end is “31OCT2017”
  </code></pre>
  
  <p>I want to create new macro which will have date format <code>dhms</code></p>
  
  <p>I tried the below queries but I am getting Jan 1960 as the value:</p>
  
  <pre><code>%let start =%sysfunc(putn(&amp;beg, datetime20.));
  %let start1=%sysfunc(putn(&amp;end, datetime20.));
  </code></pre>
  
  <p>Below are the values I am getting:</p>
  
  <pre><code>01JAN1960:05:49:00
  01JAN1960:05:53:03
  </code></pre>
  
  <p>I want the result as <code>01MAY2017:00:00:00</code> and <code>31OCT2017:00:00:00</code></p>