Description:
It might be necessary due to site specific requirements to check in a C1UEXT07 whether History exists of a Promotion Package. This knowledge document supplies you with some information about how to accomplish this.
Solution:
If one wants to know in an EXIT07 if other versions of this PKG have existed , the following fields are available in the $PHDRDS :
PHDRPROM: Is set to 'Y' if a Promotion Package PHDRPPKGID: Contains the generated name of the copy of the previously executed package. Contains Blanks if there was no Previous version ( history).
Contains Blanks if there was no Previous version ( history).
The corresponding fields in COBOL are:
PHDR-PKG-PROMOTION PHDR-PKG-PREV-PKGID
So a straightforward check on PHDRPPKGID would suffice to know if the Promotion Package has History. If it is necessary to implement logic to obtain more info about the iterations of a Promotion Package, one can use the API List Package Header function. This API function will return the historical versions when ALPKG_RQ_PROMHIST is set.