View previous topic :: View next topic
|
Author |
Message |
paramita.barman
New User
Joined: 12 Oct 2006 Posts: 18
|
|
|
|
Hi,
I need to know the correct format for NOT INVALID key..... as the below code segment is giving an error for 'NOT'.
Also, if I don't give the 'NOT INVALID KEY' clause,will the control return to the statement after INVALID KEY clause(i.e , PERFORM 2210-CALC-PRE) or simply exit the 2200-CHECK para.
I need to perform 2210-CALC-PRE only if the key is found in VSAM file.
Please help.
2200-CHECK.
READ INPUT-VSAM-FILE
INVALID KEY PERFORM 9000-ERR-FILE-WRITE
THRU 9000-EXIT.
NOT INVALID KEY PERFORM 2210-CALC-PRE
THRU 2210-EXIT.
2200-EXIT.
EXIT.
Thanks in advance. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hello,
I think the period(.) after the 9000-EXIT terminates your READ statement. Use a single period only at the end of a paragraph. It's better to use explicit scope-terminators(END-READ, END-IF etc) rather than using periods within a para. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
good eyes arun. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
And I believe END-READ should also be included,
Code: |
MOVE value TO key1.
READ file-name RECORD [INTO ws-field]
INVALID KEY do something
NOT INVALID KEY do something else
END-READ. |
however it's not a solution for the problem you ask for; what Arun has suggested can be an answer though. But this is the way I recall using Random Read with KSDS cluster. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Thanks Dick. |
|
Back to top |
|
|
|