It depends on the level of the defect.
If the defect is "low" or close to the perineal skin, an anoplasty can be done shortly after birth. If the defect is high, then a staged operation is needed. Initially the child will need a colostomy
(temporary). Second stage is creation of anus. Third stage is closure of colostomy after the anoplasty heals.