Index: trunk/ippTools/src/chiptool.c
===================================================================
--- trunk/ippTools/src/chiptool.c	(revision 25822)
+++ trunk/ippTools/src/chiptool.c	(revision 25835)
@@ -146,4 +146,7 @@
     PXOPT_LOOKUP_STR(tess_id, config->args, "-set_tess_id", false, false);
     PXOPT_LOOKUP_STR(end_stage, config->args, "-set_end_stage", false, false);
+    PXOPT_LOOKUP_STR(dist_group, config->args, "-set_dist_group", false, false);
+    PXOPT_LOOKUP_STR(data_group, config->args, "-set_data_group", false, false);
+    PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false);
 
     // default
@@ -265,4 +268,6 @@
 				 workdir     ? workdir   : raw_workdir,
 				 label       ? label     : raw_label,
+                                 data_group  ? data_group : (label ? label : raw_label),
+                                 dist_group,
 				 reduction   ? reduction : raw_reduction,
 				 // expgroup    ? expgroup  : raw_expgroup,
@@ -271,5 +276,6 @@
 				 dvodb       ? dvodb     : raw_dvodb,
 				 tess_id     ? tess_id   : raw_tess_id,
-				 end_stage   ? end_stage : raw_end_stage
+				 end_stage   ? end_stage : raw_end_stage,
+                                 note
 				 )) {
             if (!psDBRollback(config->dbh)) {
@@ -303,41 +309,24 @@
     PXOPT_COPY_STR(config->args,  where, "-label",   "chipRun.label",   "==");
     PXOPT_COPY_STR(config->args,  where, "-state",   "chipRun.state",   "==");
-
-    if (!psListLength(where->list) &&
-        !psMetadataLookupBool(NULL, config->args, "-all")) {
+    PXOPT_COPY_STR(config->args,  where, "-data_group", "chipRun.data_group",   "==");
+    PXOPT_COPY_STR(config->args,  where, "-dist_group", "chipRun.dist_group",   "==");
+
+    if (!psListLength(where->list)) {
         psFree(where);
-        where = NULL;
         psError(PXTOOLS_ERR_DATA, false, "search parameters are required");
         return false;
     }
-
-    PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false);
-    PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false);
-
-    if ((!state) && (!label)) {
-        psError(PXTOOLS_ERR_DATA, false, "parameters are required");
-        psFree(where);
-        return false;
-    }
-
-    if (state) {
-        // set chipRun.state to state
-        if (!pxchipRunSetStateByQuery(config, where, state)) {
-            psFree(where);
-            return false;
-        }
-    }
-
-    if (label) {
-        // set chipRun.label to label
-        if (!pxchipRunSetLabelByQuery(config, where, label)) {
-            psFree(where);
-            return false;
-        }
-    }
-
+    psString query = psStringCopy("UPDATE chipRun JOIN rawExp USING(exp_id)");
+
+    // pxUpdateRun gets parameters from config->args and updates
+    bool result = pxUpdateRun(config, where, &query, true);
+    if (!result) {
+        psError(PXTOOLS_ERR_DATA, false, "pxUpdateRun failed");
+    }
+
+    psFree(query);
     psFree(where);
 
-    return true;
+    return result;
 }
 
@@ -1258,9 +1247,12 @@
                     chipRun->workdir,
                     chipRun->label,
+                    chipRun->data_group,
+                    chipRun->dist_group,
                     chipRun->reduction,
                     chipRun->expgroup,
                     chipRun->dvodb,
                     chipRun->tess_id,
-                    chipRun->end_stage
+                    chipRun->end_stage,
+                    NULL    // note does not propagate
         )) {
            if (!psDBRollback(config->dbh)) {
