  The study of MDS self-dual codes has attracted lots of attention in recent
years.
  There are many papers on determining existence of $q-$ary MDS self-dual codes
for various lengths.
  There are not existence of $q-$ary MDS self-dual codes of some lengths, even
these lengths $< q$.
  We generalize MDS Euclidean self-dual codes to near MDS Euclidean self-dual
codes and near MDS isodual codes.
  And we obtain many new near MDS isodual codes from extended negacyclic duadic
codes and we obtain many new MDS Euclidean self-dual codes from MDS Euclidean
self-dual codes.
  We generalize MDS Hermitian self-dual codes to near MDS Hermitian self-dual
codes.
  We obtain near MDS Hermitian self-dual codes from extended negacyclic duadic
codes and from MDS Hermitian self-dual codes.
