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
 
Error with START command - Status code=23

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Mon Jul 21, 2008 10:17 am    Post subject: Error with START command - Status code=23
Reply with quote

I'm trying to read a VSAM file in my COBOL code using START command.
I am getting status code=23 when I try to read one record. I can confirm that the record I try to read is present in the VSAM file.

The below is my VSAM read,
Code:

START  <VSAM_FILE_NAME>
   KEY IS GREATER THAN  <KEY_REC>

The interesting part here is - to overcome this issue, we insert a dummy record with key value as 99999999999999 (key length is 14) at the end of the VSAM file and we process the VSAM successfully.

Could you please throw us some light why we are getting this error and how this workaround works. Is the issue related to by record or anything to do with setup.
Back to top
View user's profile Send private message

Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Mon Jul 21, 2008 2:45 pm    Post subject:
Reply with quote

You can't read a file with the START command, you should use READ instead...
But you can use START to position yourself before reading.
If the key is present, use KEY GREATER OR EQUAL otherwise you will just miss the record you want.
Back to top
View user's profile Send private message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Mon Jul 21, 2008 5:01 pm    Post subject:
Reply with quote

Hi Marso,

Exactly said.. I am issuing a START command prior to my read command.

I used START command with KEY GREATER THAN... And i am getting return code 23.


Appreciate your assistance.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8154
Location: East Dubuque, Illinois, USA

PostPosted: Mon Jul 21, 2008 5:12 pm    Post subject:
Reply with quote

From the manual, a 23 file status means
Quote:
An attempt was made to randomly access
a record that does not exist in the
file, or a START or random READ
statement was attempted on an optional
input file that was not present.
If the key you're doing the START on has a larger value than any key in the VSAM file, you will get a 23 file status code. Adding a higher-valued key (such as HIGH-VALUES or all 9's) puts a record in the file with a key value higher than what you do the START on, and VSAM will return this record.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Mon Jul 21, 2008 6:32 pm    Post subject: Reply to: Error with START command - Status code=23
Reply with quote

If the file is not optional and is present, then it is:
Quote:
An attempt was made to randomly access a record that does not exist in the file

Do you check the status also after the OPEN statement ?
Have you DISPLAYed the key before the START command, just to make sure you have a correct value ?
Try to do a START with KEY GREATER THAN LOW-VALUES and check if you can read the file at all.
Back to top
View user's profile Send private message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Wed Jul 30, 2008 11:11 am    Post subject:
Reply with quote

Apologizes for the delayed response...

Robert,

Rightly said.. I checked my file again. Though the key which I was looking for was there in the VSAM file, I could not find any key which is greater than that..

Thank you very much for your info...
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8154
Location: East Dubuque, Illinois, USA

PostPosted: Wed Jul 30, 2008 4:37 pm    Post subject:
Reply with quote

Neo: You could use GE (GREATER THAN OR EQUAL TO) rather than GT is your KEY clause; this would allow the READ to return a record with exact key match. As you've got the code, it'll only return a record with a higher key value.
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 FUSE - IBM MQ - CICS integration error Kevin Vaz CICS 1 Mon Sep 18, 2017 4:31 pm
No new posts Reply MQ open error Vignesh Sid COBOL Programming 5 Thu Sep 07, 2017 6:02 pm
No new posts Error in SQL-PLIST3 'Above value tru... rikdeb DB2 4 Wed Sep 06, 2017 1:34 pm
No new posts Creating ISPF Screens with Scrname vi... Albireo20 TSO/ISPF 9 Tue Sep 05, 2017 4:24 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm

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