
A free-form procedure-beginning statement begins with DCL-PROC, followed by the procedure name, followed by keywords, and finally a semicolon. If there is no prototype for the procedure, and *DCLCASE is specified for the procedure-name parameter of the EXTPROC keyword, then the external name of the procedure is the same as the name specified for the DCL-PROC statement, in the same case.
A free-form procedure-ending statement begins with END-PROC, optionally followed by the procedure name, and finally a semicolon. If the name is specified, it must be the same as the name specified on the procedure-beginning statement.
DCL-PROC getCustName
/IF DEFINED(EXPORT_ALL_PROCEDURES)
EXPORT
/ENDIF
;
DCL-PROC cleanup;
CLOSE *ALL;
UNLOCK *ALL;
deleteTempUsrspc();
END-PROC;
DCL-PROC getNextOrder; 1
DCL-PI *N IND
EXTPROC(*DCLCASE); 2
order LIKEDS(order_t);
END-PI;
DCL-F orders STATIC;
READ orders order;
RETURN %EOF(orders);
END-PROC getNextOrder;
