Page 1 of 1

SecondsSinceFromTimestamp Function

Posted: Mon Sep 01, 2003 8:34 am
by johnno
DS Version 6 Windows 2000

I am trying to make use of this funtion (which I found in the DS online help and returns the difference between two timestamps in seconds) in a routine, but it is not recognised. Can anyone help?

Posted: Mon Sep 01, 2003 12:23 pm
by spracht
John

maybe the function has to be declared (or would you say defined?) before it can be used, e.g.

Deffun SecondsSinceFromTimestamp(A1,A2,...) Calling "DSX.SECONDSSINCEFROMTIMESTAMP"

In parentheses enumerate as much arguments as the function has, after the Calling clause it is important to write everything in uppercase letters. Mor info possibly in: http://www.tools4datastage.com/forum/to ... C_ID=84757

HTH,


Stephan

Posted: Mon Sep 01, 2003 12:48 pm
by kcbland
How and where are you receiving this error message? Are you attempting to compile a batch job, a function, a subroutine, a server job?

Kenneth Bland

Posted: Tue Sep 02, 2003 5:05 am
by johnno
In the DataStage Designer online help, search for 'timestamp'. From the list returned, double click on Date and Time Functions. This provides a list of available functions withtin DataStage (at least that's the way I read it); this function is listed here.

I was trying to use it in a routine I was writing and was getting the following error at compilation: "Array 'SecondsSinceFromTimestamp' never dimensioned." from using the following code: "Seconds = SecondsSinceFromTimestamp(StartDateTime, EndDateTime).

When I declare/define the function, it compiles OK, but when I test it I get the following errors:
Program "DSU.rDeriveDurationTheBox": Line 4, Unable to open the operating system file "DSU_BP.O/DSU.SecondsSinceFromTimestamp".
[ENOENT] No such file or directory
Program "DSU.rDeriveDurationTheBox": Line 4, Unable to load file "DSU.SecondsSinceFromTimestamp".
Program "DSU.rDeriveDurationTheBox": Line 4, Unable to load subroutine.

I also get an error if I try to use it in a tranform stage.

I can find no additional documentation on the function apart from that supplied from the Date and Time Function list above.

Posted: Tue Sep 02, 2003 5:26 am
by spracht
Only user-defined functions are declared using the 'DSU' prefix! Did you try 'DSX'? What version do you use, I couldn't find SecondsSinceFromTimestamp in DS 5.2?

Stephan

Posted: Tue Sep 02, 2003 7:01 am
by kcbland
Would you please paste your complete function? Without seeing the logic we cannot check syntax. Since you are trying to call other DS or user created functions from another function, you have to do specific function declarations.

Kenneth Bland

Posted: Tue Sep 02, 2003 7:03 am
by johnno
Thanks guys. I am using version 6 and have gone through end defined the function in DS* as per Rays response to the topic you provided the link for and get the same for each definition.

I wouldn't worry about it too much as I can get around it with a bit of extra code. I just thought if this was there it would make it easier.

Thanks again.