zowe / zowe-cli

Zowe CLI
Eclipse Public License 2.0
114 stars 86 forks source link

Feature: forward retcode to the output #901

Open OlegKunitsyn opened 3 years ago

OlegKunitsyn commented 3 years ago

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:

MikeBauerCA commented 3 years ago

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.

OlegKunitsyn commented 3 years ago

Runtime or JCL errors permanently return 0

$ zowe jobs submit local-file hello.jcl --view-all-spool-content
...
$ echo $?
0
github-actions[bot] commented 2 years 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.