I'm trying to classify laws by level (federal, state and local) and by theme (waste, sanitary sewage) and show it on a table. I wrote the follow MWE:
\documentclass{article}
\usepackage{datatool}
\usepackage{filecontents}
\begin{filecontents}{legis.csv}
level;theme;norm;number;date;subject
federal;waste;"Federal Law";12305;8/2/2010;"Institutes the National Policy on Solid Waste."
state;waste;"State Law";11107;4/6/2005;"Provides general rules for management of solid waste."
local;waste;"Local Law";7797;7/10/2017;"Creates the Green Environment Fund and makes other arrangements."
\end{filecontents}
\begin{document}
\DTLsetseparator{;}
\DTLloaddb[keys={level,theme,norm,number,date,subject}]{legis}{legis.csv}
\begin{tabular}{@{\hspace{1cm}}l}
\multicolumn{1}{l}{\bfseries Federal law}\\
\DTLforeach*[\DTLiseq{\level}{federal}\and\DTLiseq{\theme}{waste}]{legis}
{\norm=norm,\number=number,\date=date,\subject=subject}
{%
\begin{tabular}{lll}
\norm & \number & \date
\end{tabular}\\
\begin{tabular}@{\hspace{1cm}}{p{10cm}}
\subject
\end{tabular}\\
}
\multicolumn{1}{l}{\bfseries State law}\\
\DTLforeach*[\DTLiseq{\level}{state}\and\DTLiseq{\theme}{waste}]{leg}
{\norm=norm,\number=number,\date=date,\subject=subject}
{
\begin{tabular}{lll}
\norm & \number & \date
\end{tabular}\\
\begin{tabular}@{\hspace{1cm}}{p{10cm}}
\subject
\end{tabular}\\
}
\multicolumn{1}{l}{\bfseries Local law}\\
\DTLforeach*[\DTLiseq{\level}{local}\and\DTLiseq{\theme}{waste}]{leg}
{\norm=norm,\number=number,\date=date,\subject=subject}
{
\begin{tabular}{lll}
\norm & \number & \date
\end{tabular}\\
\begin{tabular}@{\hspace{1cm}}{p{10cm}}
\subject
\end{tabular}\\
}
\end{tabular}
\end{document}
but the log file always show the error: "Undefined control sequence.}" what's wrong?