Creating Dynamic File Names Within a Do Loop
Posted: Tue Aug 12, 2008 1:17 pm
Not sure what I'm doing wrong here. I'd like to save results on each iteration of a Do loop and append the iteration number, i, to each file name. But when I run this code, I am prompted for a location to save, and the forward slashes in my file path have been converted to hyphens.
Code: Select all
declare string theFilePath
declare string longFileName
compute theFilePath = "/Users/gregory/Documents/Folder A/"
do i=1,5
* Some stuff goes here
compute longFileName = theFilePath + "My File" + i + ".xls"
open copy &longFileName
copy(format=xls,org=col) theStart+i theEnd+i hhs
End do i