What needs to be done to have a exit 7 program validate that the package ID has met all of our company's requirements?
This document describes how to use the Endevor software for an Exit 7 (package exit point) to validate that a package ID defined by a user meets your site standards.
This description refers to the COBOL field names. Refer to the assembler section of the Endevor Change Manager Exit Guide located at the following url: https://docops.ca.com/ca-endevor-SCM/18/en/api-and-user-exits-reference.
Identifying Exit 7 Programs to Endevor
Making use of Exit 7 to validate a package ID is a 3-step process.
@C1UEXIT EXIT#=7,NAME=MYEXIT7,ANCHID=0,AUTH=YES
Validating a Package ID
Writing a program using the CREATE-PACKAGE flags, you can validate a package ID created by a user and issue an error message if it does not meet your site naming conventions.
There are three possible exit points to enable, depending on how you create packages at your site. These exit points are:
Exit 7 Program To Validate Package IDs
An Exit 7 program to validate package IDs must consist of a:
The setup exit options routine is called at Endevor initialization time. Your code must set one or more of the PECB-BEFORE-CREATE flags to a value of 'Y' at this point. If you intend for this exit to get called for batch package actions be sure to also set the PECB-BATCH-EXECUTE flag to a value of 'Y'. The default value is 'N'. Your code should look similar to the following.
IF SETUP-EXIT-OPTIONS
MOVE 'Y' TO PECB-BATCH-EXECUTE
PECB-BEFORE-CREATE-BLD
PECB-BEFORE-CREATE-IMPT
PECB-BEFORE-CREATE-COPY
MOVE ZEROS TO RETURN-CODE
GO TO 900-MAIN-EXIT.
A simple create package ID validation routine might test the first five characters of the package ID and issue an error message if these five characters are not the same as the site standard. Your code might look like this:
IF CREATE-PACKAGE
DISPLAY 'VALIDATING PACKAGE ID'
MOVE PECB-PACKAGE-ID TO WS-PKGID
IF WS-PKGID-1-5 = 'TESTX'
DISPLAY 'THIS IS A VALID PACKAGE ID'
MOVE WS-PKGID TO PECB-PACKAGE-ID
MOVE ZEROS TO RETURN-CODE
ELSE
DISPLAY 'THIS IS NOT A VALID PACKAGE ID'
MOVE 12 TO PECB-NDVR-EXIT-RC
GO TO 900-MAIN-EXIT.
Disclaimer: The code samples in this article are provided on an as is basis. Broadcom Endevor Technical Support supports neither of these samples nor user-written exit programs.