\documentclass[12pt,a4paper,final]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\listfiles

\usepackage[verbose]{datatool}

\begin{document}
\newcount\mycount
\newcommand*{\noopsort}[1]{}

\verb+\newcommand*{\noopsort}[1]{}+ then \verb+\noopsort{a}foo+  produces the text: foo, however the following 

\verb+\dtlcompare{\mycount}{\noopsort{a}foo}{bar}\number\mycount+ 

produces: -1, since the command \verb+\noopsort+ is disregarded when the comparison is made, so \verb+\dtlcompare+ just compares \{a\}foo with bar, and since a is less than b, the first string is considered to be less than the second string.



A. result with \verb+\noopsort{a}foo}+ \dtlcompare{\mycount}{\noopsort{a}foo}{bar}\number\mycount{} as expected


B. result with \verb+\noopsort{z}foo}+
\dtlcompare{\mycount}{\noopsort{z}foo}{bar}\number\mycount{}. Should it not be 1? 
\end{document}



