Page 1 of 1

How to generate warnings when rows rejected

Posted: Thu May 03, 2018 2:00 pm
by sarathchandrakt
Hi all,

I have a sequential file capturing rejects from a db2 connector. I do not want to fail the job because I want to capture all rejects in file for analysis. But I want to abort the sequence. To achieve that, I want db2 connector to generate warnings when the rows get rejected into the sequential file. How can I achieve that. I'm already calling after job sub-routine so running a command in after job can't be achieved. Appreciate any help.

Thanks,
Sharath.

Posted: Fri May 04, 2018 1:36 am
by ray.wurlod
I assume you already have a reject link for capturing those rejected rows.

An informational message is logged when the reject link is used.

Use a local message handler to promote that message from informational to warning.

Posted: Fri May 04, 2018 6:37 am
by sarathchandrakt
I tried that. Below is the Info generated on DB2 Connector and Reject Sequential File.

"db2Connector_OUT,2: Number of rows rejected: 64"

"seq_Rejects,0: Export complete; 127 records exported successfully, 0 rejected."

But this info is generated even when there are 0 rejects which will also be shown as warning if I do that.

Posted: Fri May 04, 2018 6:48 am
by chulett
Is the first message generated even with zero rejects? I.E. something like:

"db2Connector_OUT,2: Number of rows rejected: 0"

Posted: Fri May 04, 2018 8:28 am
by FranklinE
If you must abort the job sequence, and you must also complete the after-job routine, try putting an Execute command activity next. I use a row count in a similar way, and the command output value determines the triggered link. For example, if my output file is empty, but always has a header row, if the row count is 1 I trigger a branch to an alternate file. You could easily link to a terminator stage if your reject file is 1 or more rows.