I was wondering if anyone has some experience with getting the sysdate out of datstage ,Timedate() function, and then subtracting the two dates to get the total seconds between the 2 dates.
Something like this
Seconds_between =( Iconv('01:20:00',"MTS") + (Date() +1 ) - Iconv(TimeDate(),"MTS"@VM"D DMY[2,A3,4]") )
sleep(Seconds_between)
Note: 1.) I do know that DS converts this to its internal number, its a example.
2.) I can do this in oracle, but I didn't want to write it out to a file and then have to open/read/.... the file into DS.
Date subtraction into seconds
Moderators: chulett, rschirm, roy
Are the two dates in timestamp format ? You can certainly write a routine. Extract the date part, get the internal format which is number of days, multiply that with 24*60*60 to get number of seconds. Add that to the ICONV of time which will be number of seconds since Jan 1st 1968 12:00 AM. Get both your timestamps in that format, do your substraction. This will give you the difference in seconds.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
You mean KBATimestampDeltaSecondsroutine.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Date() and Time() will give you date and time in internal formats, respectively. You dont need to ICONV them again. All you need is
Code: Select all
SecondsBetween = (Iconv('01:20:00',"MTS") + (Date() +1)*86400 ) - (Time() + (Date())*86400 )
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
