Pro/Program is not a small feature of Pro/E. So getting/writing help in one mail is not possible. I am using Pro/Program very frequently. I can send you provide some help .
easiest way is to use parameters driven by relations to control the model, then the proprogram writes itself, all you have to do is add the parameters into the header of the proprogram