Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
'NOT INVALID KEY' for KSDS read

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: 'NOT INVALID KEY' for KSDS read
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: 2285
Location: @my desk

PostPosted: Mon Jan 19, 2009 1:03 pm    Post subject:
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: 6968
Location: porcelain throne

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

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

Senior Member


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

PostPosted: Mon Jan 19, 2009 1:50 pm    Post subject:
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: 2285
Location: @my desk

PostPosted: Mon Jan 19, 2009 1:54 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Read of TDQ fails in LENGERR Tracy Hansen CICS 10 Wed Apr 05, 2017 12:10 am
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us