The EXECUTE command
reads the contents of the file that is specified as either a quoted
string path or as a fileref. The contents are then parsed into a groovy.lang.Script
object, and the Run method is called on the Script. If one of the
LOAD, PARSEONLY, or NORUN options is present, then this command parses
the file contents into a Class object but does not run it. Any classes
that are defined by the Groovy code are then available for use by
PROC GROOVY statements or by Java DATA Step Objects.
EXEC is an alias for
the EXECUTE command.
Note: If you used an EXEC PARSEONLY
command to compile a file into a Class, then you must submit a CLASS
command so that changes to that file are honored by future EXEC PARSEONLY
commands. If you do not submit the CLEAR command, then any changes
that you made to the file after you issued the EXEC PARSEONLY command
are not included by subsequent submissions of the EXEC PARSEONLY command.
You can use the GroovyScriptEngine Class if you need to use reloadable
scripts.