creating social security format

noetsi

Fortran must die
#1
This should be simple but I have had no luck finding it. I want to convert a character field with ********* to ***-XX-***X.

I know I could use substring and length commands and concatenate, but this is pretty complicated. I think a format function will do this, I just have not found it.
 

hlsmith

Not a robit
#2
So you have a 9 digit number, which you want to reformat, while substituting the 4th, 5th, and 9th digit with an "X"?