In reply to Bocheng Jing.

Hi Bocheng, I had the same problem as you. I modified the macro with: options validvarname=v7 and then the dummy variables were created with an underscore instead of a space! Love this code!!! Thank you Rick.