The 97 GMCs have a good scanner setup. Go to the nearest Car parts
store like Auto Zone, and they will scan it for free. What usually goes
wrong at that mileage is the O2 sensors go bad. There are up to 4 of
them on that year depending on whether you have a Vortec engine or not.
If it is a Vortec, it will say it on the engine plastic cover in the
center top of the engine. Vortecs have a dual exhaust setup, with 2
catalytic converters. They have 4 oxygen sensors, 2 before the two
converters, and 2 after. The after ones are heated electrically to
respond faster when cold. The heating coils burn out, and it sets a
code. You won't be able to tell any difference when it is running. The
rear O2 sensors are just a check on how the emissions are working. The
sensors are mounted on top of the exhaust pipe, and a bit of a pain to
do, but not too bad as long as the pipes are cold. They cost about $49
at a discount house, so check around before you buy. The dealer will
rip you about $200. I had to use a box end wrench with a dead blow
plastic hammer to get mine off. They go back in easy with some anti
seize compound on the threads, only don't get any on the sensor itself.
Be careful of the wire routing so it is in the original clips, and
don't break them.