how to pass UNIX script(Procedure) output to job parameter?
Moderators: chulett, rschirm, roy
how to pass UNIX script(Procedure) output to job parameter?
Hi,
I have a db2 procedure in my UNIX script,when i execute it returns a value,i need to pass that value into (Job Parameter) to use in Transformer.
I tried with execSH and i passed path and file name as Input Value.
Then how to pass that output to job parameter?
Thanks
Beeram
I have a db2 procedure in my UNIX script,when i execute it returns a value,i need to pass that value into (Job Parameter) to use in Transformer.
I tried with execSH and i passed path and file name as Input Value.
Then how to pass that output to job parameter?
Thanks
Beeram
From a before-job routine? Can't set a jobs parameter values from its before-job routine. Consider using a staging variable in your transformer, and for the initialization of the value do the ExecSH call to your script to get the startup value.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Using a Sequencer a Routine stage can call your script, or in Batch a CALL DSExecute(...) will return the screen output and return code of the script. Choose your weapon.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Thanks bland, i am almost done
but still i have doubt on passing value :
Below is my code :
hjob1=DSAttachJob("demojob2",DSJ.ERRFATAL)
IF NOT(hjob1) then
CALL DSlogFatal("Job Failed:demojob2","JOB ABORTED")
END
Unixcmd="/fdev/users/10001/Proc.shl"
CALL DSExecute("UNIX",Unixcmd,Scroutput,RetCode)
how to pass Scroutput(output) value to parameter ?
Thanks
Beeram
but still i have doubt on passing value :
Below is my code :
hjob1=DSAttachJob("demojob2",DSJ.ERRFATAL)
IF NOT(hjob1) then
CALL DSlogFatal("Job Failed:demojob2","JOB ABORTED")
END
Unixcmd="/fdev/users/10001/Proc.shl"
CALL DSExecute("UNIX",Unixcmd,Scroutput,RetCode)
how to pass Scroutput(output) value to parameter ?
Thanks
Beeram
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
ray.wurlod wrote:ErrCode = DSSetParam(hJob, ParamName, ScrOutput)
Code: Select all
ErrCode = DSSetParam([i]hJob[/i], [i]ParamName[/i], ScrOutput<1>)
Mamu Kim
Thanks Bland,
I wrote this code in job control within the same job.
and i declared a parameter ScrOutput in job parameters with some default value then i called ScrOutput parameter into Transformer.
This not working properly .when i ran it is taking time ,never end the job
unless i kill that one.
hjob=DSAttachJob("demojob",DSJ.ERRWARN)
status=DSRunJob(hjob,DSJ.RUNNORMAL)
Unixcmd="/fdev/users/11001/Proc.shl"
CALL DSExecute("UNIX",Unixcmd,ScrOutput,RetCode)
ErrCode=DSSetParam(hjob,"ScrOutput",ScrOutput)
Thanks
Beeram
I wrote this code in job control within the same job.
and i declared a parameter ScrOutput in job parameters with some default value then i called ScrOutput parameter into Transformer.
This not working properly .when i ran it is taking time ,never end the job
unless i kill that one.
hjob=DSAttachJob("demojob",DSJ.ERRWARN)
status=DSRunJob(hjob,DSJ.RUNNORMAL)
Unixcmd="/fdev/users/11001/Proc.shl"
CALL DSExecute("UNIX",Unixcmd,ScrOutput,RetCode)
ErrCode=DSSetParam(hjob,"ScrOutput",ScrOutput)
Thanks
Beeram
You first run demojob and then you still want to put a parameter on it. Your order is wrong:vbeeram wrote: hjob=DSAttachJob("demojob",DSJ.ERRWARN)
status=DSRunJob(hjob,DSJ.RUNNORMAL)
Unixcmd="/fdev/users/11001/Proc.shl"
CALL DSExecute("UNIX",Unixcmd,ScrOutput,RetCode)
ErrCode=DSSetParam(hjob,"ScrOutput",ScrOutput)
- first execute your UNIX script (and remember about the limited environment you get)
- DSAttachJob
- DSSetParam
- DSRunJob
Ogmios
In theory there's no difference between theory and practice. In practice there is.
Attach, check status, reset if necessary and detach and attach again, set all parameters, set run limits, run job, wait for finish, check status.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle