I'm a little confused about what the code you posted is trying to achieve, but the following produces your desired output from your given input
/departmentNumber/{
a = $2 " " $3
j = index(a, "-")
if (j) {
print substr(a, 1, j-1) "," substr(a, j+1) "," a
}
next
}
{printf...