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.
Last Wiki Answer Submitted: October 19, 2012 7:01 pm by aceofdelts1,565 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
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.
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