Statement is illegal outside of a subprogram

You used a statement that is not legal at the module level. These statements include:

Revise the script to remove any of these statements at the module level.