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-20-04 08:55 PM


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-20-04 08:55 PM


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-20-04 08:55 PM


Re: Non-Cobol person getting error code
..    On  20.11.04
wrote  monica@datashark.net (Monica J. Braverman)
on  /COMP/LANG/COBOL
in  d70cd025.0411200728.6fa7614e@posting.google.com
about  Non-Cobol person getting error code


MJB> I was sent an exe of a cobol program to unpack a datafile.  First of
MJB> all, do I need any cobol compiler, run-time, etc to run this type of
MJB> exe?

When you got an EXE, you certainly do not need a compiler. Maybe
you need some supporting DLLs or other form of runtime. But since the
program was sent to you this way, I guess the sender did include
everything you need; and this opinion is confirmed by the fact that
you got a sensible message from the program about a COBOL file status.

MJB> Second, I get an error message of "FILE STATUS 39 on
MJB> <UNOPENED-FILE>.  Error detected at offset 004F in segment 00 of
MJB> program DBEPRT1.

The COBOL filestatus consists of two characters which are normally
numbers, the first indicating a major file status, and the second, the
minor status, with additional information.

Major file status = 3 means that there is an unrecoverable error,
or "Permanent Error" as the COBOL standard says. Minor Status = 9 then
means that there is an "file attribute conflict between specification
in program and the actual file". The message seems to indicate that a
file was actually not yet opened.

Did you get instructions on how to specify the files to be use?
Maybe the program does not find the file name where it looks for it.

Or the file you try to process is of a different format then the
program is expecting.

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

As said before, File Status '39' appears to be a standard COBOL
file status, not an issue of running in DOS mode. BUT, of cource,
since several COBOL-Compiler did and do exist for DOS and Windows O/
Ses, it may be that the program does require some resources not
available unter Windows XP, but I don't think that this is the problem
in your case.


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

Man kann wirklich nicht wissen ob man nicht jetzt im Tollhaus sitzt. -G.C.Li
chtenberg

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


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.

A 39 is an unfound file, so I suspect the program is running correctly,
it just cannot find the file you are trying to unpack.

Donald


Report this thread to moderator Post Follow-up to this message
Old Post
Donald Tees
11-21-04 01: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.
Sorry aboput that last message ... error 29 is not found.

Donald


Report this thread to moderator Post Follow-up to this message
Old Post
Donald Tees
11-21-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-21-04 01: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-21-04 08:55 AM


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-21-04 01:55 PM


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

>.     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.
>
>
Yes it is OO "coded" but the design idea is not confined to OO. What's
to stop you CALLing a separate general purpose program FILERRORS passing
the file name and the file-status code.  The FileErrors class/program
can then do an informative error display. I don't , but could
accommodate Richard and his oft quoted phrase "Only check for the first
status character". :-)

Looking at your code below, I asked myself the question - has he got
this code repeated in *every* program. Looks like the answer is 'Yes'
because you have locked yourself in to the DECLARATIVES SECTION
approach.  I can't give you numbers but there are a fair number here who
reject the Declaratives approach. This is my approach against a generic
ISAM template, and there are others, (in procedural/traditional format) :-

*>--------------------------------------------------------------
Method-id. "readNext".
*>--------------------------------------------------------------
Linkage section.
01 lnk-ReturnValues.
copy "\copylib\sqlResult.cpy" replacing ==(tag)== by ==05 lnk==.

*> above started out as FileResult.cpy, then when I switched to DBMS I
merely added  Level *>88's which covered SQL results, like 'No more
Rows'. 99% usage is SQL, but if I do want to *>do a quickie with COBOL
files -  then the one copyfile applies to both.

05 lnk-record.
10 occurs 1 to MaxRecordSize
depending on ws-RecordSize     pic x.

Procedure Division returning lnk-ReturnValues.

initialize lnk-ReturnValues
Read Data-File next record
At End
Set fileFinis to True
Not at End
Move  Data-record (1:ws-RecordSize)
to    lnk-record  (1:ws-RecordSize)
End-Read

if   ws-fileStatus = "00" or "10"
continue

else set FileError to true
invoke super "showFileError" using ws-ErrorParams
End-if

End Method "readNext".
*>--------------------------------------------------------------

There's no ambiguity -  in fact I "double-check", (a) using At End/Not
at End and then follow with (b) checking the *specific* status-codes
that apply to an ISAM READ NEXT. If it's OO then I invoke the FileErrors
class; parallel situation for Procedural, CALLing the FileErrors program.
 
so that they might easily be displayed in various languages. 

I would suggest it's more than, "it might be nice", but highly desirable, as
 per following from my FileErrors class :-

*>--------------------------------------------------------------
Method-id. "showFileError".
*>--------------------------------------------------------------
Linkage section.
copy "\copylib\Linkerr.cpy" replacing ==(tag)== by ==Lnk==.
01 lnk-response                 pic x(4) comp-5.

Procedure Division using lnk-ErrorParams
returning lnk-response.

initialize                 ws-MessageParams
move lnk-FileName       to ws-Filename
move lnk-filestatus     to ws-filestatus
set TypeCritical        to true
set OK                  to true
move "File Error"       to MessageLabel
initialize MessageText

Evaluate true
when ws-fileStatus = "RS"
invoke self "recordSizeError"
when other
invoke self "errorCode1"

Evaluate ws-FileStatus1
when "9"   invoke self "extendedCodes"
when other invoke self "ansiCodes"
End-evaluate

invoke self "getErrorString"

End-evaluate

invoke ErrorMessage "showMessage"
using lnk-Parent, ws-MessageParams
returning lnk-response

End Method "showFileError".
*>--------------------------------------------------------------
Method-id. "ansiCodes".
*>--------------------------------------------------------------
Local-Storage section.
01 n                                 pic x(4) comp-5.

Procedure Division.
initialize ErrorType2
perform with test after
varying n from 1 by 1 until n = 25 or ErrorType2 not = spaces

if ws-FileStatus-ansi85 = ErrorText2-Number (n)
move ErrorText2-Number  (n) to ErrorNumber
move ErrorText2-Descrip (n) to ErrorType2
End-if
End-perform
End Method "ansiCodes".
*>---------------------------------------------------------------

If you look at the method above "ansiCodes" - you will recall that I did say
 it made sense to do a SEARCH, rather than a PERFORM.

Now my SQL Tables are separate classes, but they parallel the above, either 
you get an OK condition, "No more rows" or other = Error. Again CALL/INVOKE 
a separate SQLERRORS Class/Program.


As I recall, the originator of this thread was a young lady asking for
help. Her message said she was getting a status "39" - none of us
thought to comment, "What a lousy program you have been provided. It
didn't even bother to tell you what File-Status "39" meant !

Jimmy

>   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 WRIT
E'
>120            WHEN '4'
>130              DISPLAY 'but length of record read does not correspond to 
fixed file attributes of ' FILE-NAME-EXPLAINED
>140            WHEN '5'
>150              DISPLAY 'but optional file is not (yet) present at OPEN ti
me'
>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 ti
me'
>300            WHEN '6'
>310              DISPLAY 'after AT END was already reached by a previous RE
AD'
>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 
file'
>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 physica
l 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 completio
n'
>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 limit
s 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 faile
d'
>680            WHEN '9'
>690              DISPLAY 'file attribute conflict between specification in 
program 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 mod
e'
>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 compl
etion'
>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
James J. Gavan
11-22-04 01:55 AM


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 04:04 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.