It appears you are attempting to perform an Engine Change (as opposed to an Engine Replacement). An engine change is the installation of an engine in a vehicle that is different from the one originally installed. A Referee smog inspection is required for all vehicles that have had an engine change.
Your Dodge Ram 2500 VIN number (from the ECM) will be transmitted to the smog machine during the smog inspection. Prior to this occurring however, the smog technician will be required to enter into the smog machine, manually by reading the Federal VIN (on the door post) or by scanning your Dodge Ram's registration documents, into the smog machine during the required prompt. The smog machine will prompt a VIN mismatch, but not automatically abort the smog test. It will be apparent to the smog technician that something is not matching up. They will question you regarding the discrepancy and ascertain whether you've swapped the ECM or the engine. The smog machine is not responsible to determine whether a vehicle's engine and chassis VIN number match. This is the responsibility of the smog technician. Upon learning of an engine change the smog technician is required to refer you to the smog referee's office.
Anytime an engine change occurs, the first smog check needs to be performed by the smog check referee's office. The smog referee will inspect the vehicle, ensure the job was done properly, ensure the vehicle does not pollute, and than place a "blue tag" on the chassis indicating the vehicle is Catalonia complaint. Subsequent smog inspections may be performed at standard smog stations.