Index: branches/pap/ippToPsps/scripts/removeFromDatastore.pl
===================================================================
--- branches/pap/ippToPsps/scripts/removeFromDatastore.pl	(revision 27708)
+++ branches/pap/ippToPsps/scripts/removeFromDatastore.pl	(revision 28003)
@@ -5,15 +5,34 @@
 use IPC::Cmd 0.36 qw( can_run run );
 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
+use Pod::Usage qw( pod2usage );
 
-my $start;
+my $start = undef;
+my $end = undef;
+my $product = undef;
 
-GetOptions(  'start=s' => \$start)  or pod2usage( 2 );
+GetOptions( 
+        'start|s=s' => \$start,
+        'end|e=s' => \$end,
+        'product|p=s' => \$product,
+        )  or pod2usage( 2 );
+
+pod2usage(
+        -msg => "\n   Required options:\n\n".
+        "--start <jobStartNumber> [--end <jobEndNumber>]\n".
+        "--product <datastoreProduct>\n",
+        -exitval => 3
+        ) unless
+defined $product and
+defined $start;
+
+
+if (!defined $end) {$end = 1000000;}
 
 my $i;
 
-for ($i = $start; $i < 1000; $i++) {
+for ($i=$start; $i<$end+1; $i++) {
 
     my $job = sprintf("J%06d", $i);
-    my $command  = "dsreg --del $job --product PSPS_test";
+    my $command  = "dsreg --del $job --product $product";
 
     run(command => $command, verbose => 1);
