Page 1 of 1

Reading the data from DB ( 2 file systems)

Posted: Thu Aug 12, 2010 7:00 am
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

Posted: Thu Aug 12, 2010 7:09 am
by ArndW
The general approach is correct. How are you parsing the return string?

Posted: Thu Aug 12, 2010 7:26 am
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.

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

Posted: Fri Aug 13, 2010 10:10 am
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

Posted: Sun Aug 15, 2010 3:07 am
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.