SecondsSinceFromTimestamp Function

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
johnno
Participant
Posts: 50
Joined: Wed Mar 05, 2003 5:33 am

SecondsSinceFromTimestamp Function

Post 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?
spracht
Participant
Posts: 105
Joined: Tue Apr 15, 2003 11:30 pm
Location: Germany

Post 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
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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
johnno
Participant
Posts: 50
Joined: Wed Mar 05, 2003 5:33 am

Post 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.
spracht
Participant
Posts: 105
Joined: Tue Apr 15, 2003 11:30 pm
Location: Germany

Post 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
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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
johnno
Participant
Posts: 50
Joined: Wed Mar 05, 2003 5:33 am

Post 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.
Post Reply