Sounds like a memory problem.
First try to rule out that you have too little memory allocated/available during the cube creation.
Run your code using options fullstimer;
What is you memsize and sortsize settings?
During the job execution, monitor memory consumptions in the appropriate OS tool.
If you can't figure out by then, contact SAS tech support and have them explain what is causing the error message.
Data never sleeps