Can any body help me in DataStage Designer , How to get number of days between to date , currently I am using routine DateGenericDateDiff,
and here we have to give input date like 20040518 (yyyymmdd) , toget this format we have to first conver date into string format then substr for year, month and day and merge. Due to this resone my job is running very much slow .
Ex:- DateVal1 := 2004-05-18
DateVal2 := 2004-05-18
DateGenericDateDiff
(DateVal1[1,4]:DateVal1[6,2]:DateVal1[9,2],
DateVal1[1,4]:DateVal1[6,2]:DateVal1[9,2] )
Is it any routine available where we can pass two date directly jsut like
oracle ?
select (sysdate-to_date('2004-05-18','YYYY-MM-DD') )
from dual
Difference Between Tow Date
Moderators: chulett, rschirm, roy
Difference Between Tow Date
Arun Verma
To expand a little on what Nag said, converting dates to an internal format (Iconv) and then subtracting them will give you the difference in days. You really need to become friends with both Iconv and Oconv as they are staples of date handling in DataStage. A third function that works well with them is the Status function which, when used with the other functions in a routine, can be used to check the validity of dates when converting from one form to another.
Check your online help, or look at the source for the date handling routines in the 'sdk' category for some working examples.
Check your online help, or look at the source for the date handling routines in the 'sdk' category for some working examples.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
See the paper Date Conversion Demystified to learn about conversion of dates using the Iconv and Oconv functions.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.