The engines are generally the same but, as you note, there are differences. The camshaft profiles may be slightly different. The engine block is somewhat different. The intake manifold is quite different...make sure you use your 02 manifold, not the 98 unit. Also, the PCV system is different...again, use the 02 spec. parts for that.
Use your existing ECM, injectors and fuel system. There may be some slight incompatibilities with sensors, wiring and cooling systems. Whatever those might be, you need to adapt the 98 hardware to work with the configuration of your 2002.
The trans is probably the same except for, perhaps, sensors and wiring.
If you don't have a copy, I strongly advise you purchase the 2002 Factory Service Manual. A good source for these in the U.S. is Zip Products.