Index: trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7474)
+++ trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7477)
@@ -63,4 +63,34 @@
 }
 
+function finish()
+{
+   rm -v $todofile
+   rm -v $lockfile
+   date 
+   exit
+}
+
+function getdolist()
+{
+   datetime=`date +%F-%H-%M-%S`
+   year=`date +%Y`
+   date=NULL
+   
+   getstatuslogpath=$logpath/getstatus/$program/$year
+   getstatuslog=$getstatuslogpath/getstatus-$table-$column-$datetime.log
+   makedir $getstatuslogpath
+
+   # get todo list
+   echo "getting todo list..."
+   check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatus | grep int | sed -e 's/(int)//'`
+
+   case $check0 in
+      1)   echo "check0=$check0 -> everything ok, got todo list -> run $program";;
+      *)   echo "check0=$check0 -> ERROR -> could not get todo list -> exit"
+           finish ;;
+   esac
+
+}
+
 function resetstatusvalues()
 {
@@ -118,5 +148,6 @@
    case $checkstatus in
       1)   echo "checkstatus=$checkstatus -> everything ok, status has been set";;
-      *)   echo "checkstatus=$checkstatus -> ERROR -> step could not be set";;
+      *)   echo "checkstatus=$checkstatus -> ERROR -> step could not be set -> exit"
+           finish ;;
    esac
 }
