Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

confusing problem

Status
Not open for further replies.

vti

Technical User
Feb 26, 2001
189
TR
Hi

I have a file which includes batch file names like :
-----------
car.cc
table.cc
motor.cc
bike.cc
planet.cc
month.cc
-----------

and it works everday.But i would like to check that ,for example when month.cc start to run it must check the all job which are supposed to runs before month.cc.And must check if they run before or not.Every single job must check before jobs which has to work before .if not it must stop running and must give me error message.

I though a way to put all jobname a file and put something in top of every single batch file that when it runs go to that file and check are there job names which are has to work before ?But how.?

Sorry about my explanation .I know it's confusing but i have tried to explain ..

Thanks for any help.
 
So, why not just run them in sequential mode in a script ? Check the result code ($?) after each one, and if it is not zero, exit the main script.

Bill.
 
That is not enough cause sometimes some job(s) runs by operators manually .And if they run a wrong job name there is no any error message and i can't know is something goes wrong until all job has finished.If they jump to another job without run which has to work before it means you have to start from the begining.It's not really good for us.
Example :

car.cc
table.cc
exit
motor.cc
bike.cc
planet.cc
month.cc

it's stoped by operator writing exit after table.cc finished.And the operator has to run motor.cc on next but if he run another one by mistake that is the my problem.My joblist is same for everyday.And it has 350 job.

I hope it's explain enough.

Thanks.
 
So, you need predecessor-links (That is what CA/Unicenter calls them). Here is a possible suggestion...

Upon successful completion of each job, put an entry in a tag file that is the process-id of the job that should run next. So, in your list of programs, before car.cc finishes, it puts "table.cc" in some file somewhere, then exits. Each program should check the contents of this file, and compare it to `basename $0`. If it is the same, then the proper program is running. If not, the program should exit and print an error message (or optionally, just start the proper program automatically).

Upon completion of the last job, the job name of the first job should be placed back in the tag file.

Obviously, if the tag file is removed, the predecessor links are gone.

What do you think ?

Bill.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top