Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Non-Cobol person getting error code
I was sent an exe of a cobol program to unpack a datafile.  First of
all, do I need any cobol compiler, run-time, etc to run this type of
exe?  Second, I get an error message of "FILE STATUS 39 on
<UNOPENED-FILE>.  Error detected at offset 004F in segment 00 of
program DBEPRT1.

I am running this at the command prompt of a PC running Windows XP
professional.  Is this type of error message specific to the program
or is there an issue with XP running in DOS mode?

Thanks.

Report this thread to moderator Post Follow-up to this message
Old Post
Monica J. Braverman
11-23-04 08:55 AM


Re: Non-Cobol person getting error code
On Sat, 20 Nov 2004 15:28:19 UTC, monica@datashark.net (Monica J.
Braverman) wrote:

> I was sent an exe of a cobol program to unpack a datafile.  First of
> all, do I need any cobol compiler, run-time, etc to run this type of
> exe?  Second, I get an error message of "FILE STATUS 39 on
> <UNOPENED-FILE>.  Error detected at offset 004F in segment 00 of
> program DBEPRT1.
>
> I am running this at the command prompt of a PC running Windows XP
> professional.  Is this type of error message specific to the program
> or is there an issue with XP running in DOS mode?
>
> Thanks.

That error code usually indicates a mismatch between the file
definition used by the program and the actual file definition stored
in the data file. It is normally caused by different record lengths or
by different index definitions in an ISAM type data file.

Contact the person who the supplied the program.

--
Lorne Sunley

Report this thread to moderator Post Follow-up to this message
Old Post
Lorne Sunley
11-23-04 08:55 AM


Re: Non-Cobol person getting error code
Monica J. Braverman wrote:
> I was sent an exe of a cobol program to unpack a datafile.  First of
> all, do I need any cobol compiler, run-time, etc to run this type of
> exe?  Second, I get an error message of "FILE STATUS 39 on
> <UNOPENED-FILE>.  Error detected at offset 004F in segment 00 of
> program DBEPRT1.
>
> I am running this at the command prompt of a PC running Windows XP
> professional.  Is this type of error message specific to the program
> or is there an issue with XP running in DOS mode?
>
> Thanks.

You don't need a compiler. You MAY need a run-time module, depending on the
particular COBOL compiler used. Inasmuch as the program actually started
execution, the latter is unlikely.

The de-code of "FILE STATUS 39" is "Conflict between fixed and defined file
attributes" is that, in attempting to open the file, the program decided the
internal attributes of the file do not match what was expected.

Note this is "internal attributes," not data. Several file types in COBOL
contain file-processing information in addition to data, for example record
lengths, links to other records, block sizes, etc.

It's like opening your door to a blind date. You are expecting certain
characteristics (6'2", 190#, blond, chisled-features, dimpled chin, perfect
teeth, smelling faintly of soap) and are greeted by an armadillo.

Bottom line, the file you're attempting to process doesn't match the
program's expectations. This is NOT, most likely, the result of incompatible
operating systems, or anything to do with COBOL per se.




Report this thread to moderator Post Follow-up to this message
Old Post
JerryMouse
11-23-04 08:55 AM


Re: Non-Cobol person getting error code
Lueko Willms wrote:

>   I could imagine that 39 occurs e.g. when a file is specified as
>ORGANISATION INDEXED, and the COBOL file system expects a separate
>index file, but doesnt find one.
>
>
I now use SQL with DB Tables, but a practical example, and not very
often. I have my ISAM and other files as separate file classes - they
can be specified with (a) vannila FD entry 'Record size from 'a' to 'b'
depending upon 'c'", or (b) you use a copyfile in the Business Program
(Problem Domain) and the file class.

So, for say about a year, you use the new program with a record size of
100 chars total., putting a lot of data into it. Then you do some system
re-design *forgetting* what previously was the case, add a field, and
you set the copyfie record size to 105.

Now access the file and you get the '39'.  I don't even memorize the
file-status codes, I  just let the FileError class display the message :-

*>------- error tables
01 E1A.
05 pic x(19) value "Successful BUT :".  *> 0
05 pic x(19) value "At end of file :".  *> 1
05 pic x(19) value "Invalid key    :".  *> 2
05 pic x(19) value "Permanent Error:".  *> 3
05 etc...
01 E1B redefines E1A.
05 ErrorText1  occurs 7 times         pic x(19).

01 E2A.
05 pic x(34) value "00No further information          ".
05 etc...
05 pic x(34) value "30I-O error/Data check parity err.".
05 pic x(34) value "34Boundary violation              ".
05 pic x(34) value "35Open IO/INPUT/EXTEND non-optionl".
05 pic x(34) value "37Open with incorrect Open mode   ".
05 pic x(34) value "38Open on file previously LOCKED  ".
05 pic x(34) value "39Conflict between file & program ".
05 etc...
01 E2B redefines E2A.
05 E2 occurs 25 times.
10 ErrorText2-Number              pic 9(02).
10 ErrorText2-Descrip             pic x(32).

Plus separate tables to handle '9' as the first character, using the M/F
extensions to get a message for the second character :-

01 E9A.
05 pic x(35) value "000No further information          ".
05 pic x(35) value "001Lack of buffer space/memory     ".
05 pic x(35) value "002File not opened when accessed   ".
05 pic x(35) value "003Serial mode error               ".
05 pic x(35) value "004Illegal file name               ".
05 etc...
01 E9B redefines E9A.
05 E9 occurs 94 times.
10 ErrTable9-Number            pic 9(03).
10 ErrTable9-Descrip           pic x(32).

Yes above could use SEARCH instead of PERFORM varying...., but I no
longer use it, so why bother to fine-tune.

Jimmy

Report this thread to moderator Post Follow-up to this message
Old Post
James J. Gavan
11-24-04 01:55 AM


Re: Non-Cobol person getting error code
..    On  20.11.04
wrote  donald_tees@sympatico.ca (Donald Tees)
on  /COMP/LANG/COBOL
in  JwNnd.57948$Ho4.1950981@news20.bellglobal.com
about  Re: Non-Cobol person getting error code


DT> Sorry aboput that last message ... error 29 is not found.

Major status 2 indicates an "invalid key" condition which is
considered to be a recovarable error


File not found should be indicated by 35:
3 = Permanent Error,
5 = file not present on OPEN INPUT
(in COBOL-2002 also for OPEN I-O and OPEN EXTEND

for minor status 9 to occur, if the compiler is correctly
implemented, the file would have to be present, but a conflict between
the file description in the program and the actual file detected.

I could imagine that 39 occurs e.g. when a file is specified as
ORGANISATION INDEXED, and the COBOL file system expects a separate
index file, but doesnt find one.



Lüko Willms                                     http://www.willms-edv.de
/--------- L.WILLMS@jpberlin.de -- Alle Rechte vorbehalten --

A. Der Mann hat viele Kinder. B. Ja, aber ich glaube, von den meisten hat er
 bloß die Korrektur besorgt.  -G.C.Lichtenberg

Report this thread to moderator Post Follow-up to this message
Old Post
Lueko Willms
11-24-04 01:55 AM


Re: Non-Cobol person getting error code
On computers that I have worked on, this error has nothing to do with CoBOL,
 but
is given by the OS - except that you may have to look at the CoBOL source co
de
to determine why it is expecting a file that has different attributes than w
hat
it sees.

Report this thread to moderator Post Follow-up to this message
Old Post
Howard Brazee
11-24-04 08:55 PM


Re: Non-Cobol person getting error code
l.willms@jpberlin.de (Lueko Willms) wrote

>      And, of course, it might be nice to have those texts in an array
> so that they might easily be displayed in various languages.

I have the file status texts in my 'decode file', a collection of
small data items indexed by a 'field name' and value.  This file is
mainly used for validation items, for example it may have records:

SEX     M     Male
SEX     F     Female
SEX     O     Other

or whatever the client decides is appropriate for that field.

For File status, I have, for example:

FILESTAT 00     Successful operation
FILESTAT 02     Allowable Duplicate key
..
FILESTAT 22     Record with that key already exists.
FILESTAT 23     Record is missing from the file
FILESTAT ....
FILESTAT 9001   Insufficient buffer space
..

These may be changed by the client or redone in a different language
without changing the program.  As this file is always open by a
control module that is loaded first in any system there shouldn't be a
problem accessing the codes, except perhaps if there has been a disk
fail.

Report this thread to moderator Post Follow-up to this message
Old Post
Richard
11-26-04 01:55 PM


Re: Non-Cobol person getting error code
..     Am  21.11.04
schrieb  jjgavan@shaw.ca (James J. Gavan)
bei  /COMP/LANG/COBOL
in  nqUnd.291854$%k.25173@pd7tw2no
ueber  Re: Non-Cobol person getting error code

JJG> I don't even memorize the file-status codes, I  just let the
JJG> FileError class display the message :-

Well that sounds object-oriented. I neither do have a COBOL
compiler which is able to do that nor have I learned to use it.

I have written a COPY-Element for the file status:
whis has to be used with
COPY REPLACING == FILESTAT == by == Your-sensible-name ==

With a TYPEDEF available, I would use it once as such. Anyway, it
has to be referenced with qualification, like in
IF has-reached-at-end OF Your-sensible-name


010 01  FILESTAT .
020*> FILESTAT sollte beim COPY durch passenden Namen REPLACEd werden
030     88 File-Status-OK                VALUE '00'.
040     02 Major             PIC X.
050        88 is-Successful-completed           VALUE '0'.
060        88 has-reached-at-end                VALUE '1'.
070        88 has-invalid-key                   VALUE '2'.
080        88 has-permanent-error               VALUE '3'.
090        88 has-logical-error                 VALUE '4'.
100        88 has-record-lock-problem           VALUE '5'.
*> ab Standard 2002 und X/Open
110        88 has-file-lock-problem             VALUE '6'.
*> ab Standard 2002 und X/Open
120        88 has-implementor-defined-condition VALUE '9'.
130     02 Minor             PIC X.
140        88 has-no-further-information        VALUE '0'.
150        88 it-just-didnt-work                VALUE '1'.
160        88 has-duplicate-key-error           VALUE '2'.
170        88 has-record-not-available          VALUE '3'.
180        88 has-boundary-violation            VALUE '4'.
190        88 is-not-present-file-or-recdesc    VALUE '5'.
200        88 has-sequence-error                VALUE '6'.
210        88 has-some-incompatability          VALUE '7', '8', '9'.
220


and a COPY element to be PERFORMed by a ON FILE-ERROR in
DECLARATIVES, but whic has the values according to X/Open
resp. COBOL-2002 only worked in for the major file status:


010*  This procedure requires the presence of
010*          two items in the DATA DIVISION
011*          which should look like this:
012* 01  FILE-STATUS-EXPLAINED.
013*     02 Major             PIC X.
014*     02 Minor             PIC X.
015*
016* 77  FILE-NAME-EXPLAINED  PIC X(12).
017*
018*  one has to MOVE the actual file status and the file name to these
019*  fields, or rename the names in this COPY element.
020*
021 EXPLAIN-FILE-STATUS SECTION.
022 ANFANG.
030     DISPLAY 'Status ' FILE-STATUS-EXPLAINED ' on ' FILE-NAME-EXPLAINED '
: ' WITH NO ADVANCING
040     EVALUATE Major OF FILE-STATUS-EXPLAINED
050       WHEN '0'
060          DISPLAY 'successful completion'
070          EVALUATE Minor OF FILE-STATUS-EXPLAINED
080            WHEN '0'
090              DISPLAY 'No further information'
100            WHEN '2'
110              DISPLAY 'duplicate key detected on READ or created on WRITE
'
120            WHEN '4'
130              DISPLAY 'but length of record read does not correspond to f
ixed file attributes of ' FILE-NAME-EXPLAINED
140            WHEN '5'
150              DISPLAY 'but optional file is not (yet) present at OPEN tim
e'
160            WHEN '7'
170              DISPLAY 'but referenced file is on a non-reel/unit medium'
180            WHEN OTHER
190              DISPLAY 'Unknown minor status'
200          END-EVALUATE
210       WHEN '1'
220          DISPLAY 'AT END condition with unsuccessful completion'
230          EVALUATE Minor OF FILE-STATUS-EXPLAINED
240            WHEN '0'
250              DISPLAY 'No further information'
260            WHEN '4'
270              DISPLAY 'seq READ on relative file, but more digits in rec 
number than described in file attributes'
280            WHEN '5'
290              DISPLAY 'but optional file is not (yet) present at READ tim
e'
300            WHEN '6'
310              DISPLAY 'after AT END was already reached by a previous REA
D'
320            WHEN OTHER
330              DISPLAY 'Unknown minor status'
340          END-EVALUATE
350       WHEN '2'
360          DISPLAY 'Invalid Key condition with unsuccessful completion'
370          EVALUATE Minor OF FILE-STATUS-EXPLAINED
380            WHEN '0'
390              DISPLAY 'No further information'
400            WHEN '1'
410              DISPLAY 'sequence error for sequentially accessed indexed f
ile'
420            WHEN '2'
430              DISPLAY 'WRITE would create a DUPLICATE KEY'
440            WHEN '3'
450              DISPLAY 'tried to randomly access a non-existent record'
460            WHEN '4'
470              DISPLAY 'boundary violation: tried to WRITE beyond physical
 limits or with larger rec no than possible'
480            WHEN '5'
490              DISPLAY 'optional file not present at START or READ'
500            WHEN OTHER
510              DISPLAY 'Unknown minor status'
520          END-EVALUATE
530       WHEN '3'
540          DISPLAY 'Permanent Error condition with unsuccessful completion
'
550          EVALUATE Minor OF FILE-STATUS-EXPLAINED
560            WHEN '0'
570              DISPLAY 'No further information'
580            WHEN '4'
590              DISPLAY 'boundary violation. Attempt to write beyond limits
 of file (disc full?)'
600            WHEN '5'
610              DISPLAY 'file not present on OPEN INPUT'
620            WHEN '6'
630              DISPLAY 'mismatch of files on one reel'
640            WHEN '7'
650              DISPLAY 'OPEN I/O on a file which is not on mass storage'
660            WHEN '8'
670              DISPLAY 'file was previously CLOSEd with LOCK - OPEN failed
'
680            WHEN '9'
690              DISPLAY 'file attribute conflict between specification in p
rogram and actual file'
700            WHEN OTHER
710              DISPLAY 'Unknown minor status'
720          END-EVALUATE
730       WHEN '4'
740          DISPLAY 'Logic Error condition with unsuccessful completion'
750          EVALUATE Minor OF FILE-STATUS-EXPLAINED
760            WHEN '0'
770              DISPLAY 'No further information'
780            WHEN '1'
790              DISPLAY 'can''t OPEN a file which is already OPEN'
800            WHEN '2'
810              DISPLAY 'can''t CLOSE a file which is not OPEN'
820            WHEN '3'
830              DISPLAY 'a REWRITE or DELETE IN seq mode was tried without 
prior successful READ'
840            WHEN '4'
850              DISPLAY 'boundary violation: record-size mismatch on WRITE 
or REWRITE, or beyond page limits'
860            WHEN '6'
870              DISPLAY 'no next record after unsuccessful START or READ w/
o AT END'
880            WHEN '7'
890              DISPLAY 'READ on a file not OPENed in READ or I/O mode'
900            WHEN '8'
910              DISPLAY 'WRITE on a file not OPENed in WRITE or EXTEND mode
'
920            WHEN '9'
930              DISPLAY 'REWRITE on a file not OPENed in I/O mode'
940            WHEN OTHER
950              DISPLAY 'Unknown minor status'
960          END-EVALUATE
961       WHEN '5'
962          DISPLAY 'Record Lock problem'
963       WHEN '6'
964          DISPLAY 'File Lock problem'
970       WHEN '9'
980          DISPLAY 'Implementor-defined condition with unsuccessful comple
tion'
990       WHEN OTHER
001          DISPLAY 'Unknown File Status '
010     END-EVALUATE
020     .

And, of course, it might be nice to have those texts in an array
so that they might easily be displayed in various languages.

Anybody may feel free to use these two copy elements.




Yours,
Lüko Willms                                     http://www.mlwerke.de
/--------- L.WILLMS@jpberlin.de -- Alle Rechte vorbehalten --

"Ohne Pressefreiheit, Vereins- und Versammlungsrecht ist keine
Arbeiterbewegung möglich"        - Friedrich Engels      (Februar 1865)

Report this thread to moderator Post Follow-up to this message
Old Post
Lueko Willms
11-27-04 01:55 AM


Re: Non-Cobol person getting error code
..    On  20.11.04
wrote  donald_tees@sympatico.ca (Donald Tees)
on  /COMP/LANG/COBOL
in  JwNnd.57948$Ho4.1950981@news20.bellglobal.com
about  Re: Non-Cobol person getting error code


DT> Sorry aboput that last message ... error 29 is not found.

Major status 2 indicates an "invalid key" condition which is
considered to be a recovarable error


File not found should be indicated by 35:
3 = Permanent Error,
5 = file not present on OPEN INPUT
(in COBOL-2002 also for OPEN I-O and OPEN EXTEND

for minor status 9 to occur, if the compiler is correctly
implemented, the file would have to be present, but a conflict between
the file description in the program and the actual file detected.

I could imagine that 39 occurs e.g. when a file is specified as
ORGANISATION INDEXED, and the COBOL file system expects a separate
index file, but doesnt find one.



Lüko Willms                                     http://www.willms-edv.de
/--------- L.WILLMS@jpberlin.de -- Alle Rechte vorbehalten --

A. Der Mann hat viele Kinder. B. Ja, aber ich glaube, von den meisten hat er
 bloß die Korrektur besorgt.  -G.C.Lichtenberg

Report this thread to moderator Post Follow-up to this message
Old Post
Lueko Willms
11-29-04 08:55 PM


Re: Non-Cobol person getting error code
Lueko Willms wrote:

>   I could imagine that 39 occurs e.g. when a file is specified as
>ORGANISATION INDEXED, and the COBOL file system expects a separate
>index file, but doesnt find one.
>
>
I now use SQL with DB Tables, but a practical example, and not very
often. I have my ISAM and other files as separate file classes - they
can be specified with (a) vannila FD entry 'Record size from 'a' to 'b'
depending upon 'c'", or (b) you use a copyfile in the Business Program
(Problem Domain) and the file class.

So, for say about a year, you use the new program with a record size of
100 chars total., putting a lot of data into it. Then you do some system
re-design *forgetting* what previously was the case, add a field, and
you set the copyfie record size to 105.

Now access the file and you get the '39'.  I don't even memorize the
file-status codes, I  just let the FileError class display the message :-

*>------- error tables
01 E1A.
05 pic x(19) value "Successful BUT :".  *> 0
05 pic x(19) value "At end of file :".  *> 1
05 pic x(19) value "Invalid key    :".  *> 2
05 pic x(19) value "Permanent Error:".  *> 3
05 etc...
01 E1B redefines E1A.
05 ErrorText1  occurs 7 times         pic x(19).

01 E2A.
05 pic x(34) value "00No further information          ".
05 etc...
05 pic x(34) value "30I-O error/Data check parity err.".
05 pic x(34) value "34Boundary violation              ".
05 pic x(34) value "35Open IO/INPUT/EXTEND non-optionl".
05 pic x(34) value "37Open with incorrect Open mode   ".
05 pic x(34) value "38Open on file previously LOCKED  ".
05 pic x(34) value "39Conflict between file & program ".
05 etc...
01 E2B redefines E2A.
05 E2 occurs 25 times.
10 ErrorText2-Number              pic 9(02).
10 ErrorText2-Descrip             pic x(32).

Plus separate tables to handle '9' as the first character, using the M/F
extensions to get a message for the second character :-

01 E9A.
05 pic x(35) value "000No further information          ".
05 pic x(35) value "001Lack of buffer space/memory     ".
05 pic x(35) value "002File not opened when accessed   ".
05 pic x(35) value "003Serial mode error               ".
05 pic x(35) value "004Illegal file name               ".
05 etc...
01 E9B redefines E9A.
05 E9 occurs 94 times.
10 ErrTable9-Number            pic 9(03).
10 ErrTable9-Descrip           pic x(32).

Yes above could use SEARCH instead of PERFORM varying...., but I no
longer use it, so why bother to fine-tune.

Jimmy

Report this thread to moderator Post Follow-up to this message
Old Post
James J. Gavan
11-29-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:26 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.