Does it matter if it's uppercase or lowercase, as long as it's consistent?
Okay Arnout, I pasted your code into the CAOS program to make it easier to read and I believe I've found your error. When I pasted it in, I clicked File > Refresh Syntax and the CAOS program checked the code for me. The error output window immediately posted this:
Checking 'cos1'...
Line 96: 'endm' expected, got end-of-source
Done. 1 syntax error(s) found.
(Bolded by me). There needs to be an "endm" at the end of a script to tell it where that script ends. Otherwise it just keeps reading until it hits the end of the file or something that can't go in a script, like the rscr, and gets confused.
I do recommend that you use the error output window, if you're using the CAOS program. You can find it under View > Error Output Window. It will bring up this little window which will give you a better idea of what's happening if something goes wrong.