IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

When does File read of VB VSAM file give RC of 04?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ravi_chella2000

New User


Joined: 18 Dec 2006
Posts: 8
Location: India

PostPosted: Thu Jul 12, 2007 1:38 pm
Reply with quote

When does File read of VB VSAM file give RC of 04? How can this be fixed?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jul 12, 2007 1:55 pm
Reply with quote

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
View user's profile Send private message
ravi_chella2000

New User


Joined: 18 Dec 2006
Posts: 8
Location: India

PostPosted: Thu Jul 12, 2007 3:10 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jul 12, 2007 3:14 pm
Reply with quote

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
View user's profile Send private message
ravi_chella2000

New User


Joined: 18 Dec 2006
Posts: 8
Location: India

PostPosted: Thu Jul 12, 2007 3:56 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jul 12, 2007 4:21 pm
Reply with quote

What does the rest of the FD look like?
Back to top
View user's profile Send private message
ravi_chella2000

New User


Joined: 18 Dec 2006
Posts: 8
Location: India

PostPosted: Thu Jul 12, 2007 4:25 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jul 12, 2007 4:50 pm
Reply with quote

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
View user's profile Send private message
ravi_chella2000

New User


Joined: 18 Dec 2006
Posts: 8
Location: India

PostPosted: Thu Jul 12, 2007 9:40 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jul 12, 2007 11:09 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top