Sorting Files by date and moving files in date order

I need to build a k shell script that will sort files in a directory where files appear like this "XXXX_2008021213.DAT. I need to sort by date in the filename and then move files by individual date to a working folder. concatenate the files in the working folder then start a process once process is finish then increment by +1 and move the next date to the working folder. Using a AIX box but shortly will be switching to Linux

Show your code.

You can use sort -k1.??(starting field no),ending filed no.
say for example for your date XXXX_2008021213.DAT to sort this on year
mth and date order you can use
sort -k1.6,1.9 -k1.10,1.11 -k1.12,1.13 input_file > output file
Cheer up