Datta and Johnsen (Des Codes Cryptogr 91:747–761, 2023) introduced a new family of evaluation codes in an affine space of dimension \(\ge 2\) over a finite field \({\mathbb {F}}_q\) where linear combinations of elementary symmetric polynomials are evaluated on the set of all points with pairwise distinct coordinates. In this paper, we propose a generalization by taking low dimensional linear systems of symmetric polynomials. Computation for small values of \(q=7,9\) shows that carefully chosen generalized Datta–Johnsen codes \(\left[ \frac{1}{2}q(q-1),3,d\right] \) have minimum distance d equal to the optimal value minus 1.