Your NCL procedure should set RETCODE=0 to indicate successful completiona non-zero return code indicates a processing failure. You can return a message from the procedure by setting the &SYSMSG variable.
For more information about NCL programming, see the Network Control Language Programmer Guide and the Network Control Language Reference Guide.