I want to ETL the rowcount of my jobs , and for it we adopted a dev pattern and created an after-job routine that get the values and inserts them in a table. But when routine is executed from a job that does not have the link, the routine aborts:
LDWDim_Age..AfterJob (fatal error from DSGetLinkInfo): Job control fatal error (-9)
(DSGetLinkInfo) Unknown link INS in stage SRK of job LDWDim_Age
My code is the following:
Code: Select all
IF DSGetLinkInfo(DSJ.ME, "SRK","INS", DSJ.LINKROWCOUNT) = DSJE.BADLINK THEN
ErrCode = DSSetParam(hJob1, "QTD_RGT_INS", 0)
END
ELSE
ErrCode = DSSetParam(hJob1, "QTD_RGT_INS",DSGetLinkInfo(DSJ.ME, "SRK","INS", DSJ.LINKROWCOUNT) )
END
Am i doing something wrong? I know there is other ways to check if a link exists on a job, looking into STAGE and LINK lists, but im just curious about this behavior, would be much more easy to just take error code just like other errors...
Thanks in advance.