Page 1 of 1

A010 INVALID FILE REFERENCE issue (VSAM)

PostPosted: Thu Aug 23, 2012 7:33 pm
by SteveM001
HI,
We have a variable length VSAM file (12000 120004) that I have defined as follows:

 FILE ORDMSTR VS
  ORDMSTR-RECORD                                1 12000 A
    ORDMSTR-KEY                                 1     6 A
      ORDMSTR-ALPHA                             1     3 A
      ORDMSTR-REF-NUM-K                         4     3 P
    ORDMSTR-SEND-INFO                           7   315 A
      ORDMSTR-ORDER-YYMMDD                      7     4 P
      ORDMSTR-HHMMSS                           11     4 P

etc (more detail fields follow)

Read is coded:
READ ORDMSTR KEY ORDMSTR-KEY STATUS
IF ORDMSTR : FILE-STATUS EQ 0
   CONTINUE
ELSE
   DISPLAY '*** ERROR READING ORDER MASTER. '
           ' KEY: '  PARM-ALPHA PARM-REFNO
           ' FILE STATUS: ' ORDMSTR:FILE-STATUS
   GOTO JOB
END-IF


*****************************************************************************************
What am I missing? I thought this would work??

Thank you for your help,

Steve

Code'd and Aligned

Re: A010 INVALID FILE REFERENCE issue (VSAM)

PostPosted: Thu Aug 23, 2012 9:21 pm
by dick scherrer
Hello and welcome to the forum,

Which line raised the error?

In the JES sysouts is there any other info?

We have many Easytrieve processes that do this - almost exactly the same way. Ours are:
READ ORDMSTR KEY(ORDMSTR-KEY) STATUS

Is there a DD statement for this file?

Re: A010 INVALID FILE REFERENCE issue (VSAM)

PostPosted: Thu Aug 23, 2012 10:12 pm
by BillyBoyo
We need to know which line the message points to.

I'd code

IF ORDMSTR


rather than what you have, but that is not the problem.

At a blind guess, I'd say you have accidently defined PARM-ALPHA PARM-REFNO as part of the VSAM file, but I prefer not to guess blindly.

Hello Dick,

The brackets/parenthesis are optional there - I like to use them as well, but not the problem.

Re: A010 INVALID FILE REFERENCE issue (VSAM)

PostPosted: Fri Aug 24, 2012 7:11 am
by SteveM001
Gentlemen, thanks to your responses I fixed it. Problem had to do with the lookup key on the VSAM file being in the File Section. Once I used Working Storage to load a key and used the key for the reads it seemed golden. I had thought my syntax was hokey; but thanks to your affirmations, I was able to look elsewhere.

In answer to the question of what line was the error pointing to.. it was the loading of the keys just before the read. I was passing the parmfile values to the keyfield and then doing my read. As I said, once I built a working storage key structure and loaded to it, instead, the read (which now pointed to the WS-key) worked fine.

Thank you again for your help.

STeve

Re: A010 INVALID FILE REFERENCE issue (VSAM)

PostPosted: Fri Aug 24, 2012 8:16 am
by dick scherrer
You're welcome - thank you for the follow up :)

d