User exit
{{short description|Software extension that executes after a predefined event}}
A user exit is a subroutine invoked by a software package for a predefined event in the execution of the package. In some cases the exit is specified by the installation when configuring the package while in other cases the users of the package can substitute their own subroutines in place of the default ones provided by the package vendor to provide customized functionality. In some cases security controls restrict exits to authorized users, e.g., EXCP appendages in MVS.
The earliest use of this term involved operating systems to let customized code temporarily take control when a pre-designated event occurred.IBM term: OS/MFT, MVT {{cite magazine |magazine=Computerworld
|date=April 11, 1977 |page=25 |url=https://books.google.com/books?id=ql57Hehq6q0C |title=OS User Exits
|quote=... so that execution ... under OS/MFT or MVT. ... ease of use for applications with ... user exits}}{{cite web |title=Platform Server for z/OS Installation and Operations Guide
|quote=Using MFT Platform Server Exits describes the User Exits that ...
|url=https://docs.tibco.com/pub/managed-file-transfer-platform-server-for-zos/7.2.0/doc/pdf/MFT%2520Platform%2520Server%25207.2.0%2520for%2520zOS%2520Installation%2520And%2520Operations%2520Guide.pdf}}
A more typical use is replacing the user exits provided by a sort/merge package,{{cite web |title=COBOL E15 user exit: passing or changing records for sort
|url=https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.icea100/cober15.htm
|quote=If both E15 and E35 user exits are used ... SORTIN DD statement}}{{cite web
|url=https://help.sap.com/erp2005_ehp_07/helpdata/en/81/80b6535fe6b74ce10000000a174cb4/content.htm
|title=Sorting Using the User Exit |website=SAP.com (SAP Documentation)}}{{cite web |title=Unicenter CA-Sort for VSE |url=https://support.ca.com/cadocs/0/k010181e.pdf
|quote=If Unicenter CA-Sort overlays the user exit storage with ...}} whereby the user program provides its own subroutines for comparing records. The procedures provided by the user take the place of the default routines (usually stubs that do nothing but return to their caller) provided by the package vendor.
Procedures provided as user exits are typically compiled into a static library and linked directly with the package to produce an executable program. Another approach employs dynamic libraries to accomplish the same thing.
Finally, user exits may be external programs executed at specific points in the execution of a host package.{{cite web |url=http://www.redbooks.ibm.com/abstracts/gg244178.html |title=Did You Say CMVC? |access-date=2013-07-22}}
History
Restrictions
If the user site specific code is substituted for the software vendor provided default exit it must interface to the software package using the defined parameters as documented for the default exit. User exits are important because while they enable site specific customization they isolate such installation specific customization to defined and supported points enabling the site to upgrade to follow-on releases of the software package without adverse impact to preexisting customized functionality. Some references to IBM user exit manuals are given below. Other vendors such as SAP, Oracle, IFS, HP, Macro4, Compuware, CA all employ user exits in some of their software products.
=Example=
In SAP, A 'COMMIT WORK' must never be used inside a User Exit, as it may affect the program processing. Furthermore, error messages may not be issued from inside an exit, as they halt the processing of the code that follows the message.
=Enforcing standards=
If files containing user-created content are meant to follow a standard, the (file) Open command of a word-processing document can invoke a user exit that does validation and, if necessary, returns an error code.Sample: Opinion.AnalystID.StockSymbol.DateTime - Opinion.Q347.IBM.201907031321 - alternatively, the date/time portion may be filled in by the user exit.
Applications
Some applications that provide user exits: