View previous topic :: View next topic
|
Author |
Message |
Gopalakrishnan V
Active User
Joined: 28 Jun 2010 Posts: 102 Location: chennai
|
|
|
|
Hi,
I have created a VSAM file with alternate index file. It contains 5 records only and in that first record will be using in all the modules. That file is opening in read mode getting read across few batch cobol program (nearly 20). It using as reference file for each record of other files which is having 10-20 million records. After this changes the usual jobs taking more time to complete.
I have a doubt, if all the programs and each record of other file reading the same record at same time or via alternate index will it affect job performance?
Thanks in advance. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you have five records on a file, then read them into working-storage and give everything which wants to use it, access to it.
An "alternate-index" on a five-record file? Never heard of that.
Read the file once. Store the data. Store the data in the order of "hits".
Your programs will even then "fly" in comparison to what you have so far. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
This may be a question to be answered by your site support group, and may require some testing. In general, only one program can read a given record of a VSAM file at a time (whether accessed by primary key or alternate index key). However, there are a number of exceptions -- such as using LSR pools (in batch or online) -- so the performance impact would be difficult to predict.
For a 5-record file, I agree with Bill -- there is no reason to read this file more than once; change the programs to load the data into memory and access the data from memory. This would have a far greater impact on performance by reducing the access time from milliseconds to read the disk to nanoseconds to read the memory location. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
apart the bad design
Quote: |
I have a doubt, if all the programs and each record of other file reading the same record at same time or via alternate index will it affect job performance? |
seem to imply a concern for concurrent access from many jobs
unless ( from the topic title )
Quote: |
Will multiple opening of a VSAM file affect job performance? |
within the same program |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Enrico, I think you understated that -- it should be
Quote: |
apart the SPECTACULARLY BAD design |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Yes, I was going from the title. Re-reading, it looks like "jobs" plural.
Still the same, open, read, store, close. If needed it 20 separate programs (not part the same runtime) do it as a sub-program, which gets the storage area from the main program linked to it.
20m reads of a VSAM file which only has 5 records, will (probably) find data and index in storage all the time, but will still be wasteful as there is a certain amount of work for each to return the data, even from memory. |
|
Back to top |
|
|
Pete Wilson
Active Member
Joined: 31 Dec 2009 Posts: 582 Location: London
|
|
|
|
Utterly pointless having 5 records in a VSAM file!
Could be just an ordinary flat file read into memory once, with no VSAM overhead. |
|
Back to top |
|
|
|