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

INVALID key in VSAM


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chinnielr

New User


Joined: 11 Jul 2005
Posts: 87

PostPosted: Tue Jul 29, 2008 5:05 pm
Reply with quote

Hi,

I have the below piece of code in my program.

READ FILEA
INTO A-RECORD
INVALID KEY
MOVE 'TEST' TO WS-OUT


Here FILEA is KSDS file, ORGANIZATION IS INDEXED and ACCESS IS RANDOM.


When INVALID KEY will execute? what does INVALID KEY means here.

Thanks in advance.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jul 29, 2008 5:19 pm
Reply with quote

Have you tried the fine manual?

O.
Back to top
View user's profile Send private message
chinnielr

New User


Joined: 11 Jul 2005
Posts: 87

PostPosted: Wed Jul 30, 2008 12:03 pm
Reply with quote

ofer71,

I have looked into the manual using the link you provided but I could not be able to get anything fruitful.

Could you please let me know for what instances INVALID KEY phrase executes?

Thanks in davance.
Back to top
View user's profile Send private message
Santoshdorge

New User


Joined: 27 Jun 2006
Posts: 48
Location: Pune

PostPosted: Wed Jul 30, 2008 12:39 pm
Reply with quote

Hi chinnielr,

Invalid key clause will be executed when you are trying to read a record that is not present in fileA. i.e. file status 23.


thanks,
Santosh.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Jul 30, 2008 7:45 pm
Reply with quote

chinnielr wrote:
ofer71,

I have looked into the manual using the link you provided but I could not be able to get anything fruitful.

Could you please let me know for what instances INVALID KEY phrase executes?

Thanks in davance.
You looked in the fine manual and you did not see this?
"Execution of a format 2 READ statement causes the value of the key of reference to be compared with the value of the corresponding key data item in the file records, until the first record having an equal value is found. The file position indicator is positioned to this record, which is then made available. If no record can be so identified, an INVALID KEY condition exists, and READ statement execution is unsuccessful. (See "Invalid key condition" under "Common processing facilities" in topic 6.1.8.9.)"
I think you might be in the wrong profession.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts CVDA value for RRDS VSAM dataset. CICS 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Open VSAM File in IMS DC Region - DFS... IMS DB/DC 0
Search our Forums:

Back to Top