I have a Job that one is seting in variable and in one of the two jobs that it is calling for the Job Control. Necessary that before executing same they they are resetados. Please Help me and sorry for my english.
It follows the code below:
* Setup JobExecucao_Bat_Vendas, run it, wait for it to finish, and test for success
hJob1 = DSAttachJob("JobExecucao_Bat_Vendas_1", DSJ.ERRFATAL)
If NOT(hJob1) Then
Call DSLogFatal("Job Failed: JobExecucao_Bat_Vendas_1", "JobControl")
Abort
End
ErrCode = DSRunJob(hJob1, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Then
* Fatal Error - No Return
Call DSSetUserStatus(1)
Call DSLogFatal("Job Failed: JobExecucao_Bat_Vendas_1", "JobControl")
End Else
Call DSSetUserStatus(0)
End
Open "HSH_ARQUIVO" to H.PARAMETROS Then
Read PARAM from H.PARAMETROS, 1 then
Ans = PARAM<1>
End
End
Close H.PARAMETROS
* Setup JobExecucao_Bat_Vendas_2, run it, wait for it to finish, and test for success
hJob2 = DSAttachJob("JobExecucao_Bat_Vendas_2", DSJ.ERRFATAL)
ErrCode = DSSetParam(hJob2, "pFileName", Ans)
If NOT(hJob2) Then
Call DSLogFatal("Job Failed: JobExecucao_Bat_Vendas_2", "JobControl")
Abort
End
ErrCode = DSRunJob(hJob2, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob2)
Status = DSGetJobInfo(hJob2, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Then
* Fatal Error - No Return
Call DSSetUserStatus(1)
Call DSLogFatal("Job Failed: JobExecucao_Bat_Vendas_2", "JobControl")
End Else
Call DSSetUserStatus(0)
End
Problems for Job Control
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 224
- Joined: Tue Sep 24, 2002 7:32 am
- Location: Denver, CO USA
Look in the Director log of "JobExecucao_Bat_Vendas_2". The first log entry will list the parameters for the job - see if the "pFileName" parameter is set as you expect.
You can add calls to DSLogInfo to your Job Control to write debugging statements to the log file. The format is just like the DSLogFatal calls you are currently using.
John
You can add calls to DSLogInfo to your Job Control to write debugging statements to the log file. The format is just like the DSLogFatal calls you are currently using.
John