Index: trunk/ippTasks/survey.pro
===================================================================
--- trunk/ippTasks/survey.pro	(revision 31797)
+++ trunk/ippTasks/survey.pro	(revision 31868)
@@ -33,4 +33,5 @@
  book create SURVEY_WARP_BG
  book create SURVEY_PUBLISH
+ book create SURVEY_STATICSKYSINGLE   
  $haveSurveyBooks = TRUE
 end
@@ -46,4 +47,5 @@
 $SURVEY_WARP_BG_DB = 0
 $SURVEY_PUBLISH_DB = 0
+$SURVEY_STATICSKYSINGLE_DB = 0
 
 $SURVEY_EXEC = 120
@@ -82,4 +84,7 @@
     active true
   end
+  task survey.staticskysingle
+    active true
+  end  
 end
 
@@ -113,4 +118,7 @@
   end
   task survey.publish
+    active false
+  end
+  task survey.staticskysingle
     active false
   end
@@ -397,4 +405,38 @@
 end
 
+macro survey.add.staticskysingle
+# adds each of the filters for the label chosen
+# for LAP - the final stacks chosen have %final% in them, and we 
+# want some ability to choose that
+# for others can use %
+
+ if ($0 != 7)
+    echo "USAGE: survey.add.staticskysingle (tag) (label) (workdir) (distgroup)  (selectdatagroup) (filter)"
+    break
+ end
+    book newpage SURVEY_STATICSKYSINGLE $1
+    book setword SURVEY_STATICSKYSINGLE $1 LABEL $2
+    book setword SURVEY_STATICSKYSINGLE $1 WORKDIR $3
+    book setword SURVEY_STATICSKYSINGLE $1 DIST_GROUP $4
+    book setword SURVEY_STATICSKYSINGLE $1 SELECTDATAGROUP $5
+    book setword SURVEY_STATICSKYSINGLE $1 FILTER $6
+    book setword SURVEY_STATICSKYSINGLE $1 STATE PENDING
+end
+
+macro survey.show.staticskysingle
+ if ($0 != 1)
+    echo "USAGE: survey.show.staticskysingle"
+    break
+ end
+ book listbook SURVEY_STATICSKYSINGLE
+end
+
+macro survey.del.staticskysingle
+  if ($0 != 2)
+    echo "USAGE: survey.del.staticskysingle (tag)"
+    break
+  end
+  book delpage SURVEY_STATICSKYSINGLE $1
+end
 
 task survey.diff
@@ -1189,2 +1231,89 @@
   end
 end
+
+
+
+task survey.staticskysingle
+  host local
+
+  periods      -poll $SURVEY_POLL
+  periods      -exec $SURVEY_EXEC
+  periods      -timeout $SURVEY_TIMEOUT
+  npending     1
+
+  stdout $LOGDIR/survey.staticskysingle.log
+  stderr $LOGDIR/survey.staticskysingle.log
+
+    task.exec
+    book npages SURVEY_STATICSKYSINGLE -var N
+    if ($N == 0)
+      echo "No STATICSKYSINGLE labels for processing"
+       break
+    endif
+    book getpage SURVEY_STATICSKYSINGLE 0 -var tag -key STATE NEW
+    if ("$tag" == "NULL")
+      # All tags have been done --- reset
+      # echo "Resetting tags"
+      for i 0 $N
+        book getpage SURVEY_STATICSKYSINGLE $i -var tag
+        book setword SURVEY_STATICSKYSINGLE $tag STATE NEW
+      end
+      book getpage SURVEY_STATICSKYSINGLE 0 -var tag -key STATE NEW
+      
+      # Select different database
+      $SURVEY_STATICSKYSINGLE_DB ++
+      if ($SURVEY_STATICSKYSINGLE_DB >= $DB:n) set SURVEY_STATICSKYSINGLE_DB = 0
+    end
+
+    book setword SURVEY_STATICSKYSINGLE $tag STATE DONE
+    book getword SURVEY_STATICSKYSINGLE $tag LABEL -var label
+    book getword SURVEY_STATICSKYSINGLE $tag WORKDIR -var workdir
+    book getword SURVEY_STATICSKYSINGLE $tag DIST_GROUP -var dist_group
+    book getword SURVEY_STATICSKYSINGLE $tag SELECTDATAGROUP -var selectdatagroup
+    book getword SURVEY_STATICSKYSINGLE $tag FILTER -var filter
+
+    $year = `date +%Y`
+    $month = `date +%m`
+    $day = `date +%d`
+
+    $run = staticskytool -definebyquery
+    $run = $run -set_workdir $workdir/$label/$year/$month/$day
+    $run = $run -set_dist_group $dist_group
+    $run = $run -set_label $label
+    $run = $run -select_label $label
+    $run = $run -select_data_group $selectdatagroup
+    $run = $run -select_filter $filter
+#   $run = $run -pretend -simple
+
+    if ($DB:n == 0)
+      option DEFAULT
+    else
+      $run = $run -dbname $DB:$SURVEY_STATICSKYSINGLE_DB
+      option $DB:$SURVEY_STATICSKYSINGLE_DB
+    end
+
+#    echo $run
+
+    command $run
+  end
+
+  # success
+     task.exit    0
+#    echo "Success"
+  end
+
+  # locked list
+    task.exit    default
+    showcommand failure
+  end
+
+    task.exit    crash
+    showcommand crash
+  end
+
+  # operation times out?
+    task.exit    timeout
+    showcommand timeout
+  end
+end
+
