an SQL join can convert data types "on the fly".
To achieve the same in a data step merge, use data step views to convert to the common data type.
I hope you don't need to rely on a SAS numeric holding 18 digits precision.
on z/OS, see
http://support.sas.com/onlinedoc/913/getDoc/en/hosto390.hlp/mvs-length-length.htm
There it declares 16 digits
On windows the corresponding table is different because the the storage form is different. The result is that the table at
http://support.sas.com/onlinedoc/913/getDoc/en/hostwin.hlp/numvar.htm offers only to retain precision for 15 digits.
As SAS on unix uses the same internal storage as on windows, it is no surprise that the limitations are declared the same, in the table at
http://support.sas.com/onlinedoc/913/getDoc/en/hostunx.hlp/a000344718.htm .
So, if you want to rely on 18 digits precision, either hold it as 18 characters, 9 bytes of unsigned packed numeric, or some extremely clever binary combination.
Certainly do not rely on retrieving any 18 digits you store in a SAS numeric variable. Of course, you may be lucky !
Good Luck
PeterC