Hi all,
I need some help regarding calling a job from job control code .
Iam having one job Test_Job which takes data from oracle table and load's into the sequentail file.
And DSNAME, DSUSER are environmental variables. And the job ran fine.
But when i tried to call from job control i got some fatal error like.And batch job is :: Batch_Test
Batch_Test..JobControl (fatal error from DSSetParam): Job control fatal error (-1)
(DSSetParam) Invalid job handle <Missing or NULL>
I wrote below code in the job control
hJob2 = DSAttachJob("Test_Job ", DSJ.ERRFATAL)
errcode = DSSetParam(hJob2, "DBNAME",$DBNAME)
errcode = DSSetParam(hJob2, "DBUSER",$DBUSER)
ErrCode = DSRunJob(hJob2, DSJ.RUNNORMAL)
And i used DBNAME,DBUSER as environmental variables in the batch job.
And i'm trying tyo pass DBANME,DBUSER values from the Batch job to the calling job.
Any ideas what i'm missing.
Thanks in advance
Fatal error while calling a job from Job Control Code
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Thanks for your quick reply.
Can you please clarify me on the below piece of code . I used the DBNAME,DBUSER as an environmental varibles in the batch job and set default value as $PROJDEF .And i want to pass those values to the calling job
errcode = DSSetParam(hJob2, "$DBNAME",$DBNAME)
errcode = DSSetParam(hJob2, "$DBUSER",$DBUSER)
And the syntax for DSSetParam is::
ErrCode = DSSetParam (JobHandle, ParamName, ParamValue)
Can i give $PROJDEF in the ParamValue.
So how can ipass the those parametrs to the calling job.
Can you please clarify me on the below piece of code . I used the DBNAME,DBUSER as an environmental varibles in the batch job and set default value as $PROJDEF .And i want to pass those values to the calling job
errcode = DSSetParam(hJob2, "$DBNAME",$DBNAME)
errcode = DSSetParam(hJob2, "$DBUSER",$DBUSER)
And the syntax for DSSetParam is::
ErrCode = DSSetParam (JobHandle, ParamName, ParamValue)
Can i give $PROJDEF in the ParamValue.
So how can ipass the those parametrs to the calling job.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If you have set them as $PROJDEF in the job and those values are correct for the project, then there's absolutely no need to 'set' or pass them to the job in any fashion. That's the whole point, after all. Unless you are trying to override the project default, of course... are you?
To that same point, a job parameter who's value is $DBNAME does not need to be explicitly set to $DBNAME to run it, it will automatically pick that value up from the environment. Again, the whole point.
To that same point, a job parameter who's value is $DBNAME does not need to be explicitly set to $DBNAME to run it, it will automatically pick that value up from the environment. Again, the whole point.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: