You can do someting like
database sysmaster;
select dbsname, partdbsnum(partnum) from systabnames
group by 1
to know the id's for the tables in that database (mix this info with the sysdbspaces content)
Just in case the procedure doesn't exist in your system:
create procedure partdbsnum (partnum int ) returning int;
return trunc(partnum/1048576);
end procedure;
But I think it won't work as easy as you believe: You need the OS to be the same in both machines (I'd bet), and the restore process will ask for the logical logs tapes, and if you don't provide them, the dbspaces will be marked as 'down' (or at least that was the behaviour in old versions). I'd use onunload-onload in your case. It's fast and reliable enough.
Hope it helps.