Hi,
I created a batch file in windows that runs a DS job. I want to check the status of the job and then decide whether a reset is needed. I am having trouble capturing and reusing the result of the status in a variable. Here is my code:
REM GET status info
%DSJOBPATH%\dsjob -jobinfo %PROJECT% %DSJOB%
how do I capture and reuse the result of above in an if statement.
This line DOES NOT WORK:
JOB_STATUS=%DSJOBPATH%\dsjob -jobinfo %PROJECT% %DSJOB%
Thanks,
Juls.
capture -jobinfo result in windows batch
Moderators: chulett, rschirm, roy
Thanks, do you, by chance, have a sample how to check the file, how do I parse it?chulett wrote:Redirect the output to a file, then check the file. ...
Here is what the file has:
Job Status : RUN OK (1)
Job Controller : not available
Job Start Time : Tue Apr 15 11:24:43 2008
Job Wave Number : 7
User Status : not available
Job Control : 0
Interim Status : NOT RUNNING (99)
Invocation ID : not available
Last Run Time : Tue Apr 15 11:25:08 2008
Job Process ID : 0
Invocation List : seq_STAGING
What exact information are you looking for? Just to know if the job is aborted? I use grep for that in a shell script, something like this:
I just have no clue how to do this in a batch without the MKS Toolkit, if you have that available you can do shell scripting rather than a batch file, from what I understand.
Code: Select all
eCount=`grep '(3)' /tmp/dsjob$$.out |wc -l`
if [ $eCount -eq 1 ] ;then
echo "Job is aborted and must be reset..."
<run reset>
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers