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



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

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

Postby girik1001 » Thu Jul 20, 2023 12:08 pm

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.
girik1001
 
Posts: 1
Joined: Thu Jul 20, 2023 12:00 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby sergeyken » Thu Jul 20, 2023 6:38 pm

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
when posting your code and data samples
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 409
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post