View previous topic :: View next topic |
Author |
Message |
SK Beginner
Joined: 04 Feb 2004 Posts: 26 Topics: 3
|
Posted: Wed Feb 04, 2004 3:27 pm Post subject: FILE I/O ERROR |
|
|
Hi,
I am using the following code to declare the record in the file section and getting the error as follows:
SELECT ABC-IN ASSIGN ABCINPUT.
FD ABC-IN
RECORDING MODE IS F
BLOCK CONTAINS 0 RECORDS.
01 ABC-IN-REC PIC X(631).
IGYGR1211-S A "RECORDING MODE" OF "F" WAS SPECIFIED FOR FILE "ABC-IN", BUT THE CALCULATED RECORD SIZE WAS VARIABLE. THE FILE DEFINITION WAS DISCARDED.
ABCINPUT is a FB file having the same block size i.e. 631.
Could anyone help in this.
Thanks. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Feb 04, 2004 4:06 pm Post subject: |
|
|
Sk,
check for the definitions after the ABC-IN-REC. you might have something which has a DEPENDING ON phrase.
Post the data definiton after this line
Code: |
01 ABC-IN-REC PIC X(631).
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
SK Beginner
Joined: 04 Feb 2004 Posts: 26 Topics: 3
|
Posted: Wed Feb 04, 2004 4:48 pm Post subject: |
|
|
Hi,
Thanks for your reply.
I had a code in LINKAGE SECTION which had a DEPENDING ON clause. Now I have commented it, but still getting the same error.
Could there be any other reason for this.
Thanks. |
|
Back to top |
|
|
slade Intermediate
Joined: 07 Feb 2003 Posts: 266 Topics: 1 Location: Edison, NJ USA
|
Posted: Wed Feb 04, 2004 7:48 pm Post subject: |
|
|
Hi SK,
It might help to show the whole File Control Section. Use cut & paste so we know we are looking at the same code as the compiler.
Thanx, Jack. |
|
Back to top |
|
|
warp5 Intermediate
Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Thu Feb 05, 2004 3:38 am Post subject: |
|
|
It sounds like you have more than one 01 level for the FD with different sizes. |
|
Back to top |
|
|
SK Beginner
Joined: 04 Feb 2004 Posts: 26 Topics: 3
|
Posted: Thu Feb 05, 2004 9:12 am Post subject: |
|
|
Hi,
Here is the FILE CONTROL section.
FILE-CONTROL.
*-------------
SELECT ABC-IN ASSIGN ABCINPUT.
SELECT ABC-OUT ASSIGN ABCOUTPUT.
DATA DIVISION.
==============
FILE SECTION.
*-------------
FD ABC-IN
RECORDING MODE IS F
BLOCK CONTAINS 0 RECORDS.
01 ABC-IN-REC PIC X(631).
FD ABC-OUT
RECORDING MODE IS F
BLOCK CONTAINS 0 RECORDS.
01 ABC-OUT-REC PIC X(631). |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Feb 05, 2004 9:29 am Post subject: |
|
|
Sk,
I don't see any problem in the code where the compiler would assume that the ABC-IN is a variable block file. Do you have any COPY statements in between the file declarations? However I noticed that you assign clause has a dd name(ABCOUTPUT) which exceeds 8 characters. ofcourse the compiler is smart enough to truncate that to 8 characters.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
SK Beginner
Joined: 04 Feb 2004 Posts: 26 Topics: 3
|
Posted: Thu Feb 05, 2004 9:50 am Post subject: |
|
|
Hi Kolusu,
Thanks a lot for your quick help and information. I could remove the error by changing the position of the COPY statement in my code.
Thanks. |
|
Back to top |
|
|
SK Beginner
Joined: 04 Feb 2004 Posts: 26 Topics: 3
|
Posted: Thu Feb 05, 2004 10:05 am Post subject: |
|
|
Hi,
I am getting an unpredictable error in my program. Sometimes it runs properly and gives no error and sometimes fails giving the following error.
IGZ0020S A logic error occurred. Neither FILE STATUS nor a declarative was specified for file AIN-FILE in program ABC at relative location X'0B00'. The status code was 46.
From compile unit ABC at entry point ABC at compile unit offset +00000B00 at entry offset +00000B00 at address 230016A8.
I have the same file section as follows, out of these two decleration for one works fine and same decleration does not work for the second one.:
SELECT AFILE ASSIGN AIN-FILE.
SELECT BFILE ASSIGN BIN-FILE.
FD AFILE
LABEL RECORDS STANDARD
BLOCK CONTAINS 0 RECORDS
RECORDING MODE IS F.
01 AFILE-REC PIC X(631).
**
FD BFILE
LABEL RECORDS STANDARD
BLOCK CONTAINS 0 RECORDS
RECORDING MODE IS F.
01 BFILE-REC PIC X(631).
Both AIN-FILE and BIN-FILE have same attributes.
Could you please let me know what exactly to look for, to rectify this error. Since it works fine at times, I am not sure what gets wrong sometimes.
Thanks. |
|
Back to top |
|
|
SK Beginner
Joined: 04 Feb 2004 Posts: 26 Topics: 3
|
Posted: Thu Feb 05, 2004 10:19 am Post subject: |
|
|
Hi,
code for reading the file is like this:
PROCEDURE DIVISION.
PERFORM 1000-PROCESS UNTIL END-OF-A
AND END-OF-B
0500-A-READ.
READ AFILE INTO A-FILE-REC-WS
AT END
SET END-OF-A TO TRUE
END-READ.
Thanks. |
|
Back to top |
|
|
Mike Chantrey Intermediate
Joined: 10 Sep 2003 Posts: 234 Topics: 1 Location: Wansford
|
Posted: Thu Feb 05, 2004 11:10 am Post subject: |
|
|
Status code 46 covers several 'read errors' but in this case probably means 'read past end of file'. If you don't hit end of file at the same time (during the same invocation of 1000-process) on both files, then your perform will invoke 1000-process again and attempt to read the file that has already had an 'at end' condition again, which is not allowed and will cause this error.
I can't tell for certain since you didn't post the code for 1000-process, but I think this is highly likely, since this is a very common type of error. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Feb 05, 2004 11:11 am Post subject: |
|
|
Sk,
The file-status of 46 means that you read the file after the previous read reached an EOF condition.
This is the part which is causing the error
Code: |
PERFORM 1000-PROCESS UNTIL END-OF-A AND END-OF-B
|
What happens when you reach end on file-a but there are some more records in file-b?
You need check for the eof file condition before you attempt to read the file in 1000-process
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Mike Chantrey Intermediate
Joined: 10 Sep 2003 Posts: 234 Topics: 1 Location: Wansford
|
Posted: Thu Feb 05, 2004 11:12 am Post subject: |
|
|
Just sneaked in before you there Kolusu |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Feb 05, 2004 11:20 am Post subject: |
|
|
Mike,
yep I was reading and typing up the answer and when I hit submit , I see that you beat me in posting. Well an expert always sneaks in first. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
SK Beginner
Joined: 04 Feb 2004 Posts: 26 Topics: 3
|
Posted: Thu Feb 05, 2004 4:57 pm Post subject: |
|
|
Hi,
I am checking the EOF condition in the 1000-PROCESS before actually processing anything using EVALUATE. Now it gets cimpiled properly but fails in producing results. It is not iterating through all the records till the end of file. It just goes for first record and comes out .
Code is like this:
EVALUATE END-OF-A ALSO END-OF-B
WHEN FALSE ALSO FALSE
END-EVALUATE.
In the above block I have this following code:
EVALUATE TRUE
WHEN N-AID = O-AID
PERFORM 1200-UPDATE
PERFORM 0500-NEW-READ
PERFORM 0800-OLD-READ
WHEN N-AID > O-AID
PERFORM 1500-XYZ
PERFORM 0500-NEW-READ
WHEN N-AID < O-AID
PERFORM 1600-PQR
PERFORM 0800-OLD-READ
END-EVALUATE.
Could you please let me know what is going wrong here.
Thx. |
|
Back to top |
|
|
|
|