View previous topic :: View next topic
|
Author |
Message |
ravi_chella2000
New User
Joined: 18 Dec 2006 Posts: 8 Location: India
|
|
|
|
When does File read of VB VSAM file give RC of 04? How can this be fixed? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Who issued the RC04?
What was the error message text?
If you mead File Status 04:
"A READ statement was successfully executed, but the length of the record being processed did not conform to the fixed file attributes for that file." |
|
Back to top |
|
|
ravi_chella2000
New User
Joined: 18 Dec 2006 Posts: 8 Location: India
|
|
|
|
The VSAM file read statement returned a status code of 04. I looked this up and this seems to be the error message.
There're a number of other records in my file with the same length as the record causing this error. But they're not erroring out.
Any idea how to find the cause of this error? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Since you say the file is VB and the error seems to pretain to FB, I don't know.....
What does the FD and its associated 01 look like? |
|
Back to top |
|
|
ravi_chella2000
New User
Joined: 18 Dec 2006 Posts: 8 Location: India
|
|
|
|
In the program, we've two record layouts defined in the FD section. Both of length 6330 and with two variable length tables with occurs of 60 & 20.
The 01 item looks like,
05 Key X(40)
...
05 Tbl1 X(66) occurs 60 times
05 Tbl2 X(80) occurs 20 times |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
What does the rest of the FD look like? |
|
Back to top |
|
|
ravi_chella2000
New User
Joined: 18 Dec 2006 Posts: 8 Location: India
|
|
|
|
It looks like,
FD FILE1
LABEL RECORDS ARE STANDARD.
01 REC1
05 Key X(40)
...
05 Tbl1 X(66) occurs 60 times
05 Tbl2 X(80) occurs 20 times
01 REC2
COPY COPYBOOK2
and the COPYBOOK2 has the same structure as REC1. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
If both 01s are the same length and you did not specify a recording mode, COBOL is assuming that the file is fixed which justifies the FS04.
If the file is really VB, specify such in the FD or add another 01 of a different length. |
|
Back to top |
|
|
ravi_chella2000
New User
Joined: 18 Dec 2006 Posts: 8 Location: India
|
|
|
|
I declared variables in the FD section with the Minimum and the maximum length of the record, but i still got the same problem... :-(
Any other suggestions? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
What is the minimum and what is tha maximum length?
I usually just pur an 01 with a different length, usually the length of the primary information. |
|
Back to top |
|
|
|