Is it possible to assign different product numbers to each attribute?

For example:

product#: 80012B for black shirt
product#: 80012W for white shirt

AND

product#: 93334 for 4-Pack batteries
product#: 93335 for 12-Pack batteries

Thanks