restart logic in a script

Hi
I have a script as follows

Function func0
<Set of validations done>
Function Func1
<Set of commands and some of the variables set>
Function Func2
<Set of commands and some of the varibales set>
Function Func3
<Call a job(It is a datastage job which is called>

Main job
Call func0
Call Func1
Call Func3 <parameter 1>
Call Func2
Call func3 <parameter 2>

I want to implement restart logic in this script..If the script aborts at
"Call Func3 <parameter 1>" then it should start at the same place.

Also I dont want to call all the previous functions called, i want to store them in a separate file.

Any ideas how this can be done?

loop the function, if your function doesn't succeed the way you want. exit with the appropriate exit code, then restart the loop. Id give a code example but I dont know what language you are using.

Hi, thanks for your response, can you send me a sample script.

I am just using the shell script(ksh) no other language.