<?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: Determine if a variable contains a SAS date value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154863#M30359</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't understand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Feb 2015 11:06:35 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2015-02-06T11:06:35Z</dc:date>
    <item>
      <title>Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154851#M30347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to implement a process which is able to determine if a numeric SAS variable contains a date, datetime or time value based on the format assigned to this variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far I can only think of creating a list of known "out-of-the-box" SAS formats and then compare this list with the format assigned to the SAS variable. But that's not future proof and later versions of SAS could have additional formats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a more direct way to achieve what I need? Let's say some "IsADate()" function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is not possible and I have to go for the list approach: Does anyone know if and where there would be a location in the SAS docu with ALL date, time &amp;amp; datetime formats (also all the national ones like eurdfdd.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;8 February 2015&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I will now close this thread that it doesn't get too messy. I've posted a follow-up question here &lt;A __default_attr="251016" __jive_macro_name="message" class="jive_macro jive_macro_message" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I was hoping for some hidden gem but it appears there is none and I have to do the hard work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 12:17:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154851#M30347</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-02-05T12:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154852#M30348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Patrick Matter ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Is there a more direct way to achieve what I need? Let's say some "IsADate()" function?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;No. There is not such function in SAS ,but you can ask SAS to create a one , You know where to require ? &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;SAS unlike Oracle DB2 , they all have their own date type variable,Like :&lt;/P&gt;&lt;P&gt;create table have&lt;/P&gt;&lt;P&gt;date&amp;nbsp;&amp;nbsp; datetime12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you can't judge if the integer variable is a date or not .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;If this is not possible and I have to go for the list approach: Does anyone know if and where there would be a location in the SAS docu with ALL date, time &amp;amp; datetime formats (also all the national ones like eurdfdd.)&lt;/P&gt;
&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you know where to find them , since you are already out there .&lt;/P&gt;&lt;P&gt;For SAS9.2 , you can find them at here:&lt;/P&gt;&lt;P&gt;Language Reference Dictionary --&amp;nbsp; lrdict.pdf&lt;/P&gt;&lt;P&gt;National Language Support -- nlsref.pdf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Luck.&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: xia keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 13:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154852#M30348</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-02-05T13:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154853#M30349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, maybe I am missing the point, but if you query SASHELP.VCOLUMN, that will tell you if the format is a date/datetime no?&amp;nbsp; Or are you trying to avoid typing the few date/datetime combinations in as a list, in which case check for those numeric variables which have a non-numeric in their format column.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 13:14:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154853#M30349</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-02-05T13:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154854#M30350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dictionary.formats should contain the list of all format that your SAS has access to.&amp;nbsp; Unfortunately I don't see how to figure which are date formats from the variables.&amp;nbsp; Perhaps you can build a table by mining the list.&amp;nbsp; Something this might get you started.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;36&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;37&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data _null_;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;38&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.vformat(keep=fmtname fmttype source minw mind maxw maxd defw defd );&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;39&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where fmttype eq &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'F'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; and fmtname ne: &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'$'&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;40&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length value $&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;64&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;41&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = putn(&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;,fmtname);&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;42&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'NOTE: '&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; (fmtname value)(=);&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;43&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;NOTE: fmtname=AFRDFDD value=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;01.01.60&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;NOTE: fmtname=AFRDFDE value=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;01&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Jan60&lt;BR /&gt;NOTE: fmtname=AFRDFDN value=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;5&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;NOTE: fmtname=AFRDFDT value=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;01&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Jan60:&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;00&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;:&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;00&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;:&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;00&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;NOTE: fmtname=AFRDFDWN value=Vrydag&lt;BR /&gt;NOTE: fmtname=AFRDFMN value=Januarie&lt;BR /&gt;NOTE: fmtname=AFRDFMY value=Jan60&lt;BR /&gt;NOTE: fmtname=AFRDFWDX value=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; Januarie &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1960&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;NOTE: fmtname=AFRDFWKX value=Vrydag, &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; Januarie &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1960&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;NOTE: fmtname=B8601DA value=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;19600101&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;NOTE: fmtname=B8601DN value=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;19600101&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;NOTE: fmtname=B8601DT value=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;19600101&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;T000000&lt;BR /&gt;NOTE: fmtname=B8601DZ value=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;19600101&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;T000000+&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0000&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;NOTE: fmtname=B8601LZ value=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;000000&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;-&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0800&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;NOTE: fmtname=B8601TM value=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;000000&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;NOTE: fmtname=B8601TZ value=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;000000&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;+&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0000&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;NOTE: fmtname=BEST value=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;NOTE: fmtname=BESTD value=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;NOTE: fmtname=BESTX value=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 14:31:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154854#M30350</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-02-05T14:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154855#M30351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Querying SASHELP.VCOLUMN will give me the format name but not tell me if this is a date related format or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 21:41:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154855#M30351</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-02-05T21:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154856#M30352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could try sticking the value into the anydtdte format and see if it returns a non-null value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; dates;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; dte = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'6feb2015'&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; input(compress(dte), &lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;anydtdte.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;) ^= &lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 22:10:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154856#M30352</guid>
      <dc:creator>JohnT</dc:creator>
      <dc:date>2015-02-05T22:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154857#M30353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks data_null_. That's a better starting point than trying to collect the formats from the docu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 03:27:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154857#M30353</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-02-06T03:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154858#M30354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's not the problem I need to solve. I'm having a data set with variables of which I try to figure out which ones have a date format assigned - and this must work for any source data set as I want to implement this as a re-usable bit of code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 03:30:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154858#M30354</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-02-06T03:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154859#M30355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's the list of Date/Time by Category from SAS 9.4. AFAIK every SAS version has a version of this. There's also the ISO 8601 list. &lt;/P&gt;&lt;P&gt;But you can apply a date/time format to a variable that's not a date/time &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/leforinforref/64790/HTML/default/viewer.htm#n0p2fmevfgj470n17h4k9f27qjag.htm" title="http://support.sas.com/documentation/cdl/en/leforinforref/64790/HTML/default/viewer.htm#n0p2fmevfgj470n17h4k9f27qjag.htm"&gt;SAS(R) 9.4 Formats and Informats: Reference&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 03:36:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154859#M30355</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-06T03:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154860#M30356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt;But you can't include all the date format like National Date Formate (Patrick has pointed it out) .i.e.&amp;nbsp; nldate.&amp;nbsp; nldatetime. &lt;/P&gt;&lt;P&gt;They are all depend on the encoding of SAS session which is EN or CN...... other from different countries. &lt;/P&gt;&lt;P&gt;It is really hard for SAS . So I suggest sponsoring a VOTE for creating such function isDate() isDateTime() .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 06:06:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154860#M30356</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-02-06T06:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154861#M30357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No. That couldn't include all the scenario either . Like &lt;/P&gt;&lt;P&gt;31012015&amp;nbsp;&amp;nbsp; 01312015 ..........&lt;/P&gt;&lt;P&gt;They are varying at different time . and more important thing is if you create a customize date format via proc format + picture ,&lt;/P&gt;&lt;P&gt;it is more hard to judge if it is a date variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 06:09:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154861#M30357</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-02-06T06:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154862#M30358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So my question back would be - how will you tell if the format applied to the column is date?&amp;nbsp; As the format name is just text, e.g. date9,e8601dt what logical assignment can you give to identify the two in the previous example as dates?&amp;nbsp; The reason behind this is that dates don't really exist, they are just numbers, so the column is a numeric.&amp;nbsp; It may have a "picture" associated with a display, however there is no standard naming convention which would make it logical to pull out those formats.&amp;nbsp; In other languages there are coding standards such as small o before and Object and such like, but formats can be anything.&amp;nbsp; The user could also define his own formats, say notdate9. which could also be a date, and $10 could also be a date "2014-01-01".&amp;nbsp; I would suggest you need some more information about the data to evaluate.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 09:00:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154862#M30358</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-02-06T09:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154863#M30359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't understand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 11:06:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154863#M30359</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-02-06T11:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154864#M30360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;:smileyconfused:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Feb 2015 05:22:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154864#M30360</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-02-07T05:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154865#M30361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you are.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Feb 2015 14:32:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/154865#M30361</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-02-07T14:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/377934#M90785</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Test if value is a date-literal, or not.&lt;/LI&gt;&lt;LI&gt;Use the input-function, with the "??" option, and see if a missing-value is returned or not. Use the "ANY" informats, to sequentially test for valid date and date-time literal-values.&lt;/LI&gt;&lt;LI&gt;If a missing value is returned, assume the value is a SAS-date or SAS-datetime.&lt;/LI&gt;&lt;LI&gt;Test if the value is strictly a SAS-date, as follows:&amp;nbsp;&lt;SPAN&gt;if(^('01JAN1960'd&amp;lt;=SasDate&amp;lt;=today()))&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Use a similar test, to check for valid date-time values.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 20 Jul 2017 21:05:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/377934#M90785</guid>
      <dc:creator>LongTimer</dc:creator>
      <dc:date>2017-07-20T21:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Determine if a variable contains a SAS date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/405431#M98634</link>
      <description>&lt;P&gt;I guess it's too late to answer, but I think I've found an interesting solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can get 1 observation from your initial table with the field in question, then set this field's value to current date and time or something like '31DEC9999:0:0:0'dt and then use function vvalue(field). If this field uses date format without time, then our datetime value will be too big for this format, so vvalue() will return the string, consisting from '*' characters. Otherwise vvalue() will return something, that resembles date and time. Depending on the output we can determine, was the field in question in date format or in datetime format. Code is below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _NULL_;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;set in_table;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;field='31DEC9999:0:0:0'dt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;/* If the string consists only from '*' characters, then compress() below will return empty string */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;if compress(vvalue(field),'*')='' then call symput('date_format','date');&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; else call symput('date_format','datetime');&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 07:26:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-if-a-variable-contains-a-SAS-date-value/m-p/405431#M98634</guid>
      <dc:creator>Demoxe</dc:creator>
      <dc:date>2017-10-19T07:26:03Z</dc:date>
    </item>
  </channel>
</rss>

