I had similar issues with my 2004 GMC Yukon XL. Replacement transfer cases can be purchased with or without a new encoder motor. I agree with all of the above: carefully check all of the wiring and connections first and then I would lean toward the encoder ring. Ironically I could not get a dtc to come up when my encoder ring failed.