Index: trunk/MagicSoft/Mars/scripts/processsequence
===================================================================
--- trunk/MagicSoft/Mars/scripts/processsequence	(revision 8493)
+++ trunk/MagicSoft/Mars/scripts/processsequence	(revision 8494)
@@ -99,4 +99,5 @@
 }
 
+subsystemdatapath=/magic/subsystemdata
 
 interactive="yes"
@@ -227,24 +228,13 @@
       echo "calfile: "$calfile
       outpath=`dirname $calfile`
-      echo "outpath: "$outpath
-
-      merpplogpath=$outpath"/merpplogs"
-      mkdir -pv $merpplogpath
-
+
+      runno=`echo $calfile | cut -d_ -f2 | sed -e 's/^0//' | sed -e 's/^0//' | sed -e 's/^0//' `
+      echo "finding cc and cacofile for run $runno..."
       date=`date --date \`basename $calfile | cut -d_ -f1\` +%Y/%m/%d`
       ccpath=$subsystempath/cc/$date
       cacopath=$subsystempath/caco/$date
-      runno=`echo $calfile | cut -d_ -f2 | sed -e 's/^0//' | sed -e 's/^0//' | sed -e 's/^0//' `
       ccfile=`find $ccpath -name 20[0-2][0-9][01][0-9][0-3][0-9]_*${runno}_[PDCS]_*_S.rep`
       source=`echo $ccfile | cut -d_ -f4`
-      cacofile=`find /magic/subsystemdata/caco/$date -name dc_20[0-2][0-9]_[01][0-9]_[0-3][0-9]_*${runno}_${source}.txt`
-      echo "runno: "$runno
-      echo "ccfile: "$ccfile
-      if [ "$ccfile" = "" ]
-      then
-         echo "no ccfile found for run "$runno
-         break
-      fi
-      echo "cacofile: "$cacofile
+      cacofile=`find $cacopath -name dc_20[0-2][0-9]_[01][0-9]_[0-3][0-9]_*${runno}_${source}.txt`
       if [ "$cacofile" = "" ]
       then
@@ -260,8 +250,22 @@
             else
                break
-               echo "cacofile: "$cacofile
             fi
          done
       fi
+      if [ "$ccfile" = "" ]
+      then
+         echo "no ccfile found for run "$runno
+         exit
+      fi
+      if [ "$cacofile" = "" ]
+      then
+         echo "no cacofile found for run "$runno
+         exit
+      fi
+      echo "ccfile: "$ccfile
+      echo "cacofile: "$cacofile
+
+      merpplogpath=$outpath"/merpplogs"
+      mkdir -pv $merpplogpath
 
       program=merppccupdate
