<?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: Remove ERROR generated from custom datetime format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Remove-ERROR-generated-from-custom-datetime-format/m-p/944423#M370028</link>
    <description>data example1;&lt;BR /&gt;input id dttm anydtdtm.;&lt;BR /&gt;format dttm datetime14.;&lt;BR /&gt;datalines;&lt;BR /&gt;100 31OCT27:23:15&lt;BR /&gt;101&lt;BR /&gt;102 3&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc format;&lt;BR /&gt;picture MyMSdt LOW-HIGH='%0m/%0d/%0Y %0H:%0M' (datatype=datetime)&lt;BR /&gt;other= "NULL";&lt;BR /&gt;run;&lt;BR /&gt;data example2;&lt;BR /&gt;set example1;&lt;BR /&gt;format dttm MyMSdt.;&lt;BR /&gt;run;&lt;BR /&gt;</description>
    <pubDate>Wed, 18 Sep 2024 14:09:10 GMT</pubDate>
    <dc:creator>salah1</dc:creator>
    <dc:date>2024-09-18T14:09:10Z</dc:date>
    <item>
      <title>Remove ERROR generated from custom datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-ERROR-generated-from-custom-datetime-format/m-p/944419#M370026</link>
      <description>&lt;P&gt;I am using a custom datetime format. I'm looking for a solution to remove "ERROR" when the format is applied and missing data exists.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data example1;
	input id dttm anydtdtm.; 
	format dttm datetime14.;  
	datalines;
100  31OCT27:23:15 
101
;
run;
proc format;
   picture MyMSdt other='%0m/%0d/%0Y %0H:%0M' (datatype=datetime);
run;
data example2;
	set example1;
	format dttm MyMSdt.;
run;
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 293px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100476iFCA068D3105BEBCB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 14:00:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-ERROR-generated-from-custom-datetime-format/m-p/944419#M370026</guid>
      <dc:creator>mmm7</dc:creator>
      <dc:date>2024-09-18T14:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ERROR generated from custom datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-ERROR-generated-from-custom-datetime-format/m-p/944421#M370027</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   picture MyMSdt other='%0m/%0d/%0Y %0H:%0M' (datatype=datetime);
   value mymsdtt .=' ' other=[mymsdt.];
run;
data example2;
	set example1;
	format dttm MyMSdtt.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Sep 2024 14:06:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-ERROR-generated-from-custom-datetime-format/m-p/944421#M370027</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-09-18T14:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ERROR generated from custom datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-ERROR-generated-from-custom-datetime-format/m-p/944423#M370028</link>
      <description>data example1;&lt;BR /&gt;input id dttm anydtdtm.;&lt;BR /&gt;format dttm datetime14.;&lt;BR /&gt;datalines;&lt;BR /&gt;100 31OCT27:23:15&lt;BR /&gt;101&lt;BR /&gt;102 3&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc format;&lt;BR /&gt;picture MyMSdt LOW-HIGH='%0m/%0d/%0Y %0H:%0M' (datatype=datetime)&lt;BR /&gt;other= "NULL";&lt;BR /&gt;run;&lt;BR /&gt;data example2;&lt;BR /&gt;set example1;&lt;BR /&gt;format dttm MyMSdt.;&lt;BR /&gt;run;&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Sep 2024 14:09:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-ERROR-generated-from-custom-datetime-format/m-p/944423#M370028</guid>
      <dc:creator>salah1</dc:creator>
      <dc:date>2024-09-18T14:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ERROR generated from custom datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-ERROR-generated-from-custom-datetime-format/m-p/944424#M370029</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;Thank you so much for your solution!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 14:09:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-ERROR-generated-from-custom-datetime-format/m-p/944424#M370029</guid>
      <dc:creator>mmm7</dc:creator>
      <dc:date>2024-09-18T14:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ERROR generated from custom datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-ERROR-generated-from-custom-datetime-format/m-p/944426#M370030</link>
      <description>&lt;P&gt;You could add missing values to your format, perhaps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   picture MyMSdt ._-.Z="Missing" other='%0m/%0d/%0Y %0H:%0M' (datatype=datetime);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Sep 2024 14:14:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-ERROR-generated-from-custom-datetime-format/m-p/944426#M370030</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-09-18T14:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ERROR generated from custom datetime format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-ERROR-generated-from-custom-datetime-format/m-p/944434#M370035</link>
      <description>&lt;P&gt;Or a minor change to your format definition:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc format;
   picture MyMSdt low-high='%0m/%0d/%0Y %0H:%0M' (datatype=datetime);
run;&lt;/PRE&gt;
&lt;P&gt;Which does not attempt to apply any formatting to missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More properly should use the earliest/latest SAS datetime values that are accepted but most people don't deal with dates that extreme.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 14:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-ERROR-generated-from-custom-datetime-format/m-p/944434#M370035</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-09-18T14:52:56Z</dc:date>
    </item>
  </channel>
</rss>

