RPGLE day, month and year calculation

10 pts.
Tags:
RPGLE code
RPGLE Program
I want to fixed the day by hardcode, retrieve the year from system and want the month 6 month before. can anyone help me...
ASKED: October 18, 2012  7:16 AM
UPDATED: October 18, 2012  12:33 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

I’ll do something similar to get the last day of a month. For your issue …

Get *DATE as ccyymmdd and load it to a data structure with DD specified in positions 7-8. Set DD=01. Put that ccyymmdd value into a Date (type) field and SUBDUR by 6 months. The result should be what you want.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    To be sure about what you are asking, you want to have a day-number as a constant in your program. For example, you might have [ DayNumber = 10 ] coded into the program. Then you will retrieve the system YEAR value. Then you want the month number for 6 months before... the current date?   Since today is October 18, 2012, you would have DayNumber = 10, YEAR = 2012, and MONTH = 4. The resulting date would be April 10, 2012.   Is that the kind of thing you need?   If not, can you provide a couple better examples?   Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following