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.
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.
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.
My code is this one.
Thanks in advance.
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.