I think the error(s) are in lines N126 and N130. The WHILE statement needs something to address the code to loop and a mere "DO 1! or "DO 2" does not suffice. I haven't got any FANUC manuals to hand and it has been years since I programmed in FANUC so I don't trust my memory. However, if you don't have memory issues on the machine a simple way around this is to turn off proc's in the MAC file. Open up your MAC file in a text editor and look for a heading called "Procedures Control" and set all the variables below to "N" and see what the code looks like after that.