问题描述
我最近开始了COBOL
课程,由于我的计算机配置(Windows 7 64 Bits
和GNU/Linux 64Bits)
,我必须使用Dosbox
来编译和执行程序.
I've recently started a COBOL
course and, because of my computer configuration (Windows 7 64 Bits
and GNU/Linux 64Bits)
I have to use Dosbox
to compile and execute programs.
一切正常,但是,当我尝试打开Indexed file
(I-O
或Ouput
)模式时,我发现有些麻烦.我可以编译和链接,但是在执行时,dosbox
被冻结.
Everything is going well but, I'n finding some troubles when I try to open an Indexed file
, either I-O
or Ouput
mode. I can compile and link but at execution time, dosbox
get frozen.
我的编译器版本是MS-COBOL 5.0
,而DosBox
是0.74(最新版本).
My compiler version is MS-COBOL 5.0
and DosBox
is 0.74 (last version).
有人遇到过这个问题吗?有人可以告诉他们如何解决它.
Does anybody have had this issue? Can someone tell how to fix it.
我的代码就是这个.
谢谢.
IDENTIFICATION DIVISION.
PROGRAM-ID. AGENDA.
AUTHOR. JOSE MARIA RAMIREZ MIRA.
DATE-WRITTEN. 06/05/2014.
DATE-COMPILED. 06/05/2014.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-PC.
OBJECT-COMPUTER. IBM-PC.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT AGENDA ASSIGN TO DISK "AGENDA.DAT"
ORGANIZATION IS INDEXED
ACCESS IS RANDOM
RECORD KEY IS AG-NICK
FILE STATUS IS AG-STATUS.
DATA DIVISION.
FILE SECTION.
FD AGENDA
RECORD CONTAINS 112 CHARACTERS
LABEL RECORD IS STANDARD
DATA RECORD IS AG-PERSONA.
01 AG-PERSONA.
03 AG-NICK PIC X(25).
03 AG-NOMBRE PIC X(25).
03 AG-APELLIDOS PIC X(50).
03 AG-TELEFONO PIC X(12).
WORKING-STORAGE SECTION.
77 AG-STATUS PIC 99.
88 EXITO VALUE 00.
88 CLAVE-DUPLICADA VALUE 22.
88 CLAVE-NO-ENCONTRADA VALUE 23.
88 SIN-ESPACIO-EN-DISCO VALUE 34.
88 FICHERO-NO-EXISTE VALUE 35.
88 EOF VALUE 10.
PROCEDURE DIVISION.
MAIN-PROCEDURE.
DISPLAY "PROCEDO A ABRIR EL ARCHIVO".
OPEN I-O AGENDA.
IF EXITO THEN
DISPLAY "EL ARCHIVO SE HA ABIERTO"
ELSE
EVALUATE TRUE
WHEN FICHERO-NO-EXISTE
DISPLAY "EL ARCHIVO NO EXISTE"
END-EVALUATE
END-IF.
CLOSE AGENDA.
STOP RUN.
END PROGRAM AGENDA.
推荐答案
DOSBox专为游戏而设计.问题可能是DOSBox缺少文件和记录锁定.DOSBox还有更多问题,例如内部文件缓存,具有多用户启用程序的定时炸弹.您可以尝试使用vDos: http://sourceforge.net/projects/vdos/.它仅是Windows,但与它的集成性更好.
DOSBox was designed for gaming.The problem could be DOSBox missing file and record locking.DOSBox has more issues like internal file caching, a time bomb with multi-user enabled programs.You could try vDos: http://sourceforge.net/projects/vdos/.It is Windows only, but integrates better with it.
这篇关于打开COBOL索引文件时程序挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!