Trying to create a column with the Code numbers of the following sample table:

PATNO PAT_LAST PAT_FIRST
009985 Lan Mei
009986 Sochacki Emilia
009987 Rodrigues Jose
009988 Cherilyn Somali
009989 Rodrigues Maria
009990 Johnson Oral
009991 Johnson Tyler

New Code column need to create\replace for record 009985 should be:
LANME000 - 8-DIGIST LONG; (FIRST 3-LETTERS OF THE PAT_LAST + 2 LETTERS OF THE PAT_FIRST + 3-ZEROS). All the records must be the same way.
However, if SECOND record with the same PAT_LAST & PAT_FIRST comes across, then it should be LANME001 (increased by one digit up to 999)
This is a long table.

Wondering is this process is possible with excel\SQL statement or any other way?
Any help will be appreciated.