The easiest way to do this is two redefine your variable and them just move and use the pieces of the redefine.
DEFINE #DOB(A10)
REDEFINE #DOB(#Y(A4) #M(A2) #D(A2))
Then you can just use the piece and move them around the way that you want.
WRITE WORK FILE 2 #M ',' #D ',' #Y