create a vsam file in which keys is in multiple position



Help for IBM's record-oriented filesystem VSAM, ESDS, KSDS, RRDS, LDS and Storage management Subsystems

create a vsam file in which keys is in multiple position

Postby arya_starc » Sat Dec 24, 2016 2:51 pm

Hi guys,
I need to create a vsam file in which I need a key at multiple position. but It is returning max cc 12 with below code


IF MAXCC < 12 THEN SET MAXCC=0                                      
DEFINE CLUSTER                                                 -    
      ( NAME(JVPS.AY.file.fORCE.KE)         -            
      FREESPACE(20 10)                                         -    
      INDEXED DATACLASS(DC4GCOMP) STORAGECLASS(SCNORMAL)       -    
      KEYS(2,10,19,17)                                         -    
      REUSE                                                    -    
      RECORDSIZE(016104,016104)                                    -
      SHAREOPTIONS(2,3)                                        -    
      SPEED                                                    -    
      VOLUME(* * * * *))                                       -    
  DATA                                                         -    
 


I need a key at 11th and 17th position
arya_starc
 
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Re: create a vsam file in which keys is in multiple position

Postby enrico-sorichetti » Sat Dec 24, 2016 3:06 pm

I need a key at 11th and 17th position

You do not always get what You want.

why not read the manuals Yourself to find out about the VSAM RULES :mrgreen:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: create a vsam file in which keys is in multiple position

Postby Robert Sample » Sat Dec 24, 2016 7:39 pm

You may "need" it, but since it is not possible to do this (IBM tells you a KSDS key must be contiguous), you have two choices:
1. reorganize the data in the records so the key parts are contiguous
2. give up on the idea of defining this VSAM data set and move on to a different project.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: create a vsam file in which keys is in multiple position

Postby mbenaud » Fri Dec 30, 2016 5:04 pm

You could use an alternate index. Define the key for the main VSAM dataset and then create an alternate index using "DEFINE AIX, PATH and PATHENTRY"
User avatar
mbenaud
 
Posts: 1
Joined: Thu Nov 25, 2010 8:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: create a vsam file in which keys is in multiple position

Postby Robert Sample » Fri Dec 30, 2016 6:22 pm

mbenaud, there was not enough information posted for your "solution" to be valid. A KSDS primary key must be unique; if some of the bytes starting at 17 are required to make the key unique (that is, if there is some duplication of the bytes starting at 10), then the record has to be rearranged to ensure the primary key is contiguous bytes since KSDS primary keys cannot be in more than one location in the record.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to VSAM/SMS

 


  • Related topics
    Replies
    Views
    Last post