View previous topic :: View next topic
|
Author |
Message |
murali922
New User
Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
I have a file with the following layout :-
NAME
CITY
COUNTRY
The primary key is NAME, and there is no alternate key.
Now if I want to get all the records with CITY = CHENNAI or BANGALORE
and country = INDIA .
It is simple if we are allowed to sequetially able to read the records, but how will we be able to do it if we are not allowed to read sequentially.
Is SEARCH or SEARCH ALL of any help ?
Please advice. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Muralli,
I think u can get all the record with CITY = CHENNAI or BANGALORE
and country = INDIA using dfsort . |
|
Back to top |
|
|
murali922
New User
Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
I want to do this in the COBOL program ! |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi !
I designate that your InputFile is a VSAM KSDS File.
And also there is only PrimKey=Name and no AlternateIndex.
I never heared of special alloance of reading a VSAM KSDS File.
You can read it in direct or sequentiel way. But if you have any internaly restrictions in your company not using the seq.-reading, best is to create alternate Index.
Or, as guptae said, use the SORT utility first in one Step to sortout the
desired records, and then in a following step, execute your programm.
Regards, UmeySan |
|
Back to top |
|
|
|