%diff and data structures

pts.
Tags:
RPG ILE
I have dates that come into my program as cn yy mm dd. I put these pieces in a ISO data structure to do some calcs. I want to find how many months transpired between to dates using the %diff. Can I do this with the dates being in a data structure? My program is telling me my parameters are invalid. Here's my set up. IF %Diff(REPTXDATE: + CALCLOSS: *MONTHS)<=12 ADD 1 I1Y12MX Thanks!!!

Answer Wiki

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

_____D_DateIso_________S_____________10
_____D_DateFichier_____S_______________D
_____c_____*ISO-_________movel_____dateiso_______datefichier
_____c___________________if________datefichier_…

I have replaced each space by underscore

first : move your pseudo date (the numeric field) to a true date field

second : you can do all the date computations you want

Discuss This Question: 2  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
  • RolandT
    You need to use real date fields in the %diff function. d bumand s d d demand s d d busched s 7s 0 *this in in format CYYMMDD d DECURS s 7s 0 *this in in format CYYMMDD d months s 5s 0 bumand = %date(busched:*cymd) ; demand = %date(decurs:*cymd) ; months = %diff(bumand:demand:*months) ; if your incoming date format is CCYYMMDD, then use *ISO instead of *CYMD
    0 pointsBadges:
    report
  • TomLiotta
    Note that "real date fields" are not required for %diff(). As with many %bifs, the parameters may be results of other %bifs. For %diff(), you can use the %date() function against numeric fields in order to convert values without needing "real date fields". 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