<?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: DATETIME variable stored as a string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372347#M89023</link>
    <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;into&lt;/FONT&gt; syntax uses any associated format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just force another format:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;put(max(MODSTAMP) ,9. -l) into :max_ts&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 01 Jul 2017 00:48:30 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2017-07-01T00:48:30Z</dc:date>
    <item>
      <title>DATETIME variable stored as a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372331#M89014</link>
      <description>&lt;P&gt;I am using select into to store the most recent datetime record from my table as such:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select max(MODSTAMP)&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;into&amp;nbsp;&amp;nbsp; :max_ts&lt;BR /&gt;&amp;nbsp;&amp;nbsp;from&amp;nbsp;&amp;nbsp;&amp;nbsp;my_table;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;%put max_ts:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;maxt_s;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This produces a value like 29JUN2017:23:59:52.000000.&amp;nbsp; The MODSTAMP in my Teradata table is stored as a TIMESTAMP(6).&lt;/P&gt;&lt;P&gt;I do this twice:&amp;nbsp; once to get the current max_ts, then I insert some records, and then again to get the new_maxts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is this:&amp;nbsp; when I compare max_ts to new_maxts, the values are stored and evaluated as strings:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%IF &amp;amp;new_maxts &amp;gt; &amp;amp;max_ts %THEN %DO;&lt;BR /&gt;&amp;nbsp; %goto start;&lt;BR /&gt;&amp;nbsp; %END;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When it rolls into a new month, the evaluation produces a fales result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="Calibri"&gt;SYMBOLGEN:&amp;nbsp; Macro variable NEW_MAXTS resolves to 04MAR2017:00:39:08.000000&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="Calibri"&gt;SYMBOLGEN:&amp;nbsp; Some characters in the above value which were subject to macro quoting have been unquoted for printing.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="Calibri"&gt;SYMBOLGEN:&amp;nbsp; Macro variable MAX_TS resolves to 28FEB2017:17:23:56.000000&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="Calibri"&gt;SYMBOLGEN:&amp;nbsp; Some characters in the above value which were subject to macro quoting have been unquoted for printing.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="Calibri"&gt;MLOGIC(MYLOOP):&amp;nbsp; %IF condition &amp;amp;new_maxts &amp;gt; &amp;amp;max_ts is FALSE&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The IF condition should be TRUE, but this happens &lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;because zero &lt;/FONT&gt;comes before two in sting fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried tons of different formatting, including adding tickies and "dt" like '&lt;FONT color="#1f497d" face="Calibri" size="2"&gt;04MAR2017:00:39:08.000000'dt.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#1f497d" face="arial,helvetica,sans-serif"&gt;and the result was the same.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#1f497d" face="arial,helvetica,sans-serif"&gt;Any suggestions would be greatly appreciated!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 23:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372331#M89014</guid>
      <dc:creator>SoozMorg</dc:creator>
      <dc:date>2017-06-30T23:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME variable stored as a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372337#M89017</link>
      <description>&lt;P&gt;Convert it to a datetime variable then.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Input(max(modstamp), anydtdtm.) into :max_dt&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/151886"&gt;@SoozMorg&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I am using select into to store the most recent datetime record from my table as such:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; select max(MODSTAMP)&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;into&amp;nbsp;&amp;nbsp; :max_ts&lt;BR /&gt;&amp;nbsp;&amp;nbsp;from&amp;nbsp;&amp;nbsp;&amp;nbsp;my_table;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;%put max_ts:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;maxt_s;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This produces a value like 29JUN2017:23:59:52.000000.&amp;nbsp; The MODSTAMP in my Teradata table is stored as a TIMESTAMP(6).&lt;/P&gt;
&lt;P&gt;I do this twice:&amp;nbsp; once to get the current max_ts, then I insert some records, and then again to get the new_maxts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My problem is this:&amp;nbsp; when I compare max_ts to new_maxts, the values are stored and evaluated as strings:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%IF &amp;amp;new_maxts &amp;gt; &amp;amp;max_ts %THEN %DO;&lt;BR /&gt;&amp;nbsp; %goto start;&lt;BR /&gt;&amp;nbsp; %END;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When it rolls into a new month, the evaluation produces a fales result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="Calibri"&gt;SYMBOLGEN:&amp;nbsp; Macro variable NEW_MAXTS resolves to 04MAR2017:00:39:08.000000&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="Calibri"&gt;SYMBOLGEN:&amp;nbsp; Some characters in the above value which were subject to macro quoting have been unquoted for printing.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="Calibri"&gt;SYMBOLGEN:&amp;nbsp; Macro variable MAX_TS resolves to 28FEB2017:17:23:56.000000&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="Calibri"&gt;SYMBOLGEN:&amp;nbsp; Some characters in the above value which were subject to macro quoting have been unquoted for printing.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="Calibri"&gt;MLOGIC(MYLOOP):&amp;nbsp; %IF condition &amp;amp;new_maxts &amp;gt; &amp;amp;max_ts is FALSE&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The IF condition should be TRUE, but this happens &lt;FONT face="arial,helvetica,sans-serif" size="3"&gt;because zero &lt;/FONT&gt;comes before two in sting fields.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried tons of different formatting, including adding tickies and "dt" like '&lt;FONT face="Calibri" size="2" color="#1f497d"&gt;04MAR2017:00:39:08.000000'dt.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#1f497d"&gt;and the result was the same.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#1f497d"&gt;Any suggestions would be greatly appreciated!&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 23:52:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372337#M89017</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-30T23:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME variable stored as a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372347#M89023</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;into&lt;/FONT&gt; syntax uses any associated format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just force another format:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;put(max(MODSTAMP) ,9. -l) into :max_ts&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jul 2017 00:48:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372347#M89023</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-07-01T00:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME variable stored as a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372349#M89024</link>
      <description>&lt;P&gt;Sorry, but that didn't work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;38&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select put(max(MODSTAMP) ,9. -l)&lt;BR /&gt;39&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into&amp;nbsp;&amp;nbsp; :test&lt;BR /&gt;40&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp; my_table&lt;BR /&gt;41&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where CNTCT_METH_TX = 'Email';&lt;BR /&gt;WARNING: The format F was not located on the database.&amp;nbsp; In-database processing will proceed without it.&lt;BR /&gt;WARNING: Syntax error or access violation Syntax error: expected something between '(' and the string 'F'.&lt;BR /&gt;42&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put test:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;test;&lt;BR /&gt;SYMBOLGEN:&amp;nbsp; Macro variable TEST resolves to 1.8144E9&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jul 2017 01:14:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372349#M89024</guid>
      <dc:creator>SoozMorg</dc:creator>
      <dc:date>2017-07-01T01:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME variable stored as a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372350#M89025</link>
      <description>&lt;P&gt;Sorry, this did not work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;38&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select Input(max(modstamp), anydtdtm.)&lt;BR /&gt;39&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into&amp;nbsp;&amp;nbsp; :test&lt;BR /&gt;40&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp; my_table&lt;BR /&gt;41&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where CNTCT_METH_TX = 'Email';&lt;BR /&gt;ERROR: INPUT function requires a character argument.&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jul 2017 01:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372350#M89025</guid>
      <dc:creator>SoozMorg</dc:creator>
      <dc:date>2017-07-01T01:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME variable stored as a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372351#M89026</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%IF %sysevalf("&amp;amp;new_maxts"dt &amp;gt;"&amp;amp;max_ts"dt) %THEN %DO;
  %goto start;
  %END;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That means your variable is numeric. All macro variables are character.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jul 2017 01:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372351#M89026</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-01T01:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME variable stored as a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372353#M89028</link>
      <description>&lt;P&gt;Convert datetime macro variable, in addition, &amp;nbsp;when compared:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;%IF %sysevalf( "&amp;amp;new_maxts"dt &amp;gt; "&amp;amp;max_ts"dt ) %THEN %DO;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jul 2017 01:43:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372353#M89028</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2017-07-01T01:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME variable stored as a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372366#M89032</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/151886"&gt;@SoozMorg&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I would be using the SQL code you've initially posted to ensure that your SQL executes in-database. Using SAS functions which can't get converted into database functions will cause the SQL to pull the data into SAS for execution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For dealing with the resulting datetime strings in SAS macro code I'd be going for the approach&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;already posted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If fractional seconds are of importance for what you're doing then&amp;nbsp;I'd be using INPUTN() instead of "..."dt syntax within your macro code. Have a look at the result from below code sample which illustrates the differences.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test(max_ts,new_maxts);
  %put using ""dt syntax;
  %if %sysevalf("&amp;amp;new_maxts"dt &amp;gt;"&amp;amp;max_ts"dt) %then %put RESULT: GT;
  %else %if %sysevalf("&amp;amp;new_maxts"dt = "&amp;amp;max_ts"dt) %then %put RESULT: EQ;
  %else %put RESULT: LT;

  %put using inputn() syntax;
  %if %sysevalf(%sysfunc(inputn("&amp;amp;new_maxts",datetime26.)) &amp;gt; %sysfunc(inputn("&amp;amp;max_ts",datetime26.))) %then %put RESULT: GT;
  %else %if %sysevalf(%sysfunc(inputn("&amp;amp;new_maxts",datetime26.)) = %sysfunc(inputn("&amp;amp;max_ts",datetime26.))) %then %put RESULT: EQ;
  %else %put RESULT: LT;

%mend;

%test(29JUN2017:23:59:52.000000,01JUL2017:23:59:52.000000);
%test(29JUN2017:23:59:52.000000,29JUN2017:23:59:52.000000);

%test(29JUN2017:23:59:52.000001,29JUN2017:23:59:52.000000);
%test(29JUN2017:23:59:52.000010,29JUN2017:23:59:52.000000);
%test(29JUN2017:23:59:52.000100,29JUN2017:23:59:52.000000);
%test(29JUN2017:23:59:52.001000,29JUN2017:23:59:52.000000);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;42         %test(29JUN2017:23:59:52.000000,29JUN2017:23:59:52.000000);
using ""dt syntax
RESULT: EQ
using inputn() syntax
RESULT: EQ
43         
44         %test(29JUN2017:23:59:52.000001,29JUN2017:23:59:52.000000);
using ""dt syntax
RESULT: EQ
using inputn() syntax
RESULT: EQ
45         %test(29JUN2017:23:59:52.000010,29JUN2017:23:59:52.000000);
using ""dt syntax
RESULT: EQ
using inputn() syntax
RESULT: LT
46         %test(29JUN2017:23:59:52.000100,29JUN2017:23:59:52.000000);
using ""dt syntax
RESULT: EQ
using inputn() syntax
RESULT: &lt;FONT color="#FF0000"&gt;LT&lt;/FONT&gt;
47         %test(29JUN2017:23:59:52.001000,29JUN2017:23:59:52.000000);
using ""dt syntax
RESULT: EQ
using inputn() syntax
RESULT: LT&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jul 2017 04:23:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME-variable-stored-as-a-string/m-p/372366#M89032</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-07-01T04:23:56Z</dc:date>
    </item>
  </channel>
</rss>

