RPG date retrieval

1395 pts.
Tags:
Retrieve Data Area
RPG
RPG Data Fields
how to retrive the next 7th date of current month using rpg?
EX: today's date is 06/09/2011
i want to get the date 13/09/2011, how it's possible?

Answer Wiki

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

Use the ADDDUR instruction.
If you not sure how to use it, find the RPG manual online and find the instruction.
Thre are examples that will step you through it.

Discuss This Question: 6  Replies

 
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
  • philpl1jb
    D TodayPlus7 S D DATFMT(*EUR) c eval TodayPlus7 = %date() + %days(7) Value in TodayPlus7 is 13.09.2011 not TodayPlus7 is a date type field. Phil
    51,365 pointsBadges:
    report
  • philpl1jb
    My answer is for RPG/IV RPGLE not RPG The build in function %date() returns todays date + %days(7) adds 7 days to the date field: TodayPlus7 receives the date. It is a date type field displaying in European format dd.mm.yyyy Phil
    51,365 pointsBadges:
    report
  • Rajasekhar15
    this is procedure is not working in v4 version, plz advice me anyother method
    1,395 pointsBadges:
    report
  • philpl1jb
    then as Charlie Brown Suggests, use the adddur operation D TodayP7 S D inz(*SYS) datfmt(*EUR) c adddur 7:*days TodayP7 Phil
    51,365 pointsBadges:
    report
  • philpl1jb
    Please be much more specific about "it isn't working" If something is not "working" tell what is happening -- compile error xxxxxx or run time error xxxxx or incorrect value xxxxxxx. You've told us you are on V4 but are you using RPG or RPGLE ???? Phil
    51,365 pointsBadges:
    report
  • Rajasekhar15
    [...] Philpl1jb and CharlieBrowne offered the approved answer on RPG date retrieval. 6. Check out the community suggestions for what to do when critical storage lower limit is [...]
    0 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