  Let $p$ be a prime number and $\mathbb{Z}_p=\mathbb{Z}/p\mathbb{Z}$. We study
finite groups with abelian derived subgroup and exponent $p$ in terms of group
extension data and their matrix presentations. We show a one-to-one
correspondence between the following two sets: (i) the isoclasses of class 2
groups of exponent $p$ and order $p^{m+n}$ and with derived subgroup
$\mathbb{Z}_p^n$, and (ii) the set
$\text{Gr}(n,\text{AS}_m(\mathbb{Z}_p))/\text{GL}_m(\mathbb{Z}_p)$ of orbits of
$\text{Gr}(n,\text{AS}_m(\mathbb{Z}_p))$ under the congruence action by
$\text{GL}_m(\mathbb{Z}_p)$, where $\text{Gr}(n,\text{AS}_m(\mathbb{Z}_p))$ is
the set of $n$-dimensional subspaces of anti-symmetric matrices of order $m$
over $\mathbb{Z}_p$. We give a description of the orbit spaces $\text{Gr}(2,
\text{AS}_m(\mathbb{Z}_p))/\text{GL}_m(\mathbb{Z}_p)$ for all $m$ and $p$ by
applying the theory of pencils of anti-symmetric matrices. Based on this, we
show complete sets of representatives of orbits of
$\text{Gr}(3,\text{AS}_4(\mathbb{Z}_3))/\text{GL}_4(\mathbb{Z}_3)$,
$\text{Gr}(4, \text{AS}_4(\mathbb{Z}_3))/\text{GL}_4(\mathbb{Z}_3)$ and
$\text{Gr}(3, \text{AS}_5(\mathbb{Z}_3))/\text{GL}_5(\mathbb{Z}_3)$. As a
consequence, we obtain a classification of corresponding class 2 groups of
exponent $p$. In particular, we recover the classification of groups with
exponent 3 and order $\le 3^8$.
