Professional Documents
Culture Documents
Wikibanking - Info Dates Manipulation
Wikibanking - Info Dates Manipulation
Wikibanking - Info Dates Manipulation
info/2012/09/dates-manipulation/
Dates Manipulation
Date formatting:
CALL DIETER.DATE(DATE.IN,DATE.OUT,’D’)
Example:
ORD.DATE = R.DXO<DX.ORD.TRADE.DATE>
(for instance= '20151106')
ORDER.DATE = ''
IF (ORD.DATE) THEN CALL DIETER.DATE(ORD.DATE,ORDER.DATE,'D')
=> gives ORDER.DATE = '06 NOV 2015'
With DAYS.DIFF set to W for a difference in working days, C for a difference in calendar days. After the call,
DAYS.DIFF will contain the days difference.
Example:
REMAIN.CAL.DAYS = "C"
START.DATE = TODAY
IF START.DATE < EXPIRY.DATE THEN
CALL CDD('',START.DATE, EXPIRY.DATE, REMAIN.CAL.DAYS)
END
=> gives REMAIN.CAL.DAYS = 115
Example:
if TODAY = 20140606
PROCESS.DATE = TODAY
DAY.COUNT = "-3W"
CALL CDT('', PROCESS.DATE, DAY.COUNT)
Example with “date_to_check” which can be the next open day if it’s a banking holiday:
COUNTRY.CODE = ''
COUNTRY.CODE = R.COMPANY(EB.COM.LOCAL.COUNTRY)
RETURN.CODE = ""
CALL WORKING.DAY('',date_to_check;,'','','',COUNTRY.CODE,'','',RETURN.CODE,'')
IF RETURN.CODE = 0 THEN
(...)
END ELSE
ADJ.MAT.DATE = date_to_check
CALL CDT('',ADJ.MAT.DATE,'+1W')
(...)
END