

    \filetitle{dbbatch}{Run a batch job within a database}{dbase/dbbatch}

	\paragraph{Syntax}
 
 \begin{verbatim}
 [D,LIST] = dbbatch(D,NAME,COMMAND,...)
 \end{verbatim}
 \paragraph{Input arguments}
 
 \begin{itemize}
 \item
   \texttt{D} {[} struct {]} - Input database.
 \item
   \texttt{NAME} {[} char {]} - Pattern that will be used to create names
   for new database entries; the pattern can include \$0, \$1, etc to
   refer to tokens capture in the regular expression specified throught
   the \texttt{'nameFilter='} option.
 \item
   \texttt{COMMAND} {[} char {]} - Command that will be evaluated on a
   selection of existing database entries to create new database entries.
 \end{itemize}
 \paragraph{Output arguments}
 
 \begin{itemize}
 \item
   \texttt{D} {[} struct {]} - Output database.
 \item
   \texttt{LIST} {[} cellstr {]} - List of database names that have been
   processed.
 \end{itemize}
 \paragraph{Options}
 
 \begin{itemize}
 \item
   \texttt{'classFilter='} {[} char \textbar{} \emph{\texttt{Inf}} {]} -
   From the existing database entries, select only those that are objects
   of the specified class or classes, and evaluate the \texttt{COMMAND}
   on these.
 \item
   \texttt{'fresh='} {[} \texttt{true} \textbar{} \emph{\texttt{false}}
   {]} - If true, the output database will only contain the newly created
   entries; if false the output database will also include all the
   entries from the input database.
 \item
   \texttt{'nameFilter='} {[} char \textbar{} \emph{\texttt{Inf}} {]} -
   From the existing database entries, select only those that match this
   regular expression, and evaluate the \texttt{COMMAND} on these.
 \item
   \texttt{'nameList='} {[} cellstr \textbar{} \emph{\texttt{Inf}} {]} -
   Evaluate the \texttt{COMMAND} on this list of existing database
   entries.
 \item
   \texttt{'stringList='} {[} cellstr \textbar{} \emph{empty} {]} -
   Evaluate the \texttt{COMMAND} on this list of strings; the strings do
   not need to be names existing in the database; this options cannot be
   comined with \texttt{'nameFilter='}, \texttt{'nameList='}, or
   \texttt{'classFilter='}.
 \end{itemize}
 \paragraph{Description}
 
 \paragraph{Example}
 
 Suppose that in database \texttt{D} you want to seasonally adjust all
 time series whose names end with \texttt{\_u}, and give these seasonally
 adjusted series names without the \_u.
 
 \begin{verbatim}
 d = dbbatch(d,'$1','x12(d.$0)','nameFilter','(.*)u');
 \end{verbatim}
 or, if you want to make sure only tseries objects will be selected (in
 case there are database entries ending with a \texttt{u} other than
 tseries objects)
 
 \begin{verbatim}
 d = dbbatch(d,'$1','x12(d.$0)', ...
     'nameFilter=','(.*)u','classFilter=','tseries');
 \end{verbatim}


