In reply to Dr. Zhiyong Hong.

You can use the SAS Support Communities to ask programming questions and get debugging help.
When you post your code there, someone will quickly point out that you only have valid values for Replicate=1 after the first DATA FINAL step.