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 

VSAM FILE ACCESS USING ALTERNATE KEY

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


Joined: 05 Apr 2005
Posts: 131
Topics: 64
Location: chennai

PostPosted: Fri Feb 01, 2008 8:51 am    Post subject: VSAM FILE ACCESS USING ALTERNATE KEY Reply with quote

I have coded the below in a pgm
SELECT OCFILE ASSIGN TO OCDD
RECORD KEY IS <ALTERNATE KEY>This is not the primary key

...
Read ocfile , etc is done
as though am accessing the base cluster via primary key

In the JCL
//ocdd basecluster
//ocdd1 <path>

Nomarlly this is not the practice We want to access via alternate key then we code as below:

SELECT OCFILE ASSIGN TO OCDD
RECORD KEY IS <primary key>
Alternate key is <alternate key>
....
read ocfile key is <alternate key>

JCL
//ocdd basecluster
//ocdd1 <path>

If i code like the 2nd option it is taking up a lot of IO
If i code like the 1st option the performance is better & it takes less io

What is the reason.
Actually i want to know how the 1st option works

Thanks in advance
_________________
deepa
Back to top
View user's profile Send private message Send e-mail
jsharon1248
Intermediate


Joined: 08 Aug 2007
Posts: 291
Topics: 2
Location: Chicago

PostPosted: Fri Feb 01, 2008 9:44 am    Post subject: Reply with quote

Ok. You're still using the true VSAM key in the base cluster when you do your reads with scenario #1. You're only using a different data area in the COBOL program to store the key. Think of it this way, you could change the RECORD KEY data area name to CURIOUS-GEORGE, put it anywhere in the record, and when you populate that field with the value 'XYZ', COBOL will read the VSAM record with the key value = 'XYZ'. What you're doing in #1 is tricky business and I wouldn't recommend it.

Now for the performance issue. Even though you allocated the PATH in your JCL, you never really used it in #1. You didn't specify the ALTERNATE RECORD KEY in your ASSIGN, so you never even opened the AIX. Scenario #2 is using the AIX. You're just experiencing a peformance issue with the AIX. What I'd recommend is increasing the BUFNI. I don't remember the defaults for AIX, they're probably the same as the base cluster. Bump up the BUFNI to 5, 7, or 10, and see if there's any improvement from one to the next.
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