It needs unix/linux working knowledge. You can try in windows env too.
After login declare one empty file, run file.
label each dml for ease of retrieval.
perform your dml
check error code such as exit if it does not work.
If it passes thru, then redirect '.goto "your next sequence" > to that file.Here you can use os command.
Since you label each DML , so it replaces each one when it passes thru.
Suppose if it fails at any point of time and you re run, then that run file has the last content of that unix file, so it goes to that label.
Hope it is clear.