MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Random Access on VSAM failing even with Key existing.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Data Management
View previous topic :: View next topic  
Author Message
shreekanth.M
Beginner


Joined: 11 Mar 2007
Posts: 6
Topics: 2
Location: Hyd

PostPosted: Fri Apr 13, 2007 6:35 am    Post subject: Random Access on VSAM failing even with Key existing. Reply with quote

Hi

I have a very strange situation where in my CICS program is not able to do random read successfully on the VSAM File inspite of Key matching perfectly. Its giving Return code 23.

I have checked with Displays and CEDF and didnt found any issue with the Key passed to read file.

Later expecting issue with DATA in File, I tried to add a new record manually and browse this new record thru screen and to my surprise this worked.
Its also working if i replicate the existing key and just edit the key once again with same values. Moreover the file is showing two records with Same key after editing the replicated record.

EG:
If key is 101ABC, I Replicate this Key and edit with same value as 101ABC. By doing this way, i am able to see two records with Same key and now my program is also able to brose this second key from screen

I am not able to understand the issue with this VSAM file. It is defined as all other files are defined in System.

Please let me know if any one had some similar situation and how can we resolve this

Abend message is " RECORD NOT FOUND".
But the key i am searching is existing in file. As i said if i replicate this key record and edit the key fields with same values then a new record with same key is formed.

Thus in VSAM File you can see two records with Same key.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Apr 13, 2007 8:06 am    Post subject: Reply with quote

shreekanth.M,


1. How is the key defined in the vsam cluster? is it a character or numeric ?
2. Is the vsam cluster a fixed or variable cluster?
3. Is the vsam cluster defined in such a way that it supports random reads (ex: for an ESDS random access is not allowed)
4. Post your read stataments along with the fields in question

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shreekanth.M
Beginner


Joined: 11 Mar 2007
Posts: 6
Topics: 2
Location: Hyd

PostPosted: Wed Apr 18, 2007 5:35 am    Post subject: Reply with quote

Hi

Following are the ans for your questions.

1: Key is numeric with 2 comp-3 variables. The file key was changed recently in new development. The 2 comp varibables were moved from data fields to key fields. The file was ofcourse redefined as per new key and data length.
*******************

2: File is a Fixed length file.
ATTRIBUTES
KEYLEN----------------80 AVGLRECL-------------350
RKP--------------------0 MAXLRECL-------------350
SHROPTNS(2,3) SPEED UNIQUE NOERASE
UNORDERED REUSE NONSPANNED
*******************

3:
DEFINE CLUSTER -
( NAME(PXXXXXX.MXY.MXYXY.KE) -
FREESPACE(0 0) -
INDEXED -
KEYS(80,0) -
REUSE -
CYL(5,5) -
RECORDSIZE(350 350) -
SHAREOPTIONS(2,3) -
SPEED -
VOLUME(* * * * * *) ) -
DATA -
( NAME(PXXXXXX.MXY.MXYXY.KE.D) -
CONTROLINTERVALSIZE(4096) ) -
INDEX -
( NAME(PXXXXXX.MXY.MXYXY.KE.I) )

**********************

4:
EXEC CICS READ
DATASET (FILE NAME)
INTO (FILE-RECORD1)
RIDFLD (FILE-RECORD-KEY)
LENGTH (FILE-LENGTH)
END-EXEC.
_________________
Kanth
Back to top
View user's profile Send private message
Sreejith
Intermediate


Joined: 02 Dec 2002
Posts: 155
Topics: 25
Location: N.Ireland

PostPosted: Wed Apr 18, 2007 7:28 am    Post subject: Reply with quote

You mentioned the key is comp-3. It looks like some of them got a -Ve value.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
shreekanth.M
Beginner


Joined: 11 Mar 2007
Posts: 6
Topics: 2
Location: Hyd

PostPosted: Wed Apr 18, 2007 10:54 am    Post subject: Reply with quote

You are probably correct. When i see only the part of comp-3 fields in hex value its shown as

For

26576 and 0
-------------------------
?
00256 00
0067F 0F

But when i see the key i request to read the file its having
For

26576 and 0
----------------------
%
00256 00
0067C 0C

There is a 'C' char in key put as input where as there is 'F' value in the key stored in file.

Thank you for helping to find out the Root cause.

I would also like to know what can be the process of rebuilding the records with 'C' value. There are many records in input file.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Data Management All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group