zowe / zowe-cli

Zowe CLI
Eclipse Public License 2.0
113 stars 87 forks source link

zowe jobs submit ds --wfo | --directory | --vasc success with/JCL ERROR #952

Open dkelosky opened 3 years ago

dkelosky commented 3 years ago

If I run a job through zowe CLI with a command options that waits for the job complete, the end status always seems to be successful, e.g.:

C:\dev\node\zowe-cli>zowe jobs submit ds "ibmuser.work.jcl(asmtest1)" --wfo --rfj
{
  "success": true,
  "exitCode": 0,
  "message": "Submitted JCL contained in \"dataset\": \"ibmuser.work.jcl(asmtest1)\"",
  "stdout": "\u001b[33mjobid: \u001b[39m  JOB17745\n\u001b[33mretcode: \u001b[39mJCL ERROR\n\u001b[33mjobname: \u001b[39mIBMUSER$\n\u001b[33mstatus: \u001b[39m OUTPUT\n",
  "stderr": "",
  "data": {
    "owner": "IBMUSER",
    "phase": 20,
    "subsystem": "JES2",
    "phase-name": "Job is on the hard copy queue",
    "job-correlator": "J0017745xxxxxD9FA62E9.......:",
    "type": "JOB",
    "url": "https://xxxx:1443/zosmf/restjobs/jobs/J0017745xxxxD9FA62E9.......%3A",
    "jobid": "JOB17745",
    "class": "K",
    "files-url": "https://xxxx:1443/zosmf/restjobs/jobs/J0017745xxxxD9FA62E9.......%3A/files",
    "jobname": "IBMUSER$",
    "status": "OUTPUT",
    "retcode": "JCL ERROR"
  }
}

It would be nice if there were some flag to fail the command when the job itself doesn't end with CC 0000.

MikeBauerCA commented 3 years ago

I think there can be value in having a distinction between JCL ERROR and a REST API error.

What do you think about a --maxrc flag? In this case, JCL ERROR should trip any maxrc value, as long as it is set, resulting in a failure. This could also eliminate the need to parse the typical CC nnnn into a number to work with. If implemented in this fashion, it shouldn't be a breaking change.

github-actions[bot] commented 1 year ago

Thank you for raising this issue. The community has 90 days to upvote 👍 the issue. If it receives 5 upvotes, we will move it to our backlog. If not, we will close it.

github-actions[bot] commented 1 year ago

Thank you for raising this enhancement request. The community has 90 days to vote on it. If the enhancement receives at least 5 upvotes, it is added to our development backlog. If it receives fewer votes, the issue is closed.