Defines the end of a subroutine or event-handler.
ENDSR
ENDSR must be the last statement in the subroutine.
Conditioning indicator entries are not allowed.
The ENDSR causes a subroutine to branch back to the statement immediately following the EXSR operation, unless the subroutine is an event handler, in which case control goes back to the event cycle.
//Subroutine to get customer details record with Endsr used to define an exit.
BegSR
GetDetail
ReadRand CustMaster CustNumber NotFnd(*IN99)
If *IN99
CustNbr = 0
CustName = ''
Endif
EndSR