Page 1 of 1

LOG WITH THE NAME OF THE COLUMN ...

Posted: Fri Nov 14, 2003 8:17 am
by MARKO970
HI,
thans all for your help.

I have a job as follow :

an input seq file ----> trasformer------> db2 stage.

i need to insert in a table a log message for each record rejected.
the message have to contain the name of the column that raise the error.
how can i do????

thanks to all.

Posted: Fri Nov 14, 2003 8:33 am
by Rahul
If you know what the condition is that would reject the record then
use the constraint rather than default reject. When you use a constraint
you can trap (know) the column that is causing the reject and assign this to a stage variable and get this passed over as a derivation.

If anyone has a better way of getting this done, please suggest

Rahul

Posted: Fri Nov 14, 2003 8:33 am
by 1stpoint
This is of course dependent on your business rules for validating each column. You basically interrogate each condition and report the column.


Seq File -> Transformer --> Db2 stage (insert/update)
--> Log/Errors Stage (constraint
contains the business rules for validation).

Log/Errors

DsJobName DatStageJobName
@INROWNUM InputRowNum
If (col1...Then 'col1' else if col2... then 'col2') Error Message
...


I have a job as follow :

an input seq file ----> trasformer------> db2 stage.

i need to insert in a table a log message for each record rejected.
the message have to contain the name of the column that raise the error.
how can i do????

thanks to all.

Posted: Sun Nov 16, 2003 9:25 pm
by Teej
1stpoint wrote:This is of course dependent on your business rules for validating each column. You basically interrogate each condition and report the column.


Seq File -> Transformer --> Db2 stage (insert/update)
--> Log/Errors Stage (constraint
contains the business rules for validation).

Log/Errors

DsJobName DatStageJobName
@INROWNUM InputRowNum
If (col1...Then 'col1' else if col2... then 'col2') Error Message
...
You can also do a --> Transform Stage --> db2 (output to log) instead of Log/Error Stage (which I hope the above author intends to say as a buildop, not as a BASIC script...) Within the transform stage, you can pre-format the output for whatever format your log table is.

I am not sure about DB2 (as I don't have DataStage here), but I know that Oracle have an option where you must explicitly state to output rejected row within the output stage.

I hope we both provided you with enough to resolve your issues.

-T.J.