Here's what needs to be considered:
* Engine Codes: The 1997 and 1999 S-Series used various engines (e.g., 1.9L, 2.2L, various configurations). You *must* verify that the engine codes are compatible. Even within the same displacement (like 2.2L), there could be significant differences. Minor differences might be manageable with some modification, but major differences will likely require extensive work or make the swap impossible. The engine code will be stamped on the engine block itself.
* Transmission Compatibility: The transmission must be compatible with the replacement engine. A transmission that worked with the 1997 engine may not work with the 1999 engine.
* Wiring Harness and Computer (ECU): The wiring harness and the Engine Control Unit (ECU) are likely different. You may need to swap the entire harness or do significant rewiring to make everything compatible. This is a very complex undertaking. Using the 1999 ECU with the 1997 harness might be very difficult or even impossible.
* Mounting Points: While generally similar, minor differences in mounting points between engine generations could exist, requiring modification or custom fabrication.
* Exhaust System: The exhaust system might need adjustment or replacement.
* Sensors and Other Components: Various sensors and other components might differ between the two engines, requiring replacement or adaptation.
In short, while theoretically possible, replacing a 1997 Saturn S-Series engine with a 1999 one is a significant undertaking requiring mechanical expertise, likely access to a repair manual for both years, and potentially significant parts sourcing. It's far more complex than just swapping out the engine. Unless you have considerable experience with engine swaps and automotive electrical systems, it's strongly recommended to have this done by a professional mechanic.