Reading the data from DB ( 2 file systems)

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
DSFreddie
Participant
Posts: 130
Joined: Wed Nov 25, 2009 2:16 pm

Reading the data from DB ( 2 file systems)

Post by DSFreddie »

I have a Scenario as follows,

*) I need to take Max(TimeStamp) from DB2 table
*) Based on this Max(TimeStamp) value, i need to extract (Select *) from a DB2 Mainframe table.


I tried doing it thru 2 jobs & calling it through a sequencer.(One execute command activity also)

My first job will take MaX(Timestamp) & write it to a file ( Here the conversion of Timestamp to String is done)

In the sequencer, I am using an execute command Activity that will read the file.A script will output the timestamp value.

In the 3rd job activity. the output of the Exec COmmand will be passed will be passed as a parameter (max(Date)) to the Select clause.


The issue is the output of the command activity is not getting passed to this parameter.


Can you pls confirm whether the logic I am following is correct?

Is there any better ways of doing this ?

Thanks for your help.

Freddie
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The general approach is correct. How are you parsing the return string?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Are you getting any errors? How are you determining that it is 'not getting passed' rather than some other error in your usage of the parameter? Are you handling the Field Mark (@FM) that the Execute Command stage will have in its output? Details would help us help you.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSFreddie
Participant
Posts: 130
Joined: Wed Nov 25, 2009 2:16 pm

Re: Reading the data from DB ( 2 file systems)

Post by DSFreddie »

Thanks All for your reply.

I have passed the execute command activity (Using the Field function).

Now, the issue I am facing is in this particular Select statement.

select * from schema.table where update_ts > to_date(substr('2010-07-21 10:45:33.257868',1,19),'YYYY-MM-DD HH24:MI:SS')

This is a DB2 Table. Instead of the Timestamp value, i have given, I have a parameter,Max(Date).

The error I encounter is as follows,

"When reading database column DATETIME(fraction=6) into column DATETIME(fraction=0), truncation, loss of precision or data corruption can occur"

Thanks for your reply.
Freddie
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That's not an error - it's a metadata mismatch alert. One side you have a timestamp that supports microseconds (fraction=6) whereas on the other side you have a timestamp that does not support fractional seconds at all (fraction=0). Tidy up your metadata or, if this is not possible, use a message handler to demote the warning severity to informational.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply