It sounds like the typical CPS - Crankshaft Position Sensor- problem. It's very rare that they will set a code - the engine shuts off too fast.
Look on the very back of the engine, behind the valve cover, down on the bellhousing - hard to see. You'll see a wire (2 wires in a harness) go to the sensor.
Trace that wire back about 6" to a connector - usually on the passenger side of the engine - disconnect the connector, wipe it clean, then re-connect. Sometimes that fixes it, sometimes not.
If not replace the sensor. From underneath a long extension, a wobbly on the end, and a 10 MM socket. Either 1 or 2 bolts, depending on the type. A buddy on top to guide the socket on really helps.
Take it to the DEALER to get a new one - autoparts houses sell cheap knock-offs - they won't last. They range from $30 - 80, depending on which one.
They come with a cardboard sleeve on them - leave it on - it's a spacer to position the sensor the right distance from the flywheel.
When you first start it you'll hear a noise - the cardboard sleeve hitting. It will stop soon when it rips off.