Need for loop to do 2 activities

I need my for loop to do 2 things at a time. I have a script where I move the old files into archive directory and then i want to compress them. Presently I am using 2 for loops for it. How can i do it in 1 for loop.

Code:

after this i am compresing them in another for loop:

for file in $targetfilepattern ; do
mv "$file" $targetarchive
compress $targetarchive/"$file"
done 

Thanks that is working fine but have another problem. After compressing the files i am purging the files older than 30 days. I want to purge files only in the pattern of targetfilepattern in the script. But it's purging all files older that 30days. How do I make sure that it purges only the files that match my pattern. Here is my script:

Use the -name option of the find command :

targetfilepattern=$1_$2_$ASC_DT.dat
for file in $targetfilepattern ; do
mv "$file" $targetarchive
compress $targetarchive/"$file"
done 
find . \( -type d ! -name . -prune \) -o -type f -name "$targetfilepattern" -mtime +30 -exec rm {} \;

Jean-Pierre.