Define = number of ways to decode the substring from index to the end. Base case: (empty string = one valid decoding: do nothing). The answer is , the ways to decode the entire string.
You could also define it as "ways to decode first characters" and build forward. Both work. Choosing the right state is often the hardest part. The state must capture everything needed to solve the subproblem independently.