Here's your problem:
Eric A. Booth wrote:
foreach n in `reporttype' `populationtype' `sessiontype'  {
    outsheet using 
"`sf'test/`reporttype'_`populationtype'_`sessiontype'.csv", replace comma
}
I think you want:
foreach R in "`reporttype'" {
	foreach P in "`populationtype'" {
		foreach S in "`sessiontype'" {
			outsheet using "`sf'test/`R'_`P'_`S'.csv", ///
			replace comma
		}
	}
}
hth,
Jeph
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/