I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
well its got nothing to do with this code
ORGANIZATION IS LINE SEQUENTIAL
the only thing I can think of is there a read statement in my code maybe that has something to do with it
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
This error is a file handling error that would happen if you were trying to read a record that was shorter in the physical file than how it is defined in the program so the logical file in the program is probably difined differently than how it exists on disk.
Either that or you are trying to read from a file opened for output or extend, which isn't supported.
What statement is at these line numbers:
at Void REPORT._MF_PERFORM_4_1() in C:\\Users\\titor\\documents\\visual studio 201
0\\Projects\\Report\\Report\\Program1.cbl:line 89
at Int32 REPORT.REPORT() in C:\\Users\\titor\\documents\\visual studio 2010\\Projec
ts\\Report\\Report\\Program1.cbl:line 51
If this is a line sequential file and has CRLF at the end of each record then you need to define it as LINE SEQUENTIAL as a standard file defined as SEQUENTIAL does not use these delimiters.
How is this file created, through COBOL or through other means?
Look at the file in a text editor like notepad.
What is the length of each record?
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
here's one definition
01 FIELDS-TO-PRINT.
05 PROMPT-1 PIC X(4) VALUE "Lst:".
05 PRINT-LAST-NAME PIC X(20).
05 PROMPT-2 PIC X(4) VALUE "1st:".
05 PRINT-FIRST-NAME PIC X(20).
05 PROMPT-3 PIC X(3) VALUE "NO:".
05 PRINT-NUMBER PIC X(15).
05 PROMPT-4 PIC X(4) VALUE "Xtn:".
05 PRINT-EXTENSION PIC X(5).
01 END-OF-FILE PIC X.
01 PRINT-LINES PIC 99.
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
Heres the other definitions:
01 PHONE-RECORD.
05 PHONE-LAST-NAME PIC X(20).
05 PHONE-FIRST-NAME PIC X(20).
05 PHONE-NUMBER PIC X(15).
05 PHONE-EXTENSION PIC X(5).
FD PRINTER-FILE
LABEL RECORDS ARE OMMITTED.
01 PRINTER-RECORD PIC X(80).
sorry about that I messed up
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
Heres the other definitions:
01 PHONE-RECORD.
05 PHONE-LAST-NAME PIC X(20).
05 PHONE-FIRST-NAME PIC X(20).
05 PHONE-NUMBER PIC X(15).
05 PHONE-EXTENSION PIC X(5).
FD PRINTER-FILE
LABEL RECORDS ARE OMMITTED.
01 PRINTER-RECORD PIC X(80).
sorry about that I messed up
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
Heres the other definitions:
01 PHONE-RECORD.
05 PHONE-LAST-NAME PIC X(20).
05 PHONE-FIRST-NAME PIC X(20).
05 PHONE-NUMBER PIC X(15).
05 PHONE-EXTENSION PIC X(5).
FD PRINTER-FILE
LABEL RECORDS ARE OMMITTED.
01 PRINTER-RECORD PIC X(80).
sorry about that I messed up
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
how do you put a text file in a reply
oh I think I figured it out
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
So the error is on the read statement as shown here:
READ PHONE-FILE NEXT RECORD
AT END line 89
MOVE "Y" TO END-OF-FILE.
So either the record is defined as the incorrect size to what is actually on the disk or you are not opening the file in a mode that can support a read.
Your record for your phone file is defined as 60 characters according to the definitions.
My guess is that one of the following is happening:
1. you are creating the file in this program using open extend and then you are trying to read it back without first closing it and opening it for input.
2. you created the file as sequential type and are trying to read it back as line sequential.
Can you please attach the program so that I can review it?
Thanks.
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
Here ya go
I think the phone file is a sequential file
and I'm trying to read line sequential
how would I fix that
boy you know your cobol
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
That looks ok so it must be the actual file format.
Can you please attach phone.dat?
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
ok it gave me this error when I changed the printer file to sequential instead of line sequential
Unhandled Exception: COBOLFileHandlingException
'phone.dat' : 9/018 (ANS74)
18 Read part record error: EOF before EOR or file open in wrong mode
at Void REPORT._MF_PERFORM_4_1() in C:\\Users\\titor\\documents\\visual studio 201
0\\Projects\\Report\\Report\\Program1.cbl:line 89
at Int32 REPORT.REPORT() in C:\\Users\\titor\\documents\\visual studio 2010\\Projec
ts\\Report\\Report\\Program1.cbl:line 51
at Int32 REPORT._MF_ENTRY()
Press any key to continue . . .
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
ok it gave me this error when I changed the printer file to sequential instead of line sequential
Unhandled Exception: COBOLFileHandlingException
'phone.dat' : 9/018 (ANS74)
18 Read part record error: EOF before EOR or file open in wrong mode
at Void REPORT._MF_PERFORM_4_1() in C:\\Users\\titor\\documents\\visual studio 201
0\\Projects\\Report\\Report\\Program1.cbl:line 89
at Int32 REPORT.REPORT() in C:\\Users\\titor\\documents\\visual studio 2010\\Projec
ts\\Report\\Report\\Program1.cbl:line 51
at Int32 REPORT._MF_ENTRY()
Press any key to continue . . .
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
ok it gave me this error when I changed the printer file to sequential instead of line sequential
Unhandled Exception: COBOLFileHandlingException
'phone.dat' : 9/018 (ANS74)
18 Read part record error: EOF before EOR or file open in wrong mode
at Void REPORT._MF_PERFORM_4_1() in C:\\Users\\titor\\documents\\visual studio 201
0\\Projects\\Report\\Report\\Program1.cbl:line 89
at Int32 REPORT.REPORT() in C:\\Users\\titor\\documents\\visual studio 2010\\Projec
ts\\Report\\Report\\Program1.cbl:line 51
at Int32 REPORT._MF_ENTRY()
Press any key to continue . . .
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
I guess its saying its end of file before end of read maybe its my definitions I have maybe you can figure it out I can't seem to
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
You can't just change the file definition without knowing what type of file it is.
Where did phone.dat come from?
Can you please attach phone.dat so I can look at it?
Thanks.
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
I think I might know what the problem is I don't have enough test data in the phone file I just used a couple names and phone numbers I made up I'm suppose to have a lot more data not sure if that is the problem but maybe
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
Yes, that would be the problem and it exactly represents the condition reported by the error message.
You have to at least have a full record present as COBOL reads files a record at a time and not a field at a time.
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
well I thought it was the test data it's probably not that
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
well I thought it was the test data it's probably not that
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
well I thought it was the test data it's probably not that
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
I'm not sure if it saved lets see
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
I guess I will have to change the phone file to a txt
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
ok here it is I guess your saying I need more test data sorry I haven't sent this sooner I got kind of lost in the posts a little
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
ok here it is I guess your saying I need more test data sorry I haven't sent this sooner I got kind of lost in the posts a little
I tried using that app configuration file that chris glazer sent (i think that's his name) for another program and it gave me a wrong mode error what modes it suppose to be in
the only thing I can think that is different is this line in my code
organization is line sequential.
im not sure that's any mode or not
ok here it is I guess your saying I need more test data sorry I haven't sent this sooner I got kind of lost in the posts a little