Index: trunk/MagicSoft/Mars/datacenter/macros/getdolist.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/getdolist.C	(revision 7460)
+++ trunk/MagicSoft/Mars/datacenter/macros/getdolist.C	(revision 7464)
@@ -130,5 +130,5 @@
                     rc.GetValue(table+".TimerTable", ""),
                     rc.GetValue(table+".Primary", ""));
-    query+=Form(" WHERE ISNULL(%s)", column.Data());
+    query+=Form(" WHERE ISNULL(%s) AND ISNULL(fFailed) AND ISNULL(fStartTime) AND ISNULL(fFailedTime) ", column.Data());
 
     TIter Next(&l);
Index: trunk/MagicSoft/Mars/datacenter/macros/setstatus.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/setstatus.C	(revision 7460)
+++ trunk/MagicSoft/Mars/datacenter/macros/setstatus.C	(revision 7464)
@@ -33,11 +33,13 @@
 //
 // Usage:
-//   .x setstatus.C+("primary","table","column","value",kTRUE)
+//  .x setstatus.C+("primary","table","column","statustime","failed","starttime","failedtime",kTRUE)
 // The first argument is the primary (date/run/sequence/dataset), the second
 // and third argument give the table and column of the step. The fourth
-// column is giving the value, to which the column has to be set. The last
-// argument is indicating if the columns of all influenced steps shall be
-// reset to NULL. The default is kTRUE, which means, that the columns are
-// reset.
+// column is giving the statustime, to which the column has to be set. The
+// fifth argument is giving the error code (in case of failure), the sixth
+// the starttime and the seventh the stoptime (only in case of failure).
+// The last argument is indicating if the columns of all influenced steps
+// shall be reset to NULL. The default is kTRUE, which means, that the
+// columns are reset.
 //
 // Make sure, that database and password are corretly set in a resource
@@ -63,7 +65,7 @@
 
 
-Bool_t CheckReset(TEnv &rc, TString table, TString column, TString value)
+Bool_t CheckReset(TEnv &rc, TString table, TString column, TString statustime)
 {
-    if (value!="NULL")
+    if (statustime!="NULL")
     {
         cout << "everything ok - no reset needed" << endl;
@@ -113,5 +115,5 @@
 }
 
-Int_t SetInfluences(MSQLServer &serv, TEnv &rc, TString primary, TString table, TString column, TString value, Bool_t resetall)
+Int_t SetInfluences(MSQLServer &serv, TEnv &rc, TString primary, TString table, TString column, TString statustime, TString failed, TString starttime, TString failedtime, Bool_t resetall)
 {
     cout << "set influenes for " << table << "." << column << endl;
@@ -120,6 +122,7 @@
     TString influences  = rc.GetValue(table+"."+column+".Influences", "");
 
-    TString query(Form("UPDATE %s SET %s=%s",
-                       table.Data(), column.Data(), value.Data()));
+    TString query(Form("UPDATE %s SET %s=%s, fFailed=%s, fStartTime=%s, fFailedTime=%s ",
+                       table.Data(), column.Data(), statustime.Data(), failed.Data(),
+                       starttime.Data(), failedtime.Data()));
 
     while (!influences.IsNull() && resetall)
@@ -157,5 +160,5 @@
 }
 
-int setstatus(TString primary, TString table, TString column, TString value, Bool_t resetall=kTRUE)
+int setstatus(TString primary, TString table, TString column, TString statustime, TString failed, TString starttime, TString failedtime, Bool_t resetall=kTRUE)
 {
     TEnv env("sql.rc");
@@ -176,5 +179,5 @@
 
     //if reset is needed and/or can be done, set new values
-    return !CheckReset(rc, table, column, value) ? 0 : SetInfluences(serv, rc, primary, table, column, value, resetall);
+    return !CheckReset(rc, table, column, statustime) ? 0 : SetInfluences(serv, rc, primary, table, column, statustime, failed, starttime, failedtime, resetall);
 
 }
