0 pts.
 %diff and data structures
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!!!

Software/Hardware used:
ASKED: February 27, 2006  11:59 AM
UPDATED: November 30, 2009  6:02 AM

Answer Wiki:
_____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
Last Wiki Answer Submitted:  February 27, 2006  3:59 pm  by  JPLamontre   0 pts.
All Answer Wiki Contributors:  JPLamontre   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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 pts.

 

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

 108,005 pts.