  Constructions of distance-optimal codes and quasi-perfect codes are
challenging problems and have attracted many attentions. In this paper, we give
the following three results.
  1) If $\lambda|q^{sm}-1$ and $\lambda
<\sqrt{\frac{(q^s-1)}{2(q-1)^2(1+\epsilon)}}$, an infinite family of
distance-optimal $q$-ary cyclic sum-rank codes with the block length
$t=\frac{q^{sm}-1}{\lambda}$, the matrix size $s \times s$, the cardinality
$q^{s^2t-s(2m+3)}$ and the minimum sum-rank distance four is constructed.
  2) Block length $q^4-1$ and the matrix size $2 \times 2$ distance-optimal
sum-rank codes with the minimum sum-rank distance four and the Singleton defect
four are constructed. These sum-rank codes are close to the sphere packing
bound , the Singleton-like bound and have much larger block length
$q^4-1>>q-1$.
  3) For given positive integers $m$ satisfying $2 \leq m$, an infinite family
of quasi-perfect sum-rank codes with the matrix size $2 \times m$, and the
minimum sum-rank distance three is also constructed. Quasi-perfect binary
sum-rank codes with the minimum sum-rank distance four are also given.
  Almost MSRD $q$-ary codes with the block lengths up to $q^2$ are given. We
show that more distance-optimal binary sum-rank codes can be obtained from the
Plotkin sum.
