Skip to main content

What are the return-codes passed back from the checker?

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

Customer compiles via a script and would like to interpret the codes returned by 'cob' so they can act on a failure.  The example below fails with Error "1007-E"  and returns 12 ($?)

01 x pic x(2) value "xxxx".

procedure division.

display 'xx=' xx.

stop run.

script.sh

cob -v -C WARNING=1 $1

rc=$?

echo RC=$rc

Resolution:

The return value from the checker depends upon the most serious error returned. Fatal (aka unrecoverable) errors are 16, severe 12, error is 8, warnings are 4 and info is 2. No messages gives 0. The checker directives change-message, info-return and warning are relevant.

If the checker returns a value >= a threshold value, set by cob -W and defaulting to 12 (SEVERE), then cob stops and returns this value. Otherwise cob proceeds with the next compilation/generation/link, or returns 0 if there is no more work.

If the ncg returns any non-zero status then cob returns with 1.

If everything is success then cob returns 0.

if you want cob to give an error if the reports an "Error" then use the "-W e" cob flag.

Old KB# 4494