Page 1 of 1

Moving High-Values from Comp-3 - COBOL Ver 6.4

Posted: Thu Jul 20, 2023 12:08 pm
by girik1001
Hi,

We are trying to execute the below code, but 6.4 version is throwing SOC7, whereas 2.2 version is running fine. I wanted to know is there any doc which explain this case...!

Prog code is as follows.

Working storage section.

01 WS-COMP3-VAR.
05 WS-COMP3-VAR1 PIC S9(7) COMP-3.

01 WS-NOR-VAR PIC 9(7).

PROCEDURE DIVISION.

MOVE HIGH-VALUES TO WS-COMP3-VAR. --> High values are moved to group variable

MOVE WS-COMP3-VAR1 TO WS-NOR-VAR --> COMP-3 variable is moving to normal variable causing SOC7.

Compilation is fine - no waning message or so. But the execution is causing SOC7 in 6.4 version only. in 2.2 version it is working fine.

Actually, we have a proj running to upgrade cobol ver from 2.2 to 6.4.

any details on this will be helpful.

Re: Moving High-Values from Comp-3 - COBOL Ver 6.4

Posted: Thu Jul 20, 2023 6:38 pm
by sergeyken
Generally speaking, in IBM COBOL the HIGH-VALUES are physically incompatible with COMP-3 data type.

What is the need for you to move this value to COMP-3 field? :o
My opinion: it makes absolutely no sense, to code such useless tricks. Unless your goal is: investigation of tricks and gimmicks of COBOL compiler versions...

P.S.
Learn how to use the Code button

Code: Select all

when posting your code and data samples