Setting return code for job in rule type id 10000002. There is one production job which successful return code in 3569. Submitting that job with error from ALC, how can this be avoided so that it will not impact other job execution and accommodate this job also?
Release : 3.0
Component : CA APPLICATION LIFECYCLE CONDUCTOR
ALC rule type "Run Job via z/OS MF" ID 1000002 was modified to accommodate the different condition code 3569.
The change is straightforward as follows: WAS if (ccCode > highestSuccessCode) IS if (ccCode > highestSuccessCode && ccCode != 3569)
The rule now checks if the ccCode is >8 and ccCode not equal to 3569.
I've attached the entire script . " && ccCode != 3569" is the actual change.
Here's the snippet of code the change is located in:
var ccCode = jclRunner.execute(zosmf, user, pwd, jcl, true, filter);
var highestSuccessCode = 8;
if (typeof errorCodeThreshold != "undefined")
highestSuccessCode = errorCodeThreshold;
if (ccCode > highestSuccessCode && ccCode != 3569)
scriptError = "Job Failure: Return Code " + java.lang.Integer.valueOf(ccCode).toString();
else {
result = "Job Succeeded: Return Code " + java.lang.Integer.valueOf(ccCode).toString();
// Expose the output map as a variable
jclOutput = jclRunner.output;
}
FULL CODE:
//#AllowPublic#
// Get runtime values
var attrs = executingRule.getAttributes();
var jcl = attrs.getItemByAttributeTypeName("JCL").getText();
var zosmf = attrs.getItemByAttributeTypeName("z/OS MF End Point").getText();
var user = attrs.getItemByAttributeTypeName("User").getText();
var pwd = attrs.getItemByAttributeTypeName("Password").callInternal(rulesToken, "getDecryptedPassword", null);
// Allow for override by variable
if (typeof zosEndpoint != "undefined")
zosmf = zosEndpoint;
if (typeof zosUser != "undefined")
user = zosUser;
if (typeof zosPwd != "undefined")
pwd = zosPwd;
if (jcl.trim().startsWith("#=")) {
jcl = eval("jcl = " + jcl.substring(2) +";");
}
// Replace variables
var ptn = java.util.regex.Pattern.compile("%(.*?)%", java.util.regex.Pattern.MULTILINE)
var match = ptn.matcher(jcl);
while (match.find()) {
eval("var varValue = " + match.group(1));
jcl = jcl.substring(0, match.start(1) - 1) + varValue + jcl.substring(match.end(1) + 1);
match = ptn.matcher(jcl);
}
// Use the Java utility
var jclRunner;
if (zosmf.trim().startsWith("ftp"))
jclRunner = new Packages.com.ca.zftp.RunJCL();
else
jclRunner = new Packages.com.ca.zosmf.RunJCL();
var filter = java.lang.reflect.Array.newInstance(java.lang.String, 0);
//filter[0] = "C1MSGS1";
var ccCode = jclRunner.execute(zosmf, user, pwd, jcl, true, filter);
var highestSuccessCode = 8;
if (typeof errorCodeThreshold != "undefined")
highestSuccessCode = errorCodeThreshold;
if (ccCode > highestSuccessCode && ccCode != 3569)
scriptError = "Job Failure: Return Code " + java.lang.Integer.valueOf(ccCode).toString();
else {
result = "Job Succeeded: Return Code " + java.lang.Integer.valueOf(ccCode).toString();
// Expose the output map as a variable
jclOutput = jclRunner.output;
}
if (typeof updatejira != "undefined" && java.lang.String.valueOf("TRUE").equalsIgnoreCase(updatejira) &&
typeof ccId != "undefined" && typeof cddJiraContent != "undefined") {
var jiraid = cddJiraContent.get(ccId);
var jac = VegasConnectorFactory.getInstance().getConnector("purescm.vegas.plugins.jira.JiraCommentConnector");
var extraInfo = "User=" + jirauser + ";Password=" + StringEncrypter.aesDecrypt(jirapwd) + ";ParentID=" + jiraid;
var obj = jac.newObject("", StringEncrypter.aesEncrypt(extraInfo));
var names = obj.getDisplayNames();
var values = obj.getValues();
var linkText = new java.lang.StringBuilder(executingRule.getName() + "\n");
var uItr = jclRunner.urls.entrySet().iterator();