Page 1 of 1

to find the full month and non full month

PostPosted: Mon Apr 14, 2014 6:27 pm
by arjun31
I have two date fileds
WS-BG-DATE YYYYMMDD
WS-END-DATE YYYYMMDD

Between these two range of dates, I need to find whether they have full months or non full months. If it is mix of some full months and non full months, how to get the days left?

Please someone help me.

Exmaple:
WS-BG-DATE 20140101
WS-END-DATE 20140414

Here full months will be 20140101 to 20140401 and 20140401 to 20140414 are number of days left. How to achieve this in a cobol program?

Re: to find the full month and non full month

PostPosted: Mon Apr 14, 2014 8:10 pm
by NicC
What if your period starts in the middle of a month - where does the full month end? The middle of the next month? Or what? Whichever, you may have to code the calculation yourself if there is no in-house routine do do what you want.

Re: to find the full month and non full month

PostPosted: Mon Apr 14, 2014 11:59 pm
by dick scherrer
Hello and welcome to the forum,

Suggest you post several date pairs and show what you want for the result when each pair is processed. You might consider showing the result differently than your example.

Re: to find the full month and non full month

PostPosted: Tue Apr 15, 2014 12:04 pm
by arjun31
Thanks for replying back. The actual requirement is ' I need to print the claim amounts on daily basis if not full month' .The examples are given below,
1) WS-BG-DATE 20140101 (yyyymmdd)
WS-END-DATE 20140414
Amount $1000
Output:
20140101 to 20140401 $873.8
20140401 $9.7
20140402 $9.7
.....
20140413 $9.7

2) WS-BG-DATE 20140115
WS-END-DATE 20140414
Amount $1000

Here the full month is from 20140201 to 20140401. So the output should be
20140115 $..
20140116 $..
....
20140131 $..

20140201 to 20140401 $..

20140401 $..
20140402 $..
...
20140413 $..

Note: here i need to split the amount also on daily basis and need to print.

Hope these examples are sufficient. Could someone suggest me how can achieve this in a cobol program.

Re: to find the full month and non full month

PostPosted: Tue Apr 15, 2014 12:25 pm
by enrico-sorichetti
Could someone suggest me how can achieve this in a cobol program.


You might be overlooking the simple fact that when dealing with MONEY quite often
the CALENDAR dates are not the same as LEDGER/ACCOUNTING dates
what about HOLIDAYS and similar ?

first get a better grasp of the RULES and a better description of the requirement
and...
we do not need to know what You do after grouping the days ranges,
providing unneeded info just makes more difficult to understand the CORE requirement and give advice

where is that You are facing problems, anyway, the logic or the coding ?