gpt4 book ai didi

cobol - 在 COBOL 程序中出现重叠错误

转载 作者:行者123 更新时间:2023-12-05 08:29:57 27 4
gpt4 key购买 nike

Cobol 程序:

PROGRAM-ID. SCHPROG.            
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT MYFILE ASSIGN TO INDD
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD MYFILE.
01 FILERECORDS.
05 NAME PIC A(10).
05 CLASS-IN PIC 9(1).
05 ROLL PIC 9(5).
WORKING-STORAGE SECTION.
COPY SCHMAPA.
COPY SCHMAPB.
COPY SCHMAPC.
01 END-OF-FILE PIC A(3) VALUE 'NO'.
PROCEDURE DIVISION.
000-MAIN-PARA.
PERFORM 100-SEND-MAPA.
PERFORM 100-RECEIVE-MAPA.
IF CHOICEI = '1'
PERFORM 200-SEND-MAPB
PERFORM 200-RECEIVE-MAPB
PERFORM 200-SEND-MAPB
PERFORM 100-SEND-MAPA
END-IF.
IF CHOICEI = '2'
PERFORM 300-SEND-MAPC
PERFORM 300-RECEIVE-MAPC
PERFORM 500-SRCH-REC
PERFORM 300-SEND-MAPC
PERFORM 100-SEND-MAPA
END-IF.
STOP RUN.
100-SEND-MAPA.
EXEC CICS
SEND
MAP('SCHOLA') MAPSET('SCHMAPA')
ERASE
END-EXEC.
100-RECEIVE-MAPA.
EXEC CICS
RECEIVE
MAP('SCHOLA') MAPSET('SCHMAPA')
END-EXEC.
200-SEND-MAPB.
EXEC CICS
SEND
MAP('SCHOLB') MAPSET('SCHMAPB')
ERASE
END-EXEC.
200-RECEIVE-MAPB.
EXEC CICS
RECEIVE
MAP('SCHOLB') MAPSET('SCHMAPB')
END-EXEC.
PERFORM 400-FILE-PROCESS.
300-SEND-MAPC.
EXEC CICS
SEND
MAP('SCHOLC') MAPSET('SCHMAPC')
ERASE
END-EXEC.
300-RECEIVE-MAPC.
EXEC CICS
RECEIVE
MAP('SCHOLC') MAPSET('SCHMAPC')
END-EXEC.
400-FILE-PROCESS.
OPEN OUTPUT MYFILE.
MOVE NAMEI TO NAME.
MOVE CLASSI TO CLASS-IN.
MOVE ROLLI TO ROLL.
WRITE FILERECORDS.
CLOSE MYFILE.
MOVE 'RECORD INSERTED' TO MSGBO.
500-SRCH-REC.
OPEN INPUT MYFILE.
PERFORM UNTIL END-OF-FILE = 'YES'
READ MYFILE INTO FILERECORDS
AT END
MOVE 'YES' TO END-OF-FILE
NOT AT END
IF ROLL = ROLLCI
MOVE NAME TO NAMECO
MOVE CLASS-IN TO CLASSCO
END-IF
END-READ
END-PERFORM.
CLOSE MYFILE.

获取错误。

IGYPA3043-E   Data-item "FILERECORDS (GROUP)" and record "FILERECORDS (GROUP)"
had overlapping storage. Movement of data may not occur at execution time.

我已经提供了我的 cobol 程序。请检查并帮助我找出问题所在。

我正在从 Cics 区域更新文件并使用相同的文件获取详细信息并放入 cics 区域。

不确定为什么会出现此错误。早些时候我使用相同的组数据项将记录添加到文件并且工作正常。请帮忙!!

最佳答案

虽然其他答案正确回答了您的问题,但为 CICS 编译需要一些限制记录 here并在下方引用自 2021 年 4 月 6 日起。您可能还想咨询 CICS documentation用于您的 CICS 版本和发布。

Restriction: You cannot run COBOL programs that have object-orientedsyntax for Java™ interoperability in CICS. In addition, if you writeprograms to run under CICS, do not use the following code:

  • FILE-CONTROL entry in the ENVIRONMENT DIVISION, unless theFILE-CONTROL entry is used for a SORT statement
  • FILE SECTION of theDATA DIVISION, unless the FILE SECTION is used for a SORT statement
  • User-specified parameters to the main program USE declaratives (exceptUSE FOR DEBUGGING)
  • These COBOL language statements:
  • ACCEPT format 1:data transfer (you can use format-2 ACCEPT to retrieve the system dateand time)
  • CLOSE
  • DELETE
  • DISPLAY UPON CONSOLE
  • DISPLAY UPON SYSPUNCH
  • MERGE
  • OPEN
  • READ
  • RERUN
  • REWRITE
  • START
  • STOP literal
  • WRITE

[...]

Coding file input and output: You must use CICS commands for most input and output processing. Therefore, do not describe files or codeany OPEN, CLOSE, READ, START, REWRITE, WRITE, or DELETE statements.Instead, use CICS commands to retrieve, update, insert, and deletedata.

关于cobol - 在 COBOL 程序中出现重叠错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66970097/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com