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

'NOT INVALID KEY' for KSDS read


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

New User


Joined: 12 Oct 2006
Posts: 18

PostPosted: Mon Jan 19, 2009 12:00 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Jan 19, 2009 1:03 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jan 19, 2009 1:19 pm
Reply with quote

good eyes arun.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Jan 19, 2009 1:50 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Jan 19, 2009 1:54 pm
Reply with quote

Quote:
good eyes arun.
Thanks Dick. icon_smile.gif
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 Error to read log with rexx CLIST & REXX 11
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts ICETOOL to Read records SMF CEF it is... DFSORT/ICETOOL 4
Search our Forums:

Back to Top