<?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: Need to define a flag variable whether an incident has started within the first 24 hours of the in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/527964#M144029</link>
    <description>&lt;P&gt;Are you working with date or datetime values?&lt;/P&gt;</description>
    <pubDate>Thu, 17 Jan 2019 09:54:53 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-01-17T09:54:53Z</dc:date>
    <item>
      <title>Need to define a flag variable whether an incident has started within the first 24 hours of the sdat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/527962#M144027</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a flag defining whether an incident has started within the first 24 hours of the sdate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;something like below&lt;/P&gt;&lt;P&gt;any help on how to do it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sdate&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;incident&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;flag&lt;/P&gt;&lt;P&gt;04DEC2018&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;05DEC2018&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Y&lt;/P&gt;&lt;P&gt;08JAN2018&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 03JAN2018&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; N&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 09:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/527962#M144027</guid>
      <dc:creator>noda6003</dc:creator>
      <dc:date>2019-01-17T09:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need to define a flag variable whether an incident has started within the first 24 hours of the</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/527964#M144029</link>
      <description>&lt;P&gt;Are you working with date or datetime values?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 09:54:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/527964#M144029</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-17T09:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need to define a flag variable whether an incident has started within the first 24 hours of the</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/527965#M144030</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;FLAG = ifc(-1 &amp;lt;= SDATE-INCIDENT &amp;lt;= 1, 'Y', 'N');&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 09:56:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/527965#M144030</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-01-17T09:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Need to define a flag variable whether an incident has started within the first 24 hours of the</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/527966#M144031</link>
      <description>&lt;P&gt;i have both date and datetime variables, datetime is character variable something like "2018-12-05T12:00" .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;datetime makes sense to calculate flag if i am not wrong.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 09:57:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/527966#M144031</guid>
      <dc:creator>noda6003</dc:creator>
      <dc:date>2019-01-17T09:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need to define a flag variable whether an incident has started within the first 24 hours of the</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/527992#M144038</link>
      <description>&lt;P&gt;sorry if it is datetime like below than how to do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sdate&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; incident&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;flag&lt;/P&gt;&lt;P&gt;04DEC2018T10:03&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;05DEC2018T09&lt;SPAN&gt;:03&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Y&lt;/P&gt;&lt;P&gt;08JAN2018&lt;SPAN&gt;T13:03&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 03JAN2018T&lt;SPAN&gt;10:03&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; N&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 10:58:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/527992#M144038</guid>
      <dc:creator>noda6003</dc:creator>
      <dc:date>2019-01-17T10:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need to define a flag variable whether an incident has started within the first 24 hours of the</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/527993#M144039</link>
      <description>&lt;P&gt;If you don't consider the time:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;FLAG = ifc(-1 &amp;lt;= (input(SDATE,date9.) - input(INCIDENT,date9.)) &amp;lt;= 1, 'Y', 'N');&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 11:06:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/527993#M144039</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-01-17T11:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need to define a flag variable whether an incident has started within the first 24 hours of the</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/527994#M144040</link>
      <description>&lt;P&gt;i want to consider time, can i do something like this?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FLAG = ifc(-1 &amp;lt;= (SDATE- INCIDENT) &amp;lt;= 1, 'Y', 'N');&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 11:25:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/527994#M144040</guid>
      <dc:creator>noda6003</dc:creator>
      <dc:date>2019-01-17T11:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need to define a flag variable whether an incident has started within the first 24 hours of the</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/528003#M144045</link>
      <description>&lt;P&gt;With datetimes:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input sdate :e8601dt19. incident :e8601dt19.;
format sdate incident e8601dt19.;
cards;
2018-12-04T10:03 2018-12-05T09:03
2018-01-08T13:03 2018-01-03T10:03
;
run;

data want;
set have;
flag = ifc(0 &amp;lt;= intck('dtday',sdate,incident,'c') &amp;lt;= 1,'Y','N');
run;

proc print data=want noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;sdate                  incident               flag

2018-12-04T10:03:00    2018-12-05T09:03:00     Y  
2018-01-08T13:03:00    2018-01-03T10:03:00     N  
&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jan 2019 12:44:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-define-a-flag-variable-whether-an-incident-has-started/m-p/528003#M144045</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-01-17T12:44:44Z</dc:date>
    </item>
  </channel>
</rss>

