View previous topic :: View next topic
|
Author |
Message |
chinnielr
New User
Joined: 11 Jul 2005 Posts: 87
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
Back to top |
|
|
chinnielr
New User
Joined: 11 Jul 2005 Posts: 87
|
|
|
|
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 |
|
|
Santoshdorge
New User
Joined: 27 Jun 2006 Posts: 48 Location: Pune
|
|
|
|
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
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 |
|
|
|