<?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 data format in dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-data-format-in-dataset/m-p/814011#M321303</link>
    <description>&lt;P&gt;Datetimes and times are counts of seconds in SAS, while dates are counts of days; so datetime = date * 86400.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Always keep this in mind when working with such values.&lt;/P&gt;
&lt;P&gt;The functions you need for the conversions are&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;DATEPART - extracts the date from a datetime&lt;/LI&gt;
&lt;LI&gt;TIMEPART - extracts the time from a datetime&lt;/LI&gt;
&lt;LI&gt;DHMS - builds a datetime from a date, hours, minutes and seconds; to build a datetime from a date and a time, use DHMS(date,0,0,time)&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Wed, 18 May 2022 08:57:49 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-05-18T08:57:49Z</dc:date>
    <item>
      <title>Change data format in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-data-format-in-dataset/m-p/814007#M321301</link>
      <description>&lt;P&gt;Hi everyone, I have a problem. I wanted to change the date format from as shown in the picture.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gieorgie_0-1652862519878.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71597iDD652DC877207EBC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gieorgie_0-1652862519878.png" alt="Gieorgie_0-1652862519878.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;to this.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gieorgie_1-1652862572791.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71598i4E30309C3B1F2FA6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gieorgie_1-1652862572791.png" alt="Gieorgie_1-1652862572791.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, after using the format function, I get something like this. Why ? how to fix it&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gieorgie_2-1652862723106.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71599iF89C0F5072E25F0E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gieorgie_2-1652862723106.png" alt="Gieorgie_2-1652862723106.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;my code:&lt;/P&gt;
&lt;PRE&gt;data pap_wart;
set bmd.pap_wart_spr_202203;
keep kod_isin;
keep WBIL_BRUTTO_PLN;
keep WYCENA_ROZNICA_PLN;
keep data_emisji;
keep data_zap;
format data_zap yymmdd10.;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 May 2022 08:36:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-data-format-in-dataset/m-p/814007#M321301</guid>
      <dc:creator>Gieorgie</dc:creator>
      <dc:date>2022-05-18T08:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Change data format in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-data-format-in-dataset/m-p/814009#M321302</link>
      <description>&lt;P&gt;how about this code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data pap_wart;
  set bmd.pap_wart_spr_202203;
  keep kod_isin
       WBIL_BRUTTO_PLN
       WYCENA_ROZNICA_PLN
       data_emisji
       data_zap;
  data_zap=datepart(data_zap); // &amp;lt;-insert
  format data_zap yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 May 2022 08:48:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-data-format-in-dataset/m-p/814009#M321302</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2022-05-18T08:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Change data format in dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-data-format-in-dataset/m-p/814011#M321303</link>
      <description>&lt;P&gt;Datetimes and times are counts of seconds in SAS, while dates are counts of days; so datetime = date * 86400.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Always keep this in mind when working with such values.&lt;/P&gt;
&lt;P&gt;The functions you need for the conversions are&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;DATEPART - extracts the date from a datetime&lt;/LI&gt;
&lt;LI&gt;TIMEPART - extracts the time from a datetime&lt;/LI&gt;
&lt;LI&gt;DHMS - builds a datetime from a date, hours, minutes and seconds; to build a datetime from a date and a time, use DHMS(date,0,0,time)&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 18 May 2022 08:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-data-format-in-dataset/m-p/814011#M321303</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-05-18T08:57:49Z</dc:date>
    </item>
  </channel>
</rss>

