Mazda camshaft positioning sensor bad?

My mazda b2300 pickup truck does not always get spark. Can sensor be bad, or such thing as going bad? Sometimes it starts, sometimes it does not.

Yes the camshaft postion sensor can be bad. But the most likely candidate is the crankshaft position sensor. Intermittant signel from the cam sensor causes the computer to fire the plugs at the wrong time. The crank sensor provides the signel that the computer uses to actually send each pulse to the ignition module.