<?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 Datetimes format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Datetimes-format/m-p/976419#M378317</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to display my data as 2025100513 (yyyymmddtt). My code seems do not work and I can not find the right format here : &lt;A href="https://documentation.sas.com/doc/en/leforinforref/3.2/p1a0qt18rxydrkn1b0rtdfh2t8zs.htm" target="_blank"&gt;SAS Help Center: Working with Dates and Times By Using the ISO 8601 Basic and Extended Notations.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I have this error message :&amp;nbsp;&amp;nbsp;ERROR: Format name B8601DT10.0 not found or the width and/or decimal specified for the format used are out of range.&amp;nbsp;Thank you for your help.&lt;/P&gt;
&lt;P&gt;This my code :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let Ma_Date=%sysfunc(compress(%sysfunc(datetime(),B8601DT10.0),T));&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 05 Oct 2025 11:36:28 GMT</pubDate>
    <dc:creator>SASdevAnneMarie</dc:creator>
    <dc:date>2025-10-05T11:36:28Z</dc:date>
    <item>
      <title>Datetimes format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Datetimes-format/m-p/976419#M378317</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to display my data as 2025100513 (yyyymmddtt). My code seems do not work and I can not find the right format here : &lt;A href="https://documentation.sas.com/doc/en/leforinforref/3.2/p1a0qt18rxydrkn1b0rtdfh2t8zs.htm" target="_blank"&gt;SAS Help Center: Working with Dates and Times By Using the ISO 8601 Basic and Extended Notations.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I have this error message :&amp;nbsp;&amp;nbsp;ERROR: Format name B8601DT10.0 not found or the width and/or decimal specified for the format used are out of range.&amp;nbsp;Thank you for your help.&lt;/P&gt;
&lt;P&gt;This my code :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let Ma_Date=%sysfunc(compress(%sysfunc(datetime(),B8601DT10.0),T));&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Oct 2025 11:36:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Datetimes-format/m-p/976419#M378317</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2025-10-05T11:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Datetimes format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Datetimes-format/m-p/976426#M378324</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to display my data as 2025100513 (yyyymmddtt). My code seems do not work and I can not find the right format here : &lt;A href="https://documentation.sas.com/doc/en/leforinforref/3.2/p1a0qt18rxydrkn1b0rtdfh2t8zs.htm" target="_blank" rel="noopener"&gt;SAS Help Center: Working with Dates and Times By Using the ISO 8601 Basic and Extended Notations.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I have this error message :&amp;nbsp;&amp;nbsp;ERROR: Format name B8601DT10.0 not found or the width and/or decimal specified for the format used are out of range.&amp;nbsp;Thank you for your help.&lt;/P&gt;
&lt;P&gt;This my code :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let Ma_Date=%sysfunc(compress(%sysfunc(datetime(),B8601DT10.0),T));&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It is telling you that the format you have chosen is not wide enough. &lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/leforinforref/n1vfxvbhrvzahjn1iciq1vruyc9d.htm" target="_self"&gt;B8501DT must have a width&lt;/A&gt; of between 15 and 26. So this works:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let Ma_Date=%sysfunc(putn(%sysfunc(datetime()),B8601DT15.0));
%put &amp;amp;=ma_date;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't want the minutes and seconds in the output, you can use the %substr function to chop off the last 4 unwanted digits.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Oct 2025 16:00:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Datetimes-format/m-p/976426#M378324</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-10-05T16:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Datetimes format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Datetimes-format/m-p/976427#M378325</link>
      <description>&lt;P&gt;Maxim 1: Read the Documentation.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n1vfxvbhrvzahjn1iciq1vruyc9d.htm" target="_blank" rel="noopener"&gt;B8601DTw.d Format&lt;/A&gt;&amp;nbsp;:&lt;/P&gt;
&lt;H4 class="xisDoc-argument"&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;w&lt;/EM&gt;&lt;/H4&gt;
&lt;DIV class="xisDoc-argumentDescription"&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;specifies the width of the output field.&lt;/P&gt;
&lt;SECTION class="xisDoc-tableWrap"&gt;
&lt;TABLE class="xisDoc-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="xisDoc-summaryDefault"&gt;Default&lt;/TH&gt;
&lt;TD class="xisDoc-summaryText"&gt;19&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="xisDoc-summaryRange"&gt;Range&lt;/TH&gt;
&lt;TD class="xisDoc-summaryText"&gt;15–26&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you can't use this format with a length of 10.&lt;/P&gt;
&lt;P&gt;Roll your own custom format with PROC FORMAT:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
picture ymdh 
  low-high = '%Y%0m%0d%0H' (datatype=datetime)
;
run;

data _null_;
x = datetime();
put x= ymdh10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/SECTION&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 05 Oct 2025 16:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Datetimes-format/m-p/976427#M378325</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-10-05T16:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Datetimes format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Datetimes-format/m-p/976430#M378328</link>
      <description>Thank you !</description>
      <pubDate>Sun, 05 Oct 2025 16:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Datetimes-format/m-p/976430#M378328</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2025-10-05T16:27:56Z</dc:date>
    </item>
  </channel>
</rss>

