DATA TYPE ISSUE

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
karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

DATA TYPE ISSUE

Post by karry450 »

Hi Friends,


I am having two fields A(TIMESTAMP) and B(TIMESTAMP) in source and and in target I have column C( A-B) which data type should I mention here, if the column C is Decimal it is giving me a phantom error.

can anyone gimme a solution to fit this condition.


Thanks & regards
Karthik Chandra goutam
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There are no data types in server jobs, therefore an attempt to subtract two timestamps is undefined. You need to convert them to some numeric format (for example seconds) and subtract those. In what units should C be?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
karry450
Participant
Posts: 201
Joined: Wed Nov 14, 2007 11:31 pm
Location: HYD

Post by karry450 »

ray.wurlod wrote:There are no data types in server jobs, therefore an attempt to subtract two timestamps is undefined. You need to convert them to some numeric format (for example seconds) and subtract those. In wha ...


Can we do subraction of two DATE Data Type in server jobs?

can anyone help me...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No. As I stated earlier there are no data types. You need to convert to the appropriate numeric units (for example days or seconds) and subtract those.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kimbal
Participant
Posts: 21
Joined: Wed Nov 22, 2006 12:21 pm

Post by kimbal »

Hi..
we can convert A-data type to iconv and do the same for B also.after that we can subtarct the things.then finaly we can convert to oconv.i think it will solve your problem.kindly put your commands.

Regards
kimbal
muruganr117
Participant
Posts: 40
Joined: Sun Jan 21, 2007 1:52 pm
Location: Chennai
Contact:

Post by muruganr117 »

kimbal wrote:Hi..
we can convert A-data type to iconv and do the same for B also.after that we can subtarct the things.then finaly we can convert to oconv.i think it will solve your problem.kindly put your commands.

Regards
kimbal
Hi Kimbal,

Sound the same as Ray, it is how we handle,

Iconv(DATE1[1, 8], "D") - Iconv(DATE2[1, 8], "D") will give u diff btw dates, not TIMESTAMP, this can be edited and used. refer Iconv functions

regards
tsn
Participant
Posts: 51
Joined: Wed Jan 10, 2007 1:32 am

Post by tsn »

You can use this following in the derivation side

oconv(iconv(DSLink2.a,"MTS")- iconv(DSLink2.b,"MTS"),"MTS")

for example, A-11:20:30 and B-11:20:20 then C will be 00:00:10

you can has the target as sequential file. It can be stored as timestamp. try this and pass on your comments.

tks and cheers,
TSN
with regards,
tsn
Post Reply