View previous topic :: View next topic
|
Author |
Message |
monasu1998
Active User
Joined: 23 Dec 2005 Posts: 176 Location: India
|
|
|
|
Hi All,
As we can code TERMINATE <nn> to terminate a program conditionally (usually) is there any statements that can be used to restart a natural program after termination by a TERMINATE statement?
E.g.
At Line No 2000:
IF #REC-TYPE NE 'D'
TERMINATE 99
ELSE
<SOME OTHER STATEMENTS>
END-IF
Can we restart the same program after the conditional statement when executing for 2nd time (not from the top).
Thanks |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you want to "restart" an abended or terminated run, you need to provide the mechanism to do so - it is not automatic.
Usually, it is quicker and safer to restart from the beginning. If your requirement includes restart/recovery processing, you need to talk with others on your project and/or your dbs(a) to see how this is handled on your system. When you implement, your process should be similar to other processes that provide restart capability. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
The data supplied after the END TRANSACTION statement can be used after restart with the GET TRANSACTION DATA statement to continue processing from a syncpoint.
O. |
|
Back to top |
|
|
monasu1998
Active User
Joined: 23 Dec 2005 Posts: 176 Location: India
|
|
|
|
Hi Ofer,
If Get Transaction Data is one option, I am still confused on how to go.
Once the program is terminated, the natural session also terminates and there will not be any dta retained for a restart.
How can this be possible. No automated process required.
If we can set any indicator, to be checked before start of the program and conditionally start from the beginning or from a specific statement.
Fact is that it was an Interview question. |
|
Back to top |
|
|
|