Index: trunk/pstamp/src/pstampfinish.c
===================================================================
--- trunk/pstamp/src/pstampfinish.c	(revision 18243)
+++ trunk/pstamp/src/pstampfinish.c	(revision 18247)
@@ -26,4 +26,5 @@
     psString    dsRoot;
     psString    dsProduct;
+    psString    dbName;
     int         exitStatus;
 } psrfOptions;
@@ -70,4 +71,6 @@
         return NULL;
     }
+    psBool status;
+    options->dbName = psMetadataLookupStr(&status, options->config->complete, "DBNAME");
 
     if ((argnum = psArgumentGet(argc, argv, "-mode"))) {
@@ -265,8 +268,10 @@
     psString command = NULL;
 
-    psStringAppend(&command, "dsreg --add --type PSRESULTS --product %s --fileset %s", 
-            options->dsProduct, fileset_id);
-
-    printf("command is: %s\n", command);
+    psStringAppend(&command, "dsreg --dbname %s --add --type PSRESULTS --product %s --fileset %s", 
+            options->dbName, options->dsProduct, fileset_id);
+
+    if (options->verbose) {
+        fprintf(stderr, "command is: %s\n", command);
+    }
 
     // open a pipe to dsreg and set up the output fileset
Index: trunk/pstamp/src/pstampparse.c
===================================================================
--- trunk/pstamp/src/pstampparse.c	(revision 18243)
+++ trunk/pstamp/src/pstampparse.c	(revision 18247)
@@ -64,4 +64,6 @@
     }
 
+    // XXX: need to sort out the interactions of this mode option and the JOB_TYPE
+    // listed in the request file.
     if ((argnum = psArgumentGet(argc, argv, "-mode"))) {
         psArgumentRemove(argnum, &argc, argv);
@@ -629,4 +631,12 @@
         psStringAppend(&cmd, " -args '%s'", commandArgs);
     }
+    // XXX We may want to have the data store name be different than the default DB
+    psBool status;
+    psString dbName = psMetadataLookupStr(&status, options->config->complete, "DBNAME");
+    fprintf(stderr, "\n\n   dbName is %s\n", dbName);
+    if (dbName) {
+        psStringAppend(&cmd, " -dbname %s", dbName);
+    }
+
     psStringAppend(&cmd, " > /dev/null");
 
