Skip to main content

[archive] Return code problems

  • August 14, 2008
  • 1 reply
  • 0 views

[Migrated content. Thread originally posted on 30 July 2008]

We run many cobol programs called from HP-UX scripts. In the scripts we check the return codes after running the cobol programs.

We recently updated to new HP hardware and we're finding that the return codes are not always the same as the return code being populated in the cobol program.

I've displayed the value of the return code just before the stop job in the cobol program and then displayed the return code in the calling UNIX script. They don't always match!!!!

Has anyone come across this problem before?

We're running AcuGT version 7.2 on an HP rp5470 - we'll be upgrading to 8.0 soon.

Output:

return code calculated = 0002 ------cobol program setting return code
20:34:23 PRODUCE MEMO REPORTS END. CODE = 0002

typeset -i r=0 --- this is UNIX setting the return code to 0!!!! It should be 2
echo return code from arb010 = 0
return code from arb010 = 0

1 reply

[Migrated content. Thread originally posted on 30 July 2008]

We run many cobol programs called from HP-UX scripts. In the scripts we check the return codes after running the cobol programs.

We recently updated to new HP hardware and we're finding that the return codes are not always the same as the return code being populated in the cobol program.

I've displayed the value of the return code just before the stop job in the cobol program and then displayed the return code in the calling UNIX script. They don't always match!!!!

Has anyone come across this problem before?

We're running AcuGT version 7.2 on an HP rp5470 - we'll be upgrading to 8.0 soon.

Output:

return code calculated = 0002 ------cobol program setting return code
20:34:23 PRODUCE MEMO REPORTS END. CODE = 0002

typeset -i r=0 --- this is UNIX setting the return code to 0!!!! It should be 2
echo return code from arb010 = 0
return code from arb010 = 0
I found the problem.

The old machine was 32 bit and the new machine is 64. By changing the compile script and using -Dw64 instead of -Dw32 the problem disappeared. I assume that it was caused by the COBOL compiler creating a 32 bit working storage variable (RETURN) and when passing that variable through the 64 bit operating system there is a misalignment of bits.