I apologize for the possible typos, english is not my mother tongue.

I´ve been working on a loop to download and unzip files from a website but I keep getting the same response when running the commands:

file
603-Modulo01/ENAHO_Definici�nValoresMonetariosBasedeDato
> s.pdf I/O error on write
could not perform unzip

program error: code follows on the same line as close brace
r(198);

And additionally, I get the last two lines which describe a problem with closing braces, although I´ve checked out the braces and apparently they´re correctly placed (I would really appreciate an answer noticing any mistakes) ; the error still pops up.
I using stata 14 MP 64 And the codes are the following ones:

#delimit;
foreach i in 603 634{;
cd "$directorio";
mkdir "$directorio/`i'";
cd "$directorio/`i'";

#delimit;
foreach j of numlist 1/5 {;
copy http://iinei.inei.gob.pe/iinei/srienaho/descarga/SPSS/`i'-Modulo0`j'.zip `i'-Modulo0`j'.zip ;
unzipfile `i'-Modulo0`j'.zip, replace;
erase `i'-Modulo0`j'.zip;
};
#delimit cr

#delimit;
foreach k of numlist 7/9 {;
copy http://iinei.inei.gob.pe/iinei/srienaho/descarga/SPSS/`i'-Modulo0`k'.zip `i'-Modulo0`k'.zip ;
unzipfile `i'-Modulo0`k'.zip, replace;
erase `i'-Modulo0`k'.zip;
};
#delimit cr

#delimit;
foreach y of numlist 10/13 {;
copy http://iinei.inei.gob.pe/iinei/srienaho/descarga/SPSS/`i'-Modulo`y'.zip `i'-Modulo`y'.zip ;
unzipfile `i'-Modulo`y'.zip, replace;
erase `i'-Modulo`y'.zip;
};
#delimit cr

#delimit;
foreach x of numlist 15/18 {;
copy http://iinei.inei.gob.pe/iinei/srienaho/descarga/SPSS/`i'-Modulo`x'.zip `i'-Modulo`x'.zip ;
unzipfile `i'-Modulo`x'.zip, replace;
erase `i'-Modulo`x'.zip;
};
#delimit cr

#delimit;
foreach p of numlist 22/28 {;
copy http://iinei.inei.gob.pe/iinei/srienaho/descarga/SPSS/`i'-Modulo`p'.zip `i'-Modulo`p'.zip ;
unzipfile `i'-Modulo`p'.zip, replace;
erase `i'-Modulo`p'.zip;
};
#delimit cr

#delimit;
foreach t in 34 37 77 78 84 85 {;
copy http://iinei.inei.gob.pe/iinei/srienaho/descarga/SPSS/`i'-Modulo`t'.zip `i'-Modulo`t'.zip ;
unzipfile `i'-Modulo`t'.zip, replace;
erase `i'-Modulo`t'.zip;
};
#delimit cr
};
#delimit cr

Thanks in advance for your responses and possible solutions.