Is it possible to maintain a "sleep" inside a loop

Previously I made a small program using "sleep", it considerably lowered the consumption in the batteries, it used 4 AA batteries and it was working constantly for 1 year. Now I try the same, but in that program the PIC did its routine and when it finished it restarted. Now with this program it affects me that the program restarts from the beginning when the PIC wakes up, I added a command at several points, MX_CLEAR_WATCHDOG; I thought that with this I eliminated the restart and simply continued in the loop, re-entering "sleep" and continuing with the routine:
Loop
WDTCONbits. WDTPS = 0b01010; (1 second)
SLEEP();
NOP();
MX_CLEAR_WATCHDOG; (CLEARS OR REMOVES SLEEP)
Program (until a condition is met and sends "go to")
Loop
I tried to make changes in timings, in the PIC configuration, commands, and always in all cases the program crashes or restarts, I need to keep the values of the variables; any help is appreciated.
I include the program.
Best Regards
Enrique