Find the year and assign to different parameters

Hi All,

I have a unix directory and under which the below set of files(Years will change) will be there

#####################################

TEST_DETAIL_HCR_ABC2015_T01152015.csv
TEST_DETAIL_HCR_ABC2014_T01152015.csv
TEST_DETAIL_HCA_ABC2013_T01152015.csv

I need to assign years to three different parameters by using

$PY2015=2015
$PY2014=2014
$PY2013=2013

########################################

Please let me know how to do this.

Thanks in advance.

Please be aware that the assignments shown ($PY....) can't be done - just remove the $ sign.
What OS and shell versions do you run?

Yes sorry RudiC.

OS is SUN and KSH