Index: trunk/ippTools/share/chiptool_completely_processed_exp.sql
===================================================================
--- trunk/ippTools/share/chiptool_completely_processed_exp.sql	(revision 12096)
+++ trunk/ippTools/share/chiptool_completely_processed_exp.sql	(revision 12096)
@@ -0,0 +1,25 @@
+-- select * from chipPendingExp
+-- where exp_tag is not in chipProcessedExp
+-- where exp_tag is not in chipPendingImfile
+-- where the number of entries in chipProccessedImfile matches the .imfiles
+-- entry in rawExp
+SELECT DISTINCT
+    chipPendingExp.*,
+    rawExp.imfiles,
+    chipProcessedImfile.class_id
+FROM chipPendingExp
+JOIN rawExp
+    ON chipPendingExp.exp_tag = rawExp.exp_tag
+LEFT JOIN chipProcessedExp
+    ON chipPendingExp.exp_tag = chipProcessedExp.exp_tag
+LEFT JOIN chipPendingImfile
+    ON chipPendingExp.exp_tag = chipPendingImfile.exp_tag
+LEFT JOIN chipProcessedImfile
+    ON chipPendingExp.exp_tag = chipProcessedImfile.exp_tag
+WHERE
+    chipProcessedExp.exp_tag IS NULL
+    AND chipPendingImfile.exp_tag IS NULL
+    AND chipProcessedImfile.exp_tag IS NOT NULL
+GROUP BY
+    chipPendingExp.exp_tag
+HAVING rawExp.imfiles = COUNT(chipProcessedImfile.class_id)
Index: trunk/ippTools/share/chiptool_find_unprocessed_imfile.pl
===================================================================
--- trunk/ippTools/share/chiptool_find_unprocessed_imfile.pl	(revision 12096)
+++ trunk/ippTools/share/chiptool_find_unprocessed_imfile.pl	(revision 12096)
@@ -0,0 +1,8 @@
+SELECT DISTINCT
+   chipPendingImfile.*
+FROM chipPendingImfile
+LEFT JOIN chipProcessedImfile
+    USING(exp_tag, class_id)
+WHERE
+    chipProcessedImfile.exp_tag IS NULL
+    AND chipProcessedImfile.class_id IS NULL
Index: trunk/ippTools/share/chiptool_pendingimfile.sql
===================================================================
--- trunk/ippTools/share/chiptool_pendingimfile.sql	(revision 12096)
+++ trunk/ippTools/share/chiptool_pendingimfile.sql	(revision 12096)
@@ -0,0 +1,13 @@
+SELECT
+    chipPendingImfile.*,
+    rawExp.camera,
+    rawExp.workdir
+FROM chipPendingImfile
+JOIN chipPendingExp
+    USING(exp_tag)
+JOIN rawExp
+    USING(exp_tag)
+LEFT JOIN chipMask
+    ON chipPendingExp.label = chipMask.label
+WHERE
+    chipMask.label IS NULL
Index: trunk/ippTools/share/chiptool_processedimfile.sql
===================================================================
--- trunk/ippTools/share/chiptool_processedimfile.sql	(revision 12096)
+++ trunk/ippTools/share/chiptool_processedimfile.sql	(revision 12096)
@@ -0,0 +1,11 @@
+SELECT
+    chipProcessedImfile.*,
+    rawExp.camera,
+    rawExp.workdir
+FROM chipProcessedImfile
+JOIN rawExp
+    USING(exp_tag)
+WHERE
+-- bogus test; just here so there there is a 'WHERE' stmt to append conditionals too
+    chipProcessedImfile.exp_tag is NOT NULL
+
