检查日志并根据收到的计数中止作业 [英] Check the logs and abort the jobs on the basis of the count received
问题描述
对于我的代码,我为 5 个不同的表生成了 5 个日志.我必须找到哪个表的记录没有正确加载.
For my code , I have 5 logs generated for 5 different tables . I have to find for which table the records are not loaded correctly .
生成的日志
NWPR_TempLoad_CSP_11.log:由于数据错误,0 行未加载.NWPX_TempLoad_CSP_11.log:由于数据错误,326 行未加载.PRAD_TempLoad_CSP_11.log:由于数据错误,0 行未加载.PRER_TempLoad_CSP_11.log:由于数据错误,0 行未加载.PROV_TempLoad_CSP_11.log:由于数据错误,0 行未加载.PRSQ_TempLoad_CSP_11.log:由于数据错误,0 行未加载.PRWM_TempLoad_CSP_11.log:由于数据错误,0 行未加载.
Logs generated
NWPR_TempLoad_CSP_11.log: 0 Rows not loaded due to data errors.
NWPX_TempLoad_CSP_11.log: 326 Rows not loaded due to data errors.
PRAD_TempLoad_CSP_11.log: 0 Rows not loaded due to data errors.
PRER_TempLoad_CSP_11.log: 0 Rows not loaded due to data errors.
PROV_TempLoad_CSP_11.log: 0 Rows not loaded due to data errors.
PRSQ_TempLoad_CSP_11.log: 0 Rows not loaded due to data errors.
PRWM_TempLoad_CSP_11.log: 0 Rows not loaded due to data errors.
在这里我们可以看到,由于数据错误,NWPX 326 未加载.所以我希望作业中止,并且在我们需要打印的错误消息中,作业因 NWPX 加载而中止
Here we can see that for NWPX 326 were not loaded due to data errors . so I want the job to abort and in the error message we neeed to print , job aborted for NWPX load
推荐答案
一个选项是定义来自连接器的拒绝链接,用于编写目标表.使用拒绝链接,您可以指定在拒绝链接上的行数 >= 1
One option is to define a reject link from the Connector with which you write the target table. With a reject link you can specify to abort the job if number of rows on that reject link is >= 1
无论如何,作业日志应该包含有关被拒绝记录的信息.
The job log should have the information about the rejected record anyways.
要了解更多详细信息,应更详细地描述阶段和确切要求.
For more details the stages and exact requirements should be described in more detail.
这篇关于检查日志并根据收到的计数中止作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!