Page 1 of 2

B054 NOT A VALID FILE

PostPosted: Fri Jun 10, 2011 11:38 pm
by needhelp
I have a large VSAM file, I need to update a small portion. The file containing the updates is in a single record and the VSAM file has the data in 2 records. I am doing a match initially and then reading the next VSAM record. On both the writes and the read of the vsam file I am getting this error. Is this too complex for easytrieve and should I use COBOL instead.
Here is the vsam file in the JCL and the relevant portions of the easytrieve:

//MIMAST DD DSN=userid.MIMAST,DISP=SHR,
// BUFNO=30

FILE MIMAST VS UPDATE

JOB INPUT (MIMAST KEY(MIM-BK, MIM-REC, MIM-REGION, MIM-CUST, +
MIM-CUSTBIN, MIM-INDR) +
INFILE KEY(IN-BANK, IN-REC, IN-REGION, +
IN-CUST, IN-CUSTBIN, IN-INDR)) +
FINISH DISPLAY-TOTAL

IF MATCHED
WRITE MIMAST UPDATE STATUS
*******B054 NOT A VALID FILE - MIMAST
READ MIMAST KEY WS-KEY STATUS
*******B054 NOT A VALID FILE - MIMAST
WRITE MIMAST UPDATE STATUS
*******B054 NOT A VALID FILE - MIMAST

Re: B054 NOT A VALID FILE

PostPosted: Fri Jun 10, 2011 11:50 pm
by Robert Sample
The first observation is that if you want to update a file, you need DISP=OLD. DISP=SHR allows for read but not write access, in general.

Re: B054 NOT A VALID FILE

PostPosted: Fri Jun 10, 2011 11:54 pm
by needhelp
I've tried disp=old and disp=mod and I still get the same error.

Re: B054 NOT A VALID FILE

PostPosted: Fri Jun 10, 2011 11:57 pm
by BillyBoyo
The B054 is a compile-time message. Have you looked it up in the manual?

You are doing "matched file processing". I strongly suspect you will be prevented from doing the READ because if you did, you'd put the matching all-to-pot.

Unconnected, but why bother with STATUS if you can't be bothered to check it? As in any language, use the status of file IO and check it, every time.

Re: B054 NOT A VALID FILE

PostPosted: Sat Jun 11, 2011 12:00 am
by BillyBoyo
:) Manual not much help with the message.

What are you trying to do? You haven't, in the code you've shown, changed anything on the file.

Re: B054 NOT A VALID FILE

PostPosted: Sat Jun 11, 2011 12:04 am
by needhelp
For simplicity sake, I did not include the entire program. All that takes place between the IF MATCHED and WRITE is moving the INFILE fields to the MIMAST fields.

Re: B054 NOT A VALID FILE

PostPosted: Sat Jun 11, 2011 12:05 am
by dick scherrer
Hello,

Have you compared the Easytrieve file definition in the code to the DEFINE that created the vsam file?

Is there some other Easytrieve code that successfully reads this file? Writes to it?

Re: B054 NOT A VALID FILE

PostPosted: Sat Jun 11, 2011 12:11 am
by needhelp
There are many different record types and formats within this vsam file, I am only trying to update just one of them. The MIM-REC field is the part of the key that points the the specific record type. My format is much smaller than many of the others. I can't find any other easytrieve code in house that does an update to this file, there are many that just read it.

Re: B054 NOT A VALID FILE

PostPosted: Sat Jun 11, 2011 12:16 am
by dick scherrer
Hello,

It sounds like your Easytrieve definition may not be complete/compatible with the actual file.

Most places i've been have an Easytrieve file definition for their vsam files. Is there some reason you cannot use the complete defiition rather than some subset?

Re: B054 NOT A VALID FILE

PostPosted: Sat Jun 11, 2011 12:23 am
by needhelp
I will give that a try, thank you.