<?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: Pending claims at each month end (point in time) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477536#M123009</link>
    <description>&lt;P&gt;You can do something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Clno (Clmcreatedt Clmclosedt)(:date9.);
format Clmcreatedt Clmclosedt date9.;
datalines;
101 30APR2017 01JUL2017
102 02JAN2017 08JAN2017
103 25MAR2017 07MAY2017
104 27AUG2016 29SEP2018
105 30JUN2018 .
106 30APR2018 01JUL2018
107 06OCT2015 .
108 14FEB2017 30DEC2017
109 16FEB2017 .
110 01MAY2018 27JUN2018
;

proc sql;
   create table want as
   select *
         ,count(distinct Clno) as count
   from have
   where Clmclosedt=. or Clmcreatedt&amp;lt;=Clmclosedt
   group by year(Clmcreatedt), month(Clmcreatedt);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and edit the where clause to consider only year 2015 through 2018. Then use a simple RETAIN Statement in a data step to give you the accumulated count.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jul 2018 15:14:14 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2018-07-12T15:14:14Z</dc:date>
    <item>
      <title>Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477485#M122981</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset containing one record for each claim. it contains claim number ,&amp;nbsp;clm created date and clm closed date. I want to know number of pending claims at each month end, &lt;STRONG&gt;point in time&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Cl no. Clmcreatedt&amp;nbsp; Clmclosedt&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;101&amp;nbsp; &amp;nbsp; 30APR2017&amp;nbsp; 01JUL2017&lt;/P&gt;&lt;P&gt;102&amp;nbsp;&amp;nbsp; &amp;nbsp;02JAN&lt;SPAN&gt;2017&amp;nbsp; 08JAN2017&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;103&amp;nbsp; &amp;nbsp; 25MAR&lt;SPAN&gt;2017&amp;nbsp;07MAY2017&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;104&amp;nbsp; &amp;nbsp; 27&lt;SPAN&gt;AUG2016&amp;nbsp; 29SEP2018&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;105&amp;nbsp; &amp;nbsp; 30JUN&lt;SPAN&gt;2018&amp;nbsp;&amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;106&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;30APR2018&amp;nbsp; 01JUL2018&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;107&amp;nbsp; &amp;nbsp; 06OCT&lt;SPAN&gt;2015&amp;nbsp; .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;108&amp;nbsp; &amp;nbsp; 14FEB&lt;SPAN&gt;2017&amp;nbsp; 30DEC2017&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;109&amp;nbsp; &amp;nbsp; 16FEB&lt;SPAN&gt;2017&amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;110&amp;nbsp; &amp;nbsp; 01MAY&lt;SPAN&gt;2018&amp;nbsp; 27JUN2018&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if i do it for single month manually the code would be ,&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;set have&amp;nbsp;(where=(clm_created_dt &amp;lt;=&amp;nbsp;'30APR2018'd&amp;nbsp;and (clm_closed_dt = . or clm_closed_dt &amp;gt; &lt;SPAN&gt;'30APR2018'd&amp;nbsp;&lt;/SPAN&gt;))) ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;No. of records will be pending count for April 2018.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, i don't want to write this for each month from 2015 to 2018, so i have put all month end dates (using intnx and call symput. - code not shown here) into macro variables:&amp;nbsp; lastDay1 to&amp;nbsp;lastDay48.&amp;nbsp; &amp;nbsp;1 for 31JAN2015 and 48 for&amp;nbsp; 31DEC2018.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can i subset in the above step automatically and give one dataset for each month. the record number of each dataset is pending claim count for respective month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 14:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477485#M122981</guid>
      <dc:creator>vpgodbole</dc:creator>
      <dc:date>2018-07-12T14:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477492#M122993</link>
      <description>&lt;P&gt;So your data looks like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Clno (Clmcreatedt Clmclosedt)(:date9.);
format Clmcreatedt Clmclosedt date9.;
datalines;
101 30APR2017 01JUL2017
102 02JAN2017 08JAN2017
103 25MAR2017 07MAY2017
104 27AUG2016 29SEP2018
105 30JUN2018 .
106 30APR2018 01JUL2018
107 06OCT2015 .
108 14FEB2017 30DEC2017
109 16FEB2017 .
110 01MAY2018 27JUN2018
;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Why do you want to&amp;nbsp;split into separate data sets?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 14:13:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477492#M122993</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-07-12T14:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477497#M122997</link>
      <description>&lt;P&gt;Thanks for replying, even if it doesn't require splitting its fine, I am interested in counts. Could be any method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 14:21:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477497#M122997</guid>
      <dc:creator>vpgodbole</dc:creator>
      <dc:date>2018-07-12T14:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477502#M122998</link>
      <description>&lt;P&gt;Something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Clno (Clmcreatedt Clmclosedt)(:date9.);
format Clmcreatedt Clmclosedt date9.;
datalines;
101 30APR2017 01JUL2017
102 02JAN2017 08JAN2017
103 25MAR2017 07MAY2017
104 27AUG2016 29SEP2018
105 30JUN2018 .
106 30APR2018 01JUL2018
107 06OCT2015 .
108 14FEB2017 30DEC2017
109 16FEB2017 .
110 01MAY2018 27JUN2018
;

data temp;
   set have;
   Clmclosedt_end=intnx('month',Clmclosedt, 0, 'end');
   format Clmclosedt_end date9.;
run;

proc freq data=temp;
   tables Clmclosedt_end / out=want nocum;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Jul 2018 14:25:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477502#M122998</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-07-12T14:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477522#M123004</link>
      <description>&lt;P&gt;Thanks, what i am looking for is how many claims are pending (sill open at that time, either closing date is missing or closing date is after the respective month,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, for FEB 2017 the count would be&amp;nbsp; 2, for APR 2017 count would be 1, etc.. so the frequency is taking open and closed date into consideration, it only shifts time at which we are counting (point in time).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.g. For FEB2017, I want all claims opened anytime before FEB2017 (not necessarily in FEB2017),&amp;nbsp; and either not closed or closing date is after FEB2017. That will give me pending claim count point in time for FEB 2017.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 14:48:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477522#M123004</guid>
      <dc:creator>vpgodbole</dc:creator>
      <dc:date>2018-07-12T14:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477536#M123009</link>
      <description>&lt;P&gt;You can do something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Clno (Clmcreatedt Clmclosedt)(:date9.);
format Clmcreatedt Clmclosedt date9.;
datalines;
101 30APR2017 01JUL2017
102 02JAN2017 08JAN2017
103 25MAR2017 07MAY2017
104 27AUG2016 29SEP2018
105 30JUN2018 .
106 30APR2018 01JUL2018
107 06OCT2015 .
108 14FEB2017 30DEC2017
109 16FEB2017 .
110 01MAY2018 27JUN2018
;

proc sql;
   create table want as
   select *
         ,count(distinct Clno) as count
   from have
   where Clmclosedt=. or Clmcreatedt&amp;lt;=Clmclosedt
   group by year(Clmcreatedt), month(Clmcreatedt);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and edit the where clause to consider only year 2015 through 2018. Then use a simple RETAIN Statement in a data step to give you the accumulated count.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 15:14:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477536#M123009</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-07-12T15:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477537#M123010</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Clno (Clmcreatedt Clmclosedt)(:date9.);
format Clmcreatedt Clmclosedt date9.;
datalines;
101 30APR2017 01JUL2017
102 02JAN2017 08JAN2017
103 25MAR2017 07MAY2017
104 27AUG2016 29SEP2018
105 30JUN2018 .
106 30APR2018 01JUL2018
107 06OCT2015 .
108 14FEB2017 30DEC2017
109 16FEB2017 .
110 01MAY2018 27JUN2018
;
data temp;
   set have;
   Clmmonth_end=intnx('month',Clmcreatedt, 0, 'end');
    format Clmmonth_end date9.;
   keep   Clmmonth_end ;
run;


proc sql;
create table want as
select *
from temp a, have b
group by Clmmonth_end
having (Clmcreatedt &amp;lt;= Clmmonth_end and (Clmclosedt = . or Clmclosedt &amp;gt; Clmmonth_end))=1
order by Clmmonth_end,clno;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Jul 2018 15:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477537#M123010</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-12T15:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477538#M123011</link>
      <description>&lt;P&gt;If the above is ok, and you want just the counts, let me know&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 15:17:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477538#M123011</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-12T15:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477552#M123014</link>
      <description>&lt;P&gt;Yes, this is very helpful, next I can get counts by simply running freq on&amp;nbsp;Clmmonth_end?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 15:31:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477552#M123014</guid>
      <dc:creator>vpgodbole</dc:creator>
      <dc:date>2018-07-12T15:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477556#M123016</link>
      <description>&lt;P&gt;Yep whichever approach you want, or do you want me to modify the above? or you wanna take a stab at it yourself? feel free!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 15:32:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477556#M123016</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-12T15:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477570#M123018</link>
      <description>&lt;P&gt;just the counts:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Clno (Clmcreatedt Clmclosedt)(:date9.);
format Clmcreatedt Clmclosedt date9.;
datalines;
101 30APR2017 01JUL2017
102 02JAN2017 08JAN2017
103 25MAR2017 07MAY2017
104 27AUG2016 29SEP2018
105 30JUN2018 .
106 30APR2018 01JUL2018
107 06OCT2015 .
108 14FEB2017 30DEC2017
109 16FEB2017 .
110 01MAY2018 27JUN2018
;
data temp;
   set have;
   Clmmonth_end=intnx('month',Clmcreatedt, 0, 'end');
    format Clmmonth_end Clmmonth_begin date9.;
   keep   Clmmonth_end ;
run;


proc sql;
create table want as 
select  Clmmonth_end format=monyy.,sum(Clmcreatedt &amp;lt;= Clmmonth_end and (Clmclosedt = . or Clmclosedt &amp;gt; Clmmonth_end)) as pending_claims
from temp a, have b
group by Clmmonth_end
order by Clmmonth_end;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Jul 2018 15:49:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477570#M123018</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-12T15:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477576#M123019</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/178437"&gt;@vpgodbole&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks, what i am looking for is how many claims are pending (sill open at that time, either closing date is missing or closing date is after the respective month,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, for FEB 2017 the count would be&amp;nbsp; 2, for APR 2017 count would be 1, etc.. so the frequency is taking open and closed date into consideration, it only shifts time at which we are counting (point in time).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;E.g. For FEB2017, I want all claims opened anytime before FEB2017 (not necessarily in FEB2017),&amp;nbsp; and either not closed or closing date is after FEB2017. That will give me pending claim count point in time for FEB 2017.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your time.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;For this you need to &lt;STRONG&gt;explicitly&lt;/STRONG&gt; tell us what the end date rule to consider would be. Otherwise we don't have any idea when to stop. Either a&amp;nbsp;specific date, a relative date base on the creation date (do you allow "pending" to run for 5 years? 10 Years? 25 years?) or perhaps program run date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also since you show&lt;/P&gt;
&lt;P&gt;104 27AUG2016 29SEP2018&lt;/P&gt;
&lt;P&gt;107&amp;nbsp; &amp;nbsp; 06OCT&lt;SPAN&gt;2015&amp;nbsp; .&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;108&amp;nbsp; &amp;nbsp; 14FEB&lt;SPAN&gt;2017&amp;nbsp; 30DEC2017&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;109&amp;nbsp; &amp;nbsp; 16FEB&lt;SPAN&gt;2017&amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;that is&amp;nbsp;&lt;STRONG&gt;4&lt;/STRONG&gt; claims pending at the end of Feb 2017.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Perhaps:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data have;
input Clno (Clmcreatedt Clmclosedt)(:date9.);
format Clmcreatedt Clmclosedt date9.;
datalines;
101 30APR2017 01JUL2017
102 02JAN2017 08JAN2017
103 25MAR2017 07MAY2017
104 27AUG2016 29SEP2018
105 30JUN2018 .
106 30APR2018 01JUL2018
107 06OCT2015 .
108 14FEB2017 30DEC2017
109 16FEB2017 .
110 01MAY2018 27JUN2018
;
run;

data temp;
   set have;
   EndMonth = coalesce(intnx('month',Clmclosedt,0,'E'),intnx('month',today(),0,'E'));
   format endmonth PendMonth date9.;
   PendMonth = intnx('month',Clmcreatedt,0,'E');
   do while (pendmonth lt endmonth);
      Pending =1;
      output;
      pendmonth= intnx('month',pendmonth,1,'E');
   end;
run;

proc freq data=temp;
   tables pendmonth;
run;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Jul 2018 16:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477576#M123019</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-12T16:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477582#M123022</link>
      <description>&lt;P&gt;The start year month would be JAN 2015 and End month and year would be DEC 2018 or could be current month and year.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 16:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477582#M123022</guid>
      <dc:creator>vpgodbole</dc:creator>
      <dc:date>2018-07-12T16:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477589#M123027</link>
      <description>&lt;P&gt;Sorry everyone for the confusion..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If we can further develop:-&lt;/P&gt;&lt;P&gt;I want counts till current month and year, Your code is taking the last End date into consideration which is Jun2018.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What if last dt is May2018 and I want counts for June and July to show 0? or in the above case July should be zero.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Months to consider for this query can be JAN2015 to&amp;nbsp; current month year or DEC2018.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 16:15:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477589#M123027</guid>
      <dc:creator>vpgodbole</dc:creator>
      <dc:date>2018-07-12T16:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477647#M123067</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/178437"&gt;@vpgodbole&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Sorry everyone for the confusion..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If we can further develop:-&lt;/P&gt;
&lt;P&gt;I want counts till current month and year, Your code is taking the last End date into consideration which is Jun2018.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What if last dt is May2018 and I want counts for June and July to show 0? or in the above case July should be zero.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Months to consider for this query can be JAN2015 to&amp;nbsp; current month year or DEC2018.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If this is reply to my example please note that it was prefaced with a question directly related to this: what is the end.&lt;/P&gt;
&lt;P&gt;The COALESCE statement was to select one of two conditions since you indicated you have blank data and the order would be important. So the coalesce picks the first of the dates: the end date if present or todays date (since lacking any explicit prior requirement). You could replace the second part of the endmonth assignment with a specific date:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt; EndMonth = coalesce(intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;'month'&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;,Clmclosedt,&lt;/FONT&gt;&lt;FONT color="#008080" face="SAS Monospace" size="2"&gt;0&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;'E'&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;),'31DEC2018'd&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;));&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;for example&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;Pick one: current month year (already provided) or Dec 2018 ^^^&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;You may have to describe in more detail what "Months to consider for this query can be JAN2015&amp;nbsp;" might mean as do you only want to count "pending" starting at Jan2015 if the creation date was prior to that?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;Or only consider creation dates of Jan2015 or later.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 18:06:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477647#M123067</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-12T18:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477650#M123068</link>
      <description>&lt;P&gt;Creation date can be even before JAN 2015, but table is only for months of JAN2015 to DEC2018.&amp;nbsp;&lt;/P&gt;&lt;P&gt;That means for JAN 2015, claims created on or before JAN2015 and closed after or missing would be pending for JAN2015.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So basically i have to take entire data into consideration but calculate only for months i want.&amp;nbsp;&lt;/P&gt;&lt;P&gt;will test coalesce now, thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 18:30:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477650#M123068</guid>
      <dc:creator>vpgodbole</dc:creator>
      <dc:date>2018-07-12T18:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Pending claims at each month end (point in time)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477713#M123091</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/178437"&gt;@vpgodbole&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Creation date can be even before JAN 2015, but table is only for months of JAN2015 to DEC2018.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That means for JAN 2015, claims created on or before JAN2015 and closed after or missing would be pending for JAN2015.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So basically i have to take entire data into consideration but calculate only for months i want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;will test coalesce now, thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I showed how to make an ENDMONTH variable. Use the same approach to create a STARTMONTH value and then use Pending from Startmonth to Endmonth. Instead of COALESCE though you likely want to take the MAX value of the create date and your year start date.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 23:03:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pending-claims-at-each-month-end-point-in-time/m-p/477713#M123091</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-12T23:03:13Z</dc:date>
    </item>
  </channel>
</rss>

