zowe-cli icon indicating copy to clipboard operation
zowe-cli copied to clipboard

Feature: forward retcode to the output

Open OlegKunitsyn opened this issue 3 years ago • 3 comments

Program:

       IDENTIFICATION DIVISION.
       PROGRAM-ID. HELLO.
       PROCEDURE DIVISION.
	   DISPLAY "Hello!".
           MOVE 1 TO RETURN-CODE.
           STOP RUN.
       END PROGRAM HELLO.

Now:

$ zowe jobs submit local-file hello.jcl --view-all-spool-content
...
Hello!
$ echo $?
0
$ zowe jobs submit local-file hello.jcl --wait-for-output --rff retcode --rft string | cut -d" " -f 2
0001

Proposal:

$ zowe jobs submit local-file hello.jcl --view-result-with-exit-code
Hello!
$ echo $?
1

Pros:

  • get rid of retcode parsers in CI pipelines (see Zowe tutorials with CircleCI)
  • single-line job submission with result and exit-code

OlegKunitsyn avatar Jan 10 '21 11:01 OlegKunitsyn

I'd like to have the CC presented as a number rather than a string "CC 0008" -> 8. The trouble I see with assigning the retcode of the job to the retcode of the command is that you would not know whether the command itself failed or the job failed.

MikeBauerCA avatar Jan 15 '21 20:01 MikeBauerCA

Runtime or JCL errors permanently return 0

$ zowe jobs submit local-file hello.jcl --view-all-spool-content
...
$ echo $?
0

OlegKunitsyn avatar Jan 16 '21 07:01 OlegKunitsyn

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] avatar Oct 18 '22 13:10 github-actions[bot]