Index: trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7480)
+++ trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7482)
@@ -98,5 +98,5 @@
       1)   echo "check1=$check1 -> everything ok -> setting status for $date..." >> $scriptlog 2>&1;;
       *)   echo "check1=$check1 -> ERROR - $program.C failed for $date -> step has to be repeated" >> $scriptlog 2>&1
-           com="building of sequences for date $date failed"
+           com=$Fbuildsequ
            check=$check1
            ;;
Index: trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail	(revision 7480)
+++ trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail	(revision 7482)
@@ -99,5 +99,5 @@
       1)   echo "check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 ;;
       *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-           com="checking availability of files for sequence $sequence failed"
+           com=$Ffilesavail
            check=$check1
            ;;
Index: trunk/MagicSoft/Mars/datacenter/scripts/checkstardone
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/checkstardone	(revision 7480)
+++ trunk/MagicSoft/Mars/datacenter/scripts/checkstardone	(revision 7482)
@@ -112,5 +112,6 @@
          *)   echo "check1=$check1 -> ERROR " >> $scriptlog 2>&1 
               echo "starfiles not available for sequence -> continue" >> $scriptlog 2>&1 
-              com="starfile missing for sequence $sequence"
+              com=$Fstardone
+              comadd=$sequence
               check=$check1
               break
Index: trunk/MagicSoft/Mars/datacenter/scripts/correcttime
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/correcttime	(revision 7480)
+++ trunk/MagicSoft/Mars/datacenter/scripts/correcttime	(revision 7482)
@@ -96,5 +96,5 @@
      1)   echo "check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 ;;
      *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 ;;
-          com="time correction for run $run failed"
+          com=$Ftimecorr
           check=$check1
           ;;
Index: trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck	(revision 7480)
+++ trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck	(revision 7482)
@@ -156,5 +156,5 @@
             ;;
        *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-            com="filldotraw for run $run failed"
+            com=$Ffillraw
             check=$check1
             setstatus "stop" >> $scriptlog 2>&1
@@ -181,5 +181,6 @@
                ;;
           *)   echo "check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-               com="sinope for run $run failed"
+               com=$Fsinope
+#               comadd=
                check=$check2
                setstatus "stop" >> $scriptlog 2>&1
@@ -201,5 +202,5 @@
             ;;
        *)   echo "check3=$check3 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-            com="fillsinope for run $run failed"
+            com=$Ffillsinope
             check=$check3
             setstatus "stop" >> $scriptlog 2>&1
@@ -219,5 +220,6 @@
            ;;
       *)   echo "check5=$check5 -> ERROR -> step could not be resetted -> repeat step " >> $scriptlog 2>&1
-           com="reset status for fExclusionsDone for date $date2 failed"
+           com=$Fresetexcl
+           comadd=`echo $date2 | sed -e 's/-//g'`
            check=$check5
            setstatus "stop" >> $scriptlog 2>&1
Index: trunk/MagicSoft/Mars/datacenter/scripts/doexclusions
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/doexclusions	(revision 7480)
+++ trunk/MagicSoft/Mars/datacenter/scripts/doexclusions	(revision 7482)
@@ -98,5 +98,5 @@
       1)   echo "check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 ;;
       *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 ;;
-           com="doing exclusions for date $date failed"
+           com=$Fdoexcl
            check=$check1
            ;;
Index: trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto	(revision 7480)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto	(revision 7482)
@@ -105,5 +105,5 @@
       1)   echo "check1=$check1 -> everything ok -> run fillsignal " >> $scriptlog 2>&1 ;;
       *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-           com="fillcalib for sequence $sequence failed"
+           com=$Ffillcalib
            check=$check1
            setstatus "stop" >> $scriptlog 2>&1
@@ -115,5 +115,5 @@
       1)   echo "check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;;
       *)   echo "check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-           com="fillsignal for sequencec $sequence failed"
+           com=$Ffillsignal
            check=$check2
            ;;
Index: trunk/MagicSoft/Mars/datacenter/scripts/fillganymed
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillganymed	(revision 7480)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillganymed	(revision 7482)
@@ -101,5 +101,5 @@
       1)   echo "check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;;
       *)  echo "check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-          com="fillganymed for dataset $dataset failed"
+          com=$Ffillganymed
           check=$check2
           ;;
Index: trunk/MagicSoft/Mars/datacenter/scripts/fillstar
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillstar	(revision 7480)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillstar	(revision 7482)
@@ -102,5 +102,5 @@
       1)   echo "check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;;
       *)   echo "check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-           com="fillstar for sequence $sequence failed"
+           com=$Ffillstar
            check=$check2
            ;;
Index: trunk/MagicSoft/Mars/datacenter/scripts/runcallisto
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runcallisto	(revision 7480)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runcallisto	(revision 7482)
@@ -194,5 +194,6 @@
              then
                 echo "no ccfile found for run "$runno >> $scriptlog 2>&1
-                com="no ccfile for run $runno"
+                com=$Fnoccfile
+                comadd=$runno
                 check=0
                 break
@@ -216,5 +217,6 @@
                       then
                          echo "no cacofile found" >> $scriptlog 2>&1
-                         com="no cacofile for run $runno"
+                         com=$Fnocacofile
+                         comadd=$runno
                          check=0
                       fi   
@@ -231,5 +233,6 @@
                      0)   echo "check2=$check2 -> everything ok, merppccupdate worked -> continue" >> $scriptlog 2>&1;;
          	     *)   echo "check2=$check2 -> ERROR -> merppccupdate failed" >> $scriptlog 2>&1
-                          com="merppccupdate failed for run $runno"
+                          com=$Fmerppcc
+                          comadd=$runno
                           check=$check2
                           break ;;
@@ -240,5 +243,6 @@
                      0)   echo "check3=$check3 -> everything ok, merppcacoupdate worked -> continue" >> $scriptlog 2>&1;;
          	     *)   echo "check3=$check3 -> ERROR -> merppcacoupdate failed" >> $scriptlog 2>&1
-                          com="merppcacoupdate failed for run $runno"
+                          com=$Fmerppcaco
+                          comadd=$runno
                           check=$check3
                           break ;;
@@ -247,5 +251,5 @@
   	  ;;
      *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-          com="calibration failed"
+          com=$Fcallisto
           check=$check1
           ;;
Index: trunk/MagicSoft/Mars/datacenter/scripts/runganymed
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runganymed	(revision 7480)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runganymed	(revision 7482)
@@ -155,5 +155,5 @@
      0)   echo "check1=$check1 -> everything ok " >> $scriptlog 2>&1 ;;
      *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-          com="ganymed failed"
+          com=$Fganymed
           check=$check1
           ;;
Index: trunk/MagicSoft/Mars/datacenter/scripts/runstar
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runstar	(revision 7480)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runstar	(revision 7482)
@@ -147,5 +147,5 @@
      0)   echo "check1=$check1 -> everything ok " >> $scriptlog 2>&1;;
      *)   echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
-          com="star failed"
+          com=$Fstar
           check=$check1
           ;;
Index: trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7480)
+++ trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7482)
@@ -50,4 +50,33 @@
 
 
+#failed codes
+#sequence build status
+Fbuildsequ=1
+Fdoexcl=2
+#run process status
+Ftimecorr=3
+Ffillraw=4
+Fsinope=5
+Ffillsinope=6
+Fresetexcl=7
+#sequence process status
+Fwritesequfile=8
+Ffilesavail=9
+Fnoccfile=10
+Fnocacofile=11
+Fmerppcc=12
+Fmerppcaco=13
+Fcallisto=14
+Ffillcalib=15
+Ffillsignal=16
+Fstar=17
+Ffillstar=18
+#dataset process status
+Fstardone=19
+Fganymed=20
+Ffillganymed=21
+
+
+
 function finish()
 {
@@ -97,6 +126,7 @@
    statustime=NULL
    starttime=NULL
+   returncode=NULL
    failedcode=NULL
-   failedcomment=NULL
+   failedcodeadd=NULL
    failedtime=NULL
 }
@@ -107,6 +137,7 @@
    echo " statustime=$statustime"
    echo " starttime=$starttime"
+   echo " returncode=$returncode"
    echo " failedcode=$failedcode"
-   echo " failedcomment=$failedcomment"
+   echo " failedcodeadd=$failedcodeadd"
    echo " failedtime=$failedtime"
    echo "-- check: -$check-"
@@ -129,6 +160,7 @@
                   *)  echo " failed"
                       starttime=noreset
-                      failedcode=$check
-                      failedcomment=$com
+                      returncode=$check
+                      failedcode=$com
+                      failedcodeadd=$comadd
                       failedtime="Now()"
                       ;;
@@ -145,5 +177,5 @@
    makedir $setstatuslogpath
    setstatuslog=$setstatuslogpath/setstatus-$@-$program-$var2.log
-   checkstatus=`root -q -b $macrospath/setstatus.C+\("\"$sequence\""\,"\"$table\""\,"\"$column\""\,"\"$statustime\""\,"\"$failedcode\""\,"\"$failedcomment\""\,"\"$starttime\""\,"\"$failedtime\""\) | tee $setstatuslog | grep int | sed -e 's/(int)//'`
+   checkstatus=`root -q -b $macrospath/setstatus.C+\("\"$sequence\""\,"\"$table\""\,"\"$column\""\,"\"$statustime\""\,"\"$returncode\""\,"\"$failedcode\""\,"\"$failedcodeadd\""\,"\"$starttime\""\,"\"$failedtime\""\) | tee $setstatuslog | grep int | sed -e 's/(int)//'`
    case $checkstatus in
       1)   echo "checkstatus=$checkstatus -> everything ok, status has been set";;
Index: trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles	(revision 7480)
+++ trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles	(revision 7482)
@@ -101,5 +101,5 @@
       1)   echo "check2=$check2 -> everything ok " >> $scriptlog 2>&1 ;;
       *)   echo "check2=$check2 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
-           com="writing of sequencefile for sequence $sequence failed"
+           com=$Fwritesequfile
            check=$check2
            ;;
