LOG WITH THE NAME OF THE COLUMN ...

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
MARKO970
Participant
Posts: 20
Joined: Thu Nov 13, 2003 5:46 am

LOG WITH THE NAME OF THE COLUMN ...

Post 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.
Rahul
Participant
Posts: 19
Joined: Wed Oct 29, 2003 10:21 pm

Post 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
1stpoint
Participant
Posts: 165
Joined: Thu Nov 13, 2003 2:10 pm
Contact:

Post 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.
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post 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.
Developer of DataStage Parallel Engine (Orchestrate).
Post Reply