12. For any $x>0$, there is always
$$
f(x)=a-x-|\lg x| \leqslant 0 \text {. }
$$

Then the range of values for $\boldsymbol{a}$ is $\qquad$
12. $(-\infty, \lg \mathrm{e}-\lg g \mathrm{e})$.

When $x \geqslant 1$, $|\lg x|=\lg x$.
From $x+\lg x \geqslant 1$, we know $a \leqslant 1$;
When $0 < x < 1$, $|\lg x|=-\lg x > 0$;
When $x > \lg \mathrm{e}$, $f^{\prime}(x) > 0$;
When $x < \lg \mathrm{e}$, $f^{\prime}(x) < 0$;
Since $\ln 10 > 2.3$, $\ln \mathrm{e} = 1$, and $3 > \ln 10$, we know
$\lg \mathrm{e} - \lg \lg \mathrm{e} = \lg \frac{\mathrm{e}}{\lg \mathrm{e}} = \lg (\mathrm{e} \ln 10)$
$< \lg 10 = 1$.
Therefore, the range of values for $a$ is $(-\infty, \lg \mathrm{e} - \lg \lg \mathrm{e}]$.