We do this sort of validation during batch promotion, by examining the transport case file directly.
If this approach seems interesting, you’re welcome to take a look at the
scripts we use. During batch promotion, we use the
parse_transport_case.sh
script to, among other things, extract the entire content of the scripting tabs of all executable objects in the file. We then examine the scripting tab content using other scripts, including a script that includes some regular expressions that are helpful for identifying
:INCLUDE
statements in AE scripting tabs and extracting the name of the referenced JOBI object for each.
Here is an example based on an excerpt of that script:
regex="((^$)|(^\!.*$)|(^:.*$)|(^ *$))"
if [[ "${OT_Content}" =~ $regex ]]; then # AE JCL line
echo "AE script line -> ${OT_Content}"
regex2="^(: *INC|: *INCLUDE).*$"
if [[ "${OT_Content}" =~ $regex2 ]]; then
echo ":INCLUDE statement -> ${OT_Content}"
JOBI_Name=$(echo "${OT_Content}" | awk -F'(: *INC |: *INCLUDE |!)' '{print $2}' )
echo "JOBI object -> ${JOBI_Name}"
fi
fi
Knowing the JOBI object name, you could then check to see if the object is in the transport case file, or in the target AE system.
(I updated the awk command that extracts the JOBI name. It now ignores
end-of-line AE scripting comments.)