After job subroutine aborts
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 247
- Joined: Thu Apr 27, 2006 6:38 am
- Location: Hyderabad
After job subroutine aborts
Hi All,
Following is the code to abort the job if the link count of a reject link is greater that zero.
$INCLUDE DSINCLUDE JOBCONTROL.H
hJob = DSAttachJob("EDQS_CIS_SEGMENTATION", DSJ.ERRFATAL)
If NOT(hJob) Then
Call DSLogFatal("Job Attach Failed", "JobControl")
Abort
End
RowCount = DSGetLinkInfo(hJob,"Lkp_For_IDs","Lnk_Cpy_Reject", DSJ.LINKROWCOUNT)
if RowCount=0 then
call DSLogInfo("Lookup with EDQS_CALENDAR or EDQS_BATCH_DIM passed", "rt_segment_lkp")
end
Else
call DSLogFatal("Lookup with EDQS_CALENDAR or EDQS_BATCH_DIM failed","rt_segment_lkp")
Abort
end
Deterr = DSDetachJob (hJob)
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
The job runs successfully but waits for a long time to run the after job subrountine and gives the following error.
EDQS_CIS_SEGMENTATION..AfterJob (fatal error from DSAttachJob): Job control fatal error (0)
(DSCloseJob) Cannot refer to own job handle
Any inputs..
Following is the code to abort the job if the link count of a reject link is greater that zero.
$INCLUDE DSINCLUDE JOBCONTROL.H
hJob = DSAttachJob("EDQS_CIS_SEGMENTATION", DSJ.ERRFATAL)
If NOT(hJob) Then
Call DSLogFatal("Job Attach Failed", "JobControl")
Abort
End
RowCount = DSGetLinkInfo(hJob,"Lkp_For_IDs","Lnk_Cpy_Reject", DSJ.LINKROWCOUNT)
if RowCount=0 then
call DSLogInfo("Lookup with EDQS_CALENDAR or EDQS_BATCH_DIM passed", "rt_segment_lkp")
end
Else
call DSLogFatal("Lookup with EDQS_CALENDAR or EDQS_BATCH_DIM failed","rt_segment_lkp")
Abort
end
Deterr = DSDetachJob (hJob)
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
The job runs successfully but waits for a long time to run the after job subrountine and gives the following error.
EDQS_CIS_SEGMENTATION..AfterJob (fatal error from DSAttachJob): Job control fatal error (0)
(DSCloseJob) Cannot refer to own job handle
Any inputs..
-
- Participant
- Posts: 247
- Joined: Thu Apr 27, 2006 6:38 am
- Location: Hyderabad
Closing this post. The problem got resolved.
As I am calling the after job subroutine from the same job we need to use DSJ.ME.
Please find the modified code.
$INCLUDE DSINCLUDE JOBCONTROL.H
RowCount = DSGetLinkInfo(DSJ.ME,"Lkp_For_IDs","Lnk_Cpy_Reject", DSJ.LINKROWCOUNT)
if RowCount=0 then
call DSLogInfo("Lookup with EDQS_CALENDAR or EDQS_BATCH_DIM passed", "rt_segment_lkp")
end
Else
call DSLogFatal("Lookup with EDQS_CALENDAR or EDQS_BATCH_DIM failed","rt_segment_lkp")
Abort
end
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
Thanks
As I am calling the after job subroutine from the same job we need to use DSJ.ME.
Please find the modified code.
$INCLUDE DSINCLUDE JOBCONTROL.H
RowCount = DSGetLinkInfo(DSJ.ME,"Lkp_For_IDs","Lnk_Cpy_Reject", DSJ.LINKROWCOUNT)
if RowCount=0 then
call DSLogInfo("Lookup with EDQS_CALENDAR or EDQS_BATCH_DIM passed", "rt_segment_lkp")
end
Else
call DSLogFatal("Lookup with EDQS_CALENDAR or EDQS_BATCH_DIM failed","rt_segment_lkp")
Abort
end
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
Thanks
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
Trying to abort the same job using its after job subroutine.
Use the "Abort After Rows" option in the Transformer for reject link. A routine is not really required.
Use the "Abort After Rows" option in the Transformer for reject link. A routine is not really required.
Following is the code to abort the job if the link count of a reject link is greater that zero.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
-
- Participant
- Posts: 247
- Joined: Thu Apr 27, 2006 6:38 am
- Location: Hyderabad
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
Specify the 'Condition' in Lookup stage to fail.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
-
- Participant
- Posts: 247
- Joined: Thu Apr 27, 2006 6:38 am
- Location: Hyderabad
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 247
- Joined: Thu Apr 27, 2006 6:38 am
- Location: Hyderabad
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: