Run-time error with Compaq Cobol v 2.7 
Author Message
 Run-time error with Compaq Cobol v 2.7

I have been battling this problem since Friday.  Hopefully someone
can help.

This is running on an OpenVMS Alpha v 7.3 machine that is running
Compaq Cobol v 2.7.

I have a small program that is trying to read an indexed input file
but the program blows up on the read with the following error:

%SYSTEM-F-OPCDEC, opcode reserved to Digital fault at
PC=000000007C29C9D4, PS=0000001B
%TRACE-F-TRACEBACK, symbolic stack dump follows
  image    module    routine             line      rel PC          
abs PC
 DEC$COBRTL                                 0 000000000002C9D4
000000007C29C9D4
 DEC$COBRTL                                 0 00000000000276B0
000000007C2976B0
 STATE_TEST  STATE  STATE                  35 0000000000000104
0000000000030104
 STATE_TEST                                 0 0000000000020370
0000000000030370
                                            0 FFFFFFFF802573F4
FFFFFFFF802573F4

The program I am using to try and do this is just a little test
program:

IDENTIFICATION DIVISION.
PROGRAM-ID.     STATE.

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
    SELECT STATE-FILE ASSIGN TO "STATE.DAT"
           ORGANIZATION IS INDEXED
           ACCESS MODE IS DYNAMIC
           RECORD KEY IS STATE-KEY
           FILE STATUS IS STATESTATUS.

DATA DIVISION.
FILE SECTION.
FD STATE-FILE.
01  STATE-RECORD.
    02 STATE-KEY        PIC X(02).
    02 STATE-INDEX      PIC 9(02).
    02 STATE-NAME       PIC X(14).

WORKING-STORAGE SECTION.
01  ENDOFFILE   PIC X(1).
01  STATESTATUS PIC X(2).

PROCEDURE DIVISION.

001-START-HERE.
    OPEN INPUT ST-FILE.
    OPEN OUTPUT STATE-FILE.

    READ ST-FILE
        AT END MOVE "T" TO ENDOFFILE.

    PERFORM UNTIL ENDOFFILE = "T"
        WRITE STATE-RECORD FROM ST-RECORD
            INVALID KEY DISPLAY "VIDEO STATUS :- ", STATESTATUS
        END-WRITE
        READ ST-FILE
            AT END MOVE "T" TO ENDOFFILE
        END-READ
    END-PERFORM.

    CLOSE STATE-FILE
          ST-FILE.
    STOP RUN.



Thu, 26 Feb 2004 14:27:48 GMT  
 Run-time error with Compaq Cobol v 2.7

Quote:

> I have been battling this problem since Friday.  Hopefully someone
> can help.

> This is running on an OpenVMS Alpha v 7.3 machine that is running
> Compaq Cobol v 2.7.

> I have a small program that is trying to read an indexed input file
> but the program blows up on the read with the following error:

You say you are trying to read an indexed input file, but the only
file defined in your FILE-CONTROL paragraph is STATE-FILE, which you
open for OUTPUT.

You are trying to read ST-FILE, which is not defined in your
FILE-CONTROL paragraph, and has no FD in the FILE SECTION of the DATA
DIVISION.

Also, if you are attempting to write to STATE-FILE, you probably want
to define it with ACCESS IS SEQUENTIAL or ACCESS IS RANDOM, rather
that DYNAMIC access.  I don't believe DYNAMIC access will work for an
output file.

If you intend to read ST-FILE and write STATE-FILE you must have two
SELECT statements and two FD's.

Quote:

> %SYSTEM-F-OPCDEC, opcode reserved to Digital fault at
> PC=000000007C29C9D4, PS=0000001B
> %TRACE-F-TRACEBACK, symbolic stack dump follows
>   image    module    routine             line      rel PC
> abs PC
>  DEC$COBRTL                                 0 000000000002C9D4
> 000000007C29C9D4
>  DEC$COBRTL                                 0 00000000000276B0
> 000000007C2976B0
>  STATE_TEST  STATE  STATE                  35 0000000000000104
> 0000000000030104
>  STATE_TEST                                 0 0000000000020370
> 0000000000030370
>                                             0 FFFFFFFF802573F4
> FFFFFFFF802573F4

> The program I am using to try and do this is just a little test
> program:

> IDENTIFICATION DIVISION.
> PROGRAM-ID.     STATE.

> ENVIRONMENT DIVISION.
> INPUT-OUTPUT SECTION.
> FILE-CONTROL.
>     SELECT STATE-FILE ASSIGN TO "STATE.DAT"
>            ORGANIZATION IS INDEXED
>            ACCESS MODE IS DYNAMIC
>            RECORD KEY IS STATE-KEY
>            FILE STATUS IS STATESTATUS.

> DATA DIVISION.
> FILE SECTION.
> FD STATE-FILE.
> 01  STATE-RECORD.
>     02 STATE-KEY        PIC X(02).
>     02 STATE-INDEX      PIC 9(02).
>     02 STATE-NAME       PIC X(14).

> WORKING-STORAGE SECTION.
> 01  ENDOFFILE   PIC X(1).
> 01  STATESTATUS PIC X(2).

> PROCEDURE DIVISION.

> 001-START-HERE.
>     OPEN INPUT ST-FILE.
>     OPEN OUTPUT STATE-FILE.

>     READ ST-FILE
>         AT END MOVE "T" TO ENDOFFILE.

>     PERFORM UNTIL ENDOFFILE = "T"
>         WRITE STATE-RECORD FROM ST-RECORD
>             INVALID KEY DISPLAY "VIDEO STATUS :- ", STATESTATUS
>         END-WRITE
>         READ ST-FILE
>             AT END MOVE "T" TO ENDOFFILE
>         END-READ
>     END-PERFORM.

>     CLOSE STATE-FILE
>           ST-FILE.
>     STOP RUN.

--
http://arnold.trembley.home.att.net/


Thu, 26 Feb 2004 15:42:28 GMT  
 Run-time error with Compaq Cobol v 2.7
*** Sorry about that.  I posted the wrong piece of code.  Here is a
corrected post. ***

I have been battling this problem since Friday.  Hopefully someone
can help.

This is running on an OpenVMS Alpha v 7.3 machine that is running
Compaq Cobol v 2.7.

I have a small program that is trying to read an indexed input file
but the program blows up on the read with the following error:

%SYSTEM-F-OPCDEC, opcode reserved to Digital fault at
PC=000000007C29C9D4, PS=0000001B
%TRACE-F-TRACEBACK, symbolic stack dump follows
  image    module    routine             line      rel PC          
abs PC
 DEC$COBRTL                                 0 000000000002C9D4
000000007C29C9D4
 DEC$COBRTL                                 0 00000000000276B0
000000007C2976B0
 STATE_TEST  STATE  STATE                  35 0000000000000104
0000000000030104
 STATE_TEST                                 0 0000000000020370
0000000000030370
                                            0 FFFFFFFF802573F4
FFFFFFFF802573F4

The program I am using to try and do this is just a little test
program:

IDENTIFICATION DIVISION.
PROGRAM-ID.     STATE.
AUTHOR.     Robin Brady

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
    SELECT STATE-FILE ASSIGN TO "STATE.DAT"
           ORGANIZATION IS INDEXED
           ACCESS MODE IS DYNAMIC
           RECORD KEY IS STATE-KEY
           FILE STATUS IS STATESTATUS.

DATA DIVISION.
FILE SECTION.
FD STATE-FILE.
01  STATE-RECORD.
    02 STATE-KEY        PIC X(02).
    02 STATE-INDEX      PIC 9(02).
    02 STATE-NAME       PIC X(14).

WORKING-STORAGE SECTION.
01  ENDOFFILE   PIC X(1).
01  STATESTATUS PIC X(2).

PROCEDURE DIVISION.

001-START-HERE.
    OPEN INPUT STATE-FILE.

    MOVE "AL" TO STATE-KEY.
    DISPLAY SPACE LINE 1 COLUMN 1 ERASE TO END OF SCREEN.
    READ STATE-FILE
        INVALID KEY DISPLAY "BAD KEY".

    CLOSE STATE-FILE.
    STOP RUN.



Thu, 26 Feb 2004 16:37:45 GMT  
 Run-time error with Compaq Cobol v 2.7
Check STATE-STATUS immediately following the OPEN. I got forty-two cents sez
your problem is the file not opening correctly. I've seen lots of weird
errors trying to read a non-opened file, or trying to access a file buffer
for a non-opened file.

If the OPEN failed, the MOVE to STATE-KEY is trying to write to inaccessible
memory, and the READ is beyond prayer.

MCM


Quote:
> *** Sorry about that.  I posted the wrong piece of code.  Here is a
> corrected post. ***

> PROCEDURE DIVISION.

> 001-START-HERE.
>     OPEN INPUT STATE-FILE.

>     MOVE "AL" TO STATE-KEY.
>     DISPLAY SPACE LINE 1 COLUMN 1 ERASE TO END OF SCREEN.
>     READ STATE-FILE
>         INVALID KEY DISPLAY "BAD KEY".

>     CLOSE STATE-FILE.
>     STOP RUN.



Thu, 26 Feb 2004 22:10:29 GMT  
 Run-time error with Compaq Cobol v 2.7
Betcha the file's not there. ("35" = File not present)

Try fully qualifying the file name in the select statement.


Quote:
> *** Sorry about that.  I posted the wrong piece of code.  Here is a
> corrected post. ***

> I have been battling this problem since Friday.  Hopefully someone
> can help.

> This is running on an OpenVMS Alpha v 7.3 machine that is running
> Compaq Cobol v 2.7.

> I have a small program that is trying to read an indexed input file
> but the program blows up on the read with the following error:

> %SYSTEM-F-OPCDEC, opcode reserved to Digital fault at
> PC=000000007C29C9D4, PS=0000001B
> %TRACE-F-TRACEBACK, symbolic stack dump follows
>   image    module    routine             line      rel PC
> abs PC
>  DEC$COBRTL                                 0 000000000002C9D4
> 000000007C29C9D4
>  DEC$COBRTL                                 0 00000000000276B0
> 000000007C2976B0
>  STATE_TEST  STATE  STATE                  35 0000000000000104
> 0000000000030104
>  STATE_TEST                                 0 0000000000020370
> 0000000000030370
>                                             0 FFFFFFFF802573F4
> FFFFFFFF802573F4

> The program I am using to try and do this is just a little test
> program:

> IDENTIFICATION DIVISION.
> PROGRAM-ID.     STATE.
> AUTHOR.     Robin Brady

> ENVIRONMENT DIVISION.
> INPUT-OUTPUT SECTION.
> FILE-CONTROL.
>     SELECT STATE-FILE ASSIGN TO "STATE.DAT"
>            ORGANIZATION IS INDEXED
>            ACCESS MODE IS DYNAMIC
>            RECORD KEY IS STATE-KEY
>            FILE STATUS IS STATESTATUS.

> DATA DIVISION.
> FILE SECTION.
> FD STATE-FILE.
> 01  STATE-RECORD.
>     02 STATE-KEY        PIC X(02).
>     02 STATE-INDEX      PIC 9(02).
>     02 STATE-NAME       PIC X(14).

> WORKING-STORAGE SECTION.
> 01  ENDOFFILE   PIC X(1).
> 01  STATESTATUS PIC X(2).

> PROCEDURE DIVISION.

> 001-START-HERE.
>     OPEN INPUT STATE-FILE.

>     MOVE "AL" TO STATE-KEY.
>     DISPLAY SPACE LINE 1 COLUMN 1 ERASE TO END OF SCREEN.
>     READ STATE-FILE
>         INVALID KEY DISPLAY "BAD KEY".

>     CLOSE STATE-FILE.
>     STOP RUN.



Thu, 26 Feb 2004 23:40:14 GMT  
 Run-time error with Compaq Cobol v 2.7
Just check the status code.  It is "00" so it seems to be getting
the file open.

I've also re-created the file using a Cobol program to create it and
write to it but still no success.

Quote:

> Betcha the file's not there. ("35" = File not present)

> Try fully qualifying the file name in the select statement.



> > *** Sorry about that.  I posted the wrong piece of code.  Here is a
> > corrected post. ***

> > I have been battling this problem since Friday.  Hopefully someone
> > can help.

> > This is running on an OpenVMS Alpha v 7.3 machine that is running
> > Compaq Cobol v 2.7.

> > I have a small program that is trying to read an indexed input file
> > but the program blows up on the read with the following error:

> > %SYSTEM-F-OPCDEC, opcode reserved to Digital fault at
> > PC=000000007C29C9D4, PS=0000001B
> > %TRACE-F-TRACEBACK, symbolic stack dump follows
> >   image    module    routine             line      rel PC
> > abs PC
> >  DEC$COBRTL                                 0 000000000002C9D4
> > 000000007C29C9D4
> >  DEC$COBRTL                                 0 00000000000276B0
> > 000000007C2976B0
> >  STATE_TEST  STATE  STATE                  35 0000000000000104
> > 0000000000030104
> >  STATE_TEST                                 0 0000000000020370
> > 0000000000030370
> >                                             0 FFFFFFFF802573F4
> > FFFFFFFF802573F4

> > The program I am using to try and do this is just a little test
> > program:

> > IDENTIFICATION DIVISION.
> > PROGRAM-ID.     STATE.
> > AUTHOR.     Robin Brady

> > ENVIRONMENT DIVISION.
> > INPUT-OUTPUT SECTION.
> > FILE-CONTROL.
> >     SELECT STATE-FILE ASSIGN TO "STATE.DAT"
> >            ORGANIZATION IS INDEXED
> >            ACCESS MODE IS DYNAMIC
> >            RECORD KEY IS STATE-KEY
> >            FILE STATUS IS STATESTATUS.

> > DATA DIVISION.
> > FILE SECTION.
> > FD STATE-FILE.
> > 01  STATE-RECORD.
> >     02 STATE-KEY        PIC X(02).
> >     02 STATE-INDEX      PIC 9(02).
> >     02 STATE-NAME       PIC X(14).

> > WORKING-STORAGE SECTION.
> > 01  ENDOFFILE   PIC X(1).
> > 01  STATESTATUS PIC X(2).

> > PROCEDURE DIVISION.

> > 001-START-HERE.
> >     OPEN INPUT STATE-FILE.

> >     MOVE "AL" TO STATE-KEY.
> >     DISPLAY SPACE LINE 1 COLUMN 1 ERASE TO END OF SCREEN.
> >     READ STATE-FILE
> >         INVALID KEY DISPLAY "BAD KEY".

> >     CLOSE STATE-FILE.
> >     STOP RUN.



Fri, 27 Feb 2004 00:33:35 GMT  
 Run-time error with Compaq Cobol v 2.7
Also tried fully-qualifying the file name.  No success.
Quote:

> Just check the status code.  It is "00" so it seems to be getting
> the file open.

> I've also re-created the file using a Cobol program to create it and
> write to it but still no success.


> > Betcha the file's not there. ("35" = File not present)

> > Try fully qualifying the file name in the select statement.



> > > *** Sorry about that.  I posted the wrong piece of code.  Here is a
> > > corrected post. ***

> > > I have been battling this problem since Friday.  Hopefully someone
> > > can help.

> > > This is running on an OpenVMS Alpha v 7.3 machine that is running
> > > Compaq Cobol v 2.7.

> > > I have a small program that is trying to read an indexed input file
> > > but the program blows up on the read with the following error:

> > > %SYSTEM-F-OPCDEC, opcode reserved to Digital fault at
> > > PC=000000007C29C9D4, PS=0000001B
> > > %TRACE-F-TRACEBACK, symbolic stack dump follows
> > >   image    module    routine             line      rel PC
> > > abs PC
> > >  DEC$COBRTL                                 0 000000000002C9D4
> > > 000000007C29C9D4
> > >  DEC$COBRTL                                 0 00000000000276B0
> > > 000000007C2976B0
> > >  STATE_TEST  STATE  STATE                  35 0000000000000104
> > > 0000000000030104
> > >  STATE_TEST                                 0 0000000000020370
> > > 0000000000030370
> > >                                             0 FFFFFFFF802573F4
> > > FFFFFFFF802573F4

> > > The program I am using to try and do this is just a little test
> > > program:

> > > IDENTIFICATION DIVISION.
> > > PROGRAM-ID.     STATE.
> > > AUTHOR.     Robin Brady

> > > ENVIRONMENT DIVISION.
> > > INPUT-OUTPUT SECTION.
> > > FILE-CONTROL.
> > >     SELECT STATE-FILE ASSIGN TO "STATE.DAT"
> > >            ORGANIZATION IS INDEXED
> > >            ACCESS MODE IS DYNAMIC
> > >            RECORD KEY IS STATE-KEY
> > >            FILE STATUS IS STATESTATUS.

> > > DATA DIVISION.
> > > FILE SECTION.
> > > FD STATE-FILE.
> > > 01  STATE-RECORD.
> > >     02 STATE-KEY        PIC X(02).
> > >     02 STATE-INDEX      PIC 9(02).
> > >     02 STATE-NAME       PIC X(14).

> > > WORKING-STORAGE SECTION.
> > > 01  ENDOFFILE   PIC X(1).
> > > 01  STATESTATUS PIC X(2).

> > > PROCEDURE DIVISION.

> > > 001-START-HERE.
> > >     OPEN INPUT STATE-FILE.

> > >     MOVE "AL" TO STATE-KEY.
> > >     DISPLAY SPACE LINE 1 COLUMN 1 ERASE TO END OF SCREEN.
> > >     READ STATE-FILE
> > >         INVALID KEY DISPLAY "BAD KEY".

> > >     CLOSE STATE-FILE.
> > >     STOP RUN.



Fri, 27 Feb 2004 00:38:01 GMT  
 Run-time error with Compaq Cobol v 2.7

Quote:

>I have a small program that is trying to read an indexed input file
>but the program blows up on the read with the following error:

I would also be curious to note whether the file is actually an indexed file.
Are you able to browse the .DAT file with Notepad and the like?
If so, this is more likely a fixed format sequential file that shouldbe used to
first build the indexed file.   I am making an assumption that this might be in
the line of homework / class assignment rather than a work / job assignment.


Fri, 27 Feb 2004 01:31:44 GMT  
 Run-time error with Compaq Cobol v 2.7
No, this is not a homework assignment.  It's just that the original
program is about 8,000 lines of code and since I had narrowed it
down to the READ failing I just wrote a smaller program to test and
troubleshoot the READ.

The file does indeed show to be an indexed file:

Directory SYS$SYSDEVICE:[DATA.DLRREG.PROD]

STATE.DAT;1                   File ID:  (9522,10,0)
Size:           35/35         Owner:    [SSB,BRADY_RL]
Created:    9-SEP-2001 00:06:17.24
Revised:    9-SEP-2001 11:57:13.13 (4)
Expires:   <None specified>
Backup:    <No backup recorded>
Effective: <None specified>
Recording: <None specified>
File organization:  Indexed, Prolog: 3, Using 1 key
Shelved state:      Online
Caching attribute:  Writethrough
File attributes:    Allocation: 35, Extend: 0, Maximum bucket size:
2, Global buffer count: 0
                    No version limit
Record format:      Fixed length 18 byte records
Record attributes:  Carriage return carriage control
RMS attributes:     None
Journaling enabled: None
File protection:    System:RWED, Owner:RWED, Group:RWED, World:RWED
Access Cntrl List:  None
Client attributes:  None

Total of 1 file, 35/35 blocks.

Quote:

> I would also be curious to note whether the file is actually an indexed file.
> Are you able to browse the .DAT file with Notepad and the like?
> If so, this is more likely a fixed format sequential file that shouldbe used to
> first build the indexed file.   I am making an assumption that this might be in
> the line of homework / class assignment rather than a work / job assignment.



Fri, 27 Feb 2004 02:24:15 GMT  
 Run-time error with Compaq Cobol v 2.7

Quote:

>No, this is not a homework assignment.  It's just that the original
>program is about 8,000 lines of code and since I had narrowed it
>down to the READ failing I just wrote a smaller program to test and
>troubleshoot the READ.

>The file does indeed show to be an indexed file:

Well then, the file is indexed.  From other messages, I see  that you are
checking
the status codes.  Would you be able to report the status codes from each file
operation up to the point of the program failure?
Would it be possible that there is a file corruption problem?
Do other existing programs access this file without any problems?


Fri, 27 Feb 2004 07:29:28 GMT  
 Run-time error with Compaq Cobol v 2.7

Quote:
>Version: V 7.3
>Under Compaq Cobol v 2.7:

    First, make sure you have COBRTL V2.7 installed:

$ product show history cob*
----------------------------------- ----------- -----------
PRODUCT                             KIT TYPE          OPERATION
DATE AND TIME
----------------------------------- ----------- -----------
DEC AXPVMS COBOL   V2.7-1209          Full LP     Install
30-APR-2001 07:04:32
DEC AXPVMS COBRTL V2.7-603B         Full LP     Install     30-APR-2001
07:03:22
----------------------------------- ----------- -----------

    Next try compiling /CHECK and relink/rerun the program.  /CHECK
    includes some additional run-time verifications between the program
    description of the ISAM file keys and the actual file.

    Next try ANALYZE/RMS on the file.

    If you are still unable to resolve the problem, what the support
    center will need is a command procedure that can be used to generate

    the ISAM input file you are using.  I made the following change in
    your program to create the ISAM input file from the COBOL program,
    but I was unable to duplicate the problem you are seeing, so I
    suspect the problem may be related to specific data in your file.

    The support center will want to know if you have been able to
    read this file on older versions of OpenVMS, with older versions
    of COBOL, or with other programming languages on OpenVMS V7.3.

IDENTIFICATION DIVISION.
PROGRAM-ID.     STATE.

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
    SELECT STATE-FILE ASSIGN TO "STATE.DAT"
           ORGANIZATION IS INDEXED
           ACCESS MODE IS DYNAMIC
           RECORD KEY IS STATE-KEY
           FILE STATUS IS STATESTATUS.

DATA DIVISION.
FILE SECTION.
FD STATE-FILE.
01  STATE-RECORD.
    02 STATE-KEY        PIC X(02).
    02 STATE-INDEX      PIC 9(02).
    02 STATE-NAME       PIC X(14).

WORKING-STORAGE SECTION.
01  ENDOFFILE   PIC X(1).
01  STATESTATUS PIC X(2).

PROCEDURE DIVISION.

001-START-HERE.
    OPEN OUTPUT STATE-FILE.
    CLOSE STATE-FILE.
    OPEN INPUT STATE-FILE.

    MOVE "AL" TO STATE-KEY.
    DISPLAY SPACE LINE 1 COLUMN 1 ERASE TO END OF SCREEN.
    READ STATE-FILE
        INVALID KEY DISPLAY "BAD KEY".

    CLOSE STATE-FILE.
    STOP RUN.

- Don Braffitt
    Compaq COBOL and SORT project leader (VAX and Alpha)



Mon, 01 Mar 2004 01:58:30 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Gambit 2.7 on NT with Watcom C 11.0 and runtime dll

2. Micofocus COBOL (win) run time error 166

3. HELP-MF cobol run-time error 163

4. Solaris 2.7, Microfocus Cobol 4.1

5. Run Time Error handling In MF COBOL

6. DEC Ada run-time error messages (Was: More Ashamedness of Ada - this time OBJECT WORLD)

7. Run Time Error - Internal Error

8. run-time error R6000 - stack overflow error

9. cobol runtime error 46 for cobol 85

10. Manugistics run-time [was: STSC run-time]

11. relinking cobol run time system

12. Cobol run time library not installed

 

 
Powered by phpBB® Forum Software