Index: trunk/ippScripts/scripts/phase0_imfile.pl
===================================================================
--- trunk/ippScripts/scripts/phase0_imfile.pl	(revision 11212)
+++ trunk/ippScripts/scripts/phase0_imfile.pl	(revision 11297)
@@ -31,5 +31,5 @@
 use Pod::Usage qw( pod2usage );
 
-my ($cache, $exp_tag, $class_id, $uri, $workdir, $no_update);
+my ($cache, $exp_tag, $class_id, $uri, $workdir, $dbname, $no_update);
 
 GetOptions(
@@ -38,5 +38,6 @@
     'class_id|i=s'  => \$class_id,
     'uri|u=s'       => \$uri,
-    'workdir|w=s'   => \$workdir,
+    'workdir|w=s'   => \$workdir, # Working directory for output files
+    'dbname|d=s'    => \$dbname,# Database name
     'no-update'     => \$no_update
 ) or pod2usage( 2 );
@@ -185,4 +186,6 @@
     }
 
+    push @command, "-dbname", $dbname if defined $dbname;
+
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
         run(command => \@command, verbose => 1);
@@ -219,5 +222,7 @@
     my $exit_code = $_[2];
     if ($exp_tag && $class_id) {
-        system ("$p0tool -addprocessedimfile -exp_tag $exp_tag -class_id $class_id -code $exit_code");
+	my $command = "$p0tool -addprocessedimfile -exp_tag $exp_tag -class_id $class_id -code $exit_code";
+	$command .= " -dbname $dbname" if defined $dbname;
+        system ($command);
     }
     exit $exit_code;
