Index: /trunk/ippTools/src/pstamptool.c
===================================================================
--- /trunk/ippTools/src/pstamptool.c	(revision 16595)
+++ /trunk/ippTools/src/pstamptool.c	(revision 16596)
@@ -106,4 +106,13 @@
         return false;
     }
+    psString outProduct = psMetadataLookupStr(&status, config->args, "-out_product");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to looku value for -out_product");
+        return false;
+    }
+    if (!outProduct) {
+        psError(PS_ERR_UNKNOWN, true, "-out_product is required");
+        return false;
+    }
 
     psString lastFileset = psMetadataLookupStr(&status, config->args, "-last_fileset");
@@ -115,7 +124,8 @@
     if (!pstampDataStoreInsert(config->dbh,
             0,
-            uri,
+            state,
             lastFileset,
-            state
+            outProduct,
+            uri
         )) {
         psError(PS_ERR_UNKNOWN, false, "database error");
@@ -128,7 +138,19 @@
 static bool datastoreMode(pxConfig *config)
 {
-    PS_ASSERT_PTR_NON_NULL(config, false);
-
-    if (!p_psDBRunQuery(config->dbh, "SELECT * FROM pstampDataStore")) {
+    bool status = false;
+    PS_ASSERT_PTR_NON_NULL(config, false);
+
+    psString ds_id = psMetadataLookupStr(&status, config->args, "-ds_id");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -ds_id");
+        return false;
+    }
+
+    psString query = NULL;
+    psStringAppend(&query, "SELECT * FROM pstampDataStore");
+    if (ds_id) {
+        psStringAppend(&query, " WHERE ds_id = '%s'", ds_id);
+    }
+    if (!p_psDBRunQuery(config->dbh, query)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
         return false;
@@ -194,5 +216,5 @@
 
     if (!state && !lastFileset) {
-        psError(PS_ERR_UNKNOWN, true, "one of -last_fileset or -state is required");
+        psError(PS_ERR_UNKNOWN, true, "at least one of -last_fileset or -state is required");
         return false;
     }
@@ -247,4 +269,13 @@
         return false;
     }
+    psString outFileset = psMetadataLookupStr(&status, config->args, "-out_fileset");
+    if (!status) {
+        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -out_fileset");
+        return false;
+    }
+    if (!outFileset) {
+        psError(PS_ERR_UNKNOWN, true, "-out_fileset is required");
+        return false;
+    }
 
     // Data Store ID is optional
@@ -259,10 +290,9 @@
 
     char *query ="INSERT INTO pstampRequest"
-                 " (state, uri, ds_id)"
-                 " VALUES( 'new', '%s', %s)";
-
-    if (!p_psDBRunQuery(config->dbh, query, uri, ds_id)) {
-        psError(PS_ERR_UNKNOWN, false, "database error");
-        psFree(query);
+                 " (state, uri, ds_id, outFileset)"
+                 " VALUES( 'new', '%s', %s, '%s')";
+
+    if (!p_psDBRunQuery(config->dbh, query, uri, ds_id, outFileset)) {
+        psError(PS_ERR_UNKNOWN, false, "database error");
         return false;
     }
Index: /trunk/ippTools/src/pstamptoolConfig.c
===================================================================
--- /trunk/ippTools/src/pstamptoolConfig.c	(revision 16595)
+++ /trunk/ippTools/src/pstamptoolConfig.c	(revision 16596)
@@ -48,7 +48,9 @@
             "define storage uri", NULL);
     psMetadataAddStr(adddatastoreArgs, PS_LIST_TAIL, "-last_fileset", 0,
-            "define storage uri", NULL);
+            "define last fileset seen", NULL);
     psMetadataAddStr(adddatastoreArgs, PS_LIST_TAIL, "-state", 0,
-            "define storage uri", NULL);
+            "define datastore state", NULL);
+    psMetadataAddStr(adddatastoreArgs, PS_LIST_TAIL, "-out_product", 0,
+            "define output product name", NULL);
     
     // -datastore
@@ -56,4 +58,6 @@
     psMetadataAddBool(datastoreArgs, PS_LIST_TAIL, "-simple", 0,
             "use the simple output format", false);
+    psMetadataAddStr(datastoreArgs, PS_LIST_TAIL, "-ds_id", 0,
+            "define ds_id", NULL); 
 
     // -moddatastore
@@ -65,4 +69,6 @@
     psMetadataAddStr(moddatastoreArgs, PS_LIST_TAIL, "-state", 0,
             "define storage uri", NULL);
+    psMetadataAddStr(moddatastoreArgs, PS_LIST_TAIL, "-out_product", 0,
+            "define output product name", NULL);
 
 
@@ -72,5 +78,7 @@
             "define request file uri", NULL); 
     psMetadataAddStr(addreqArgs, PS_LIST_TAIL, "-ds_id", 0,
-            "define request file ds_id", NULL); 
+            "define request ds_id", NULL); 
+    psMetadataAddStr(addreqArgs, PS_LIST_TAIL, "-out_fileset", 0,
+            "define request output_fileset", NULL); 
 
     // -pendingreq
@@ -165,8 +173,4 @@
     PXOPT_ADD_MODE("-processedjob",    "", PSTAMPTOOL_MODE_PROCESSEDJOB, processedjobArgs);
 
-#ifdef notyet
-    PXOPT_ADD_MODE("-jobresult",       "", PSTAMPTOOL_MODE_JOBRESULT,    jobresultArgs);
-#endif
-
     if (!pxGetOptions(stderr, argc, argv, config, modes, argSets)) {
         psError(PS_ERR_UNKNOWN, true, "option parsing failed");
