Page 1 of 1

Accessing vsam file with multiple keys.

PostPosted: Sun Mar 29, 2009 9:40 pm
by gokulNmf
Hi,
I want to create a vsam with multiple keys is it possible while declaring keys during creation like,
keys (3,3,8,3,15,3)
where 3,8,15 are the starting positions of the keys?

Re: Accessing vsam file with multiple keys.

PostPosted: Sun Mar 29, 2009 11:18 pm
by dick scherrer
Hello and welcome to the forum,

is it possible while declaring keys during creation like,
keys (3,3,8,3,15,3) where 3,8,15 are the starting positions of the keys

No.

You need to define one unique primary key (if all 3 fields are needed to make up a unique value, re-arrange them in this vsam record). If one of the fields will be unique, it might become the primary key and the others defined as alternate indexes.

Here is the Table of Contents for the IDCAMS documentation link:
http://publibz.boulder.ibm.com/cgi-bin/ ... 0/CONTENTS?

Re: Accessing vsam file with multiple keys.

PostPosted: Sun Mar 29, 2009 11:58 pm
by gokulNmf
Thank you I will try out by rearranging them.

Re: Accessing vsam file with multiple keys.

PostPosted: Mon Mar 30, 2009 12:40 am
by dick scherrer
Hello,

FWIW - many (most) ksds vsam files are defined with the primary key as the first n bytes of the record.

I probably should have mentioned that earlier. . .