I am trying to run a job from another job using a sub-routine.
i created a job BasicTrial
SeqFile-->Transformer---->seqFile
In the Transformer i called a subroutine BasicTrial("JobName") In my case it looked like BasicTrial("AcctCustSeqTrial")
My Job AcctCustSeqTrial is compiled and in runnable state
The code for my Subroutine BasicTrial("JobName"):
--------------------------------------------------------------
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
jobHandle = DSAttachJob(JobName, DSJ.ERRFATAL)
Ans = DSRunJob(jobHandle,DSJ.RUNNORMAL)
--------------------------------------------------------------
My Main job is getting Aborted with a fatal error saying:
BasicTrial..Transformer_1 (fatal error from DSRunJob): Job control fatal error (-2)
(DSRunJob) Job AcctCustSeqCreation is not in a runnable state
The Documentation claimed that the handle will automatically get detached so i modified my code as below
-------------------------------------------------------------------
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
jobHandle = DSAttachJob(JobName, DSJ.ERRFATAL)
ErrMode1 = DSRunJob(jobHandle,DSJ.RUNNORMAL)
ErrHandle = DSDetachJob(jobHandle)
jobHandle1 = DSAttachJob(JobName,DSJ.ERRNONE)
Ans = DSGetJobInfo(jobHandle1,DSJ.JOBSTATUS)
-------------------------------------------------------------------------
Now the Job is running forever
Can anyone please tell me how i should go about achieving my objective
P.S The above code i modifed the last line as
Ans = DSGetJobInfo(jobHandle1,DSJ.JOBNAME)
it again got aborted
![Sad :(](./images/smilies/icon_sad.gif)
Thanks for the responses in advance
Thanks and Regards
Pavan