Looping through Data Folders

Hi,
I am currently in data folder root:SAS which contains many, many data folders. These data folders ultimately contain the waves I will process. Can someone please provide me with code snippets that will allow me to loop through all of these data folders and change the current data folder to the data folder specified by the loop index during the looping process? In other words, when the loop index changes, I want the current data folder to be changed (in association with the loop index) also.

PS I have been trying to play with the new DFR stuff that was introduced in 6.1.

Thanks