A-B has made a lot of different PLCs over the years with a lot of different options and processor packages. It would be helpful to know which one. As a general speculation though, if it can "lose" the program at all, you must be speaking of one with RAM memory, which requires a battery to keep it alive when power is off. So the first thing that comes to mind is that your on-board RAM battery is dead, they last about 5 years. The second issue would be that for some reason, you are getting power interruptions from your power supply, either because your line supply is erratic or you have a loose connection or some other issue with your power supply. You need to have both problems in order to lose a program and you must fix both of them. Replacing the battery alone will keep your PLC from losing the program, but the loss of power, even momentarily, can be causing other havoc.
"You measure the size of the accomplishment by the obstacles you had to overcome to reach your goals" -- Booker T. Washington