Using filename to determine a prefix that needs to be added to string column on file?

Possible filenames:

CDD_Whatever.txt
DDD_Whatever.txt

If the file prefix = CDD, I'd like to prefix every person ID (second column in my examples below) on the file with "c-"

If the file prefix = DDD, I'd like to prefix ever person ID with "d-"

Input:

Desired Output:

Any help would be appreciated

$ awk -F"|" '{ $2=tolower(substr(FILENAME,1,1))"-"$2 } 1' OFS="|" CDD_whatever.txt

01|c-5284338|Person 1|SAT Mail|75

$

Use nawk on solaris.

Thanks, this is exactly what I need.