Help using Base SAS procedures

Collection in different time periods

Reply
Contributor
Posts: 46

Collection in different time periods

[ Edited ]

Hi Community,

 

I have a data that shows the total collections for a specific customer, who experienced a reopening of their order after it was closed. I need from that data to obtain the collections for the reporting month. Here is what I have:

IDDateStatusCollection dateAmount owedever collected
123429-Feb-16Open.82.440
123431-Mar-16Open.82.440
123430-Apr-16Open.82.440
123431-May-16Open.82.440
123430-Jun-16Open.82.440
123431-Jul-16Closed20-Jul-1682.4482.44
123431-May-18reopened20-Jul-1682.44

82.44

 

And here is what I need (the last column):

IDDateStatusCollection dateAmount owedever collectedthis month collection
123429-Feb-16Open.82.4400
123431-Mar-16Open.82.4400
123430-Apr-16Open.82.4400
123431-May-16Open.82.4400
123430-Jun-16Open.82.4400
123431-Jul-16Closed20-Jul-1682.4482.4482.44
123431-May-18reopened20-Jul-1682.4482.440

 

many thanks,

Altijani

 

Super User
Posts: 23,771

Re: Collection in different time periods

I suspect this example will not generalize to your actual data. Can you provide a more robust example?

 

If it does generalize, then you can use something like:

 

if put(collection_date, yymm6.) = put(date, yymm6.) then this_month = ever_collected;
Ask a Question
Discussion stats
  • 1 reply
  • 127 views
  • 0 likes
  • 2 in conversation