You really haven't made it clear what you want to do.
You say you have a X(20) field (20 characters) that can have 14, 16 or 18 digits. Then you say you want to split that up into different ZD fields of 6, 2, 8, 2 and 2 digits which is 20 digits in total. But you haven't given any indication of how you want to map the 14, 16 or 18 digits of the input field to the 20 digits of the output field.
In your original example, you had 14 digits and added 6 0's on the right, but didn't explain why. Do you just want to fill out the digits with 0s on the right to get 20 characters? Or do you want to do something else? If something else, explain in detail.