RTN LAST.DAY.OF.THIS.MONTH

  • realfunny
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 9 months ago #20952 by realfunny
RTN LAST.DAY.OF.THIS.MONTH was created by realfunny
Dear all
Have everybody got source code of routine LAST.DAY.OF.THIS.MONTH ? I need to setup Frequency.
Thank you./.

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago #20954 by jpb
Replied by jpb on topic RTN LAST.DAY.OF.THIS.MONTH
If you want to write a new routine to be used in EB.FREQUENCY - SPECIAL.ROUTINE you just have COMI as in- and output, no further parameters.

Please Log in or Create an account to join the conversation.

  • realfunny
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 9 months ago #20957 by realfunny
Replied by realfunny on topic RTN LAST.DAY.OF.THIS.MONTH
Thank you, But I want to the frequency appear like the pic

Please Log in or Create an account to join the conversation.

More
7 years 9 months ago #20958 by madhulatha
Replied by madhulatha on topic RTN LAST.DAY.OF.THIS.MONTH
CALL core routine
CALL AM.GET.MONTH.LAST.DATE(PROCESS.DATE,MONTH.END,RESV.1,RESV.2,RESV.3)

*Desc - this routine takes input as date or yyyymmdd and returns the last date of the month it also return if the date is already a month end date
* Parameter Desc:
* PROCESS.DATE - Incoming/Outgoing - The Incoming date which needs to be processed, Output also return in the same variable
* MONTH.END - Outgoing - Its a flag to decide wheather the incoming date is month end or not. if it is a month.end it returns 'YES'
* RESV.1,RESV.2,RESV.3 - Reserverd - reserved for future use

Please Log in or Create an account to join the conversation.

  • realfunny
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 9 months ago #20960 by realfunny
Replied by realfunny on topic RTN LAST.DAY.OF.THIS.MONTH
Thank you very much, i will try to do it.

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #21912 by baskarjay
Replied by baskarjay on topic RTN LAST.DAY.OF.THIS.MONTH
HI MADHULATHA,

This routine gives wrong output ....

Pls dont suggest this ....

Please Log in or Create an account to join the conversation.

  • VK
  • VK's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
More
6 years 1 month ago - 6 years 1 month ago #21913 by VK
Replied by VK on topic RTN LAST.DAY.OF.THIS.MONTH
Hi
Why do you need a routine? Just add 1 day to the current date and see if the day number in result is 1...

For a reverse operation, subtract 1 day from the first day of next month and there you are :))

Cheers
VK
Last edit: 6 years 1 month ago by VK.
The following user(s) said Thank You: baskarjay

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #21952 by purangika
Replied by purangika on topic RTN LAST.DAY.OF.THIS.MONTH
The last day of current month can be taken as said but it has to have a additional condition when it is in 12th month. 1 day subtract should happen from the next year january first.

Please Log in or Create an account to join the conversation.

  • VK
  • VK's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
More
6 years 1 month ago #21956 by VK
Replied by VK on topic RTN LAST.DAY.OF.THIS.MONTH
Hi
I wasn't fully clear in my proposition... All adds / subtracts have to be applied to the internal date that is obtained using ICONV(date, 'D').

Cheers
VK
The following user(s) said Thank You: baskarjay

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #21968 by baskarjay
Replied by baskarjay on topic RTN LAST.DAY.OF.THIS.MONTH
Thanks VK for your response ...
I got the solution .....

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago #22032 by drjekoyemi
Replied by drjekoyemi on topic RTN LAST.DAY.OF.THIS.MONTH
Hi BASKARJAY

Kindly share the solution you finally settled for

Thanks

Please Log in or Create an account to join the conversation.

  • VK
  • VK's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Globus:G9-G13|TAFC:R05-R23|TAFJ:R19,R23,R24:test
More
5 years 8 months ago - 5 years 8 months ago #22043 by VK
Replied by VK on topic RTN LAST.DAY.OF.THIS.MONTH
Hi
it's very easy to do if you know jBC a little bit :))

1. Calculate the number of next month; if it's January - add 1 to the year as well.
2. Construct the date for the 1st day of next month, ICONV it to the internal representation.
3. Subtract one from that and OCONV it back.

That if we're talking about calendar days. Use CDT if it's working days.
Of course CDT can be used in both cases but I prefer a solution that is more "native" to DBMS.

Cheers
VK
Last edit: 5 years 8 months ago by VK.

Please Log in or Create an account to join the conversation.

Time to create page: 0.091 seconds