Hi All,
If we want to increase the length of the VSAM, how can we do this?
I have done it using File-aid but interviewer wanted to ask some toerh way. How is it possibe to increase the length?
The question was about KSDS but can there be similar ways for other VSAM files?
Regards
Increase the length in VSAM.
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Increase the length in VSAM.
Unload the VSAM data set. Delete / define the VSAM data set with the new parameters. Reload the VSAM data set.
This is the usual and recommended way to make changes to record length -- for VSAM or any other data set.
This is the usual and recommended way to make changes to record length -- for VSAM or any other data set.
Re: Increase the length in VSAM.
Is there no tool which can right way update the VSAM itself, Robert?
What other data sets are you talking about?Robert Sample wrote:for VSAM or any other data set.
Re: Increase the length in VSAM.
ANY other dataset that one is trying to update - unless, of course, you do not mind being sacked if you corrupt the data irretrievably.What other data sets are you talking about?
Regards
Nic
Nic
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Increase the length in VSAM.
A data set can be VSAM (which in turn can be sequential, indexed, relative record, or linear), or sequential (PS), or partitioned (PO), or a LIBRARY (a newer partitioned), or direct access (DA). Depending on the age of the system you are using, indexed sequential (IS) could be possible (but not likely as it's been many years since IBM supported ISAM data sets).
And there might be tools on the market to redefine VSAM data sets on the fly -- but any such tool may potentially have to unload the data, delete and redefine the data set, then reload the data. It is possible, for variable length VSAM data sets, to use an ALTER to allow a longer length record but this will not work to make the record length shorter, nor does it do any good for fixed length record VSAM data sets. And the existing records will NOT have their record lengths increased -- only new records can have the longer lengths. And if you are wanting to change a KSDS index record length, ALTER cannot do that. The Access Method Services for Catalogs manual in the DFSMS bookshelf, which has all the IDCAMS commands, has a lot of restrictions on changing RECORDSIZE with ALTER:
The general method, which works for everything, is to unload / delete / define / reload the VSAM data set.
And there might be tools on the market to redefine VSAM data sets on the fly -- but any such tool may potentially have to unload the data, delete and redefine the data set, then reload the data. It is possible, for variable length VSAM data sets, to use an ALTER to allow a longer length record but this will not work to make the record length shorter, nor does it do any good for fixed length record VSAM data sets. And the existing records will NOT have their record lengths increased -- only new records can have the longer lengths. And if you are wanting to change a KSDS index record length, ALTER cannot do that. The Access Method Services for Catalogs manual in the DFSMS bookshelf, which has all the IDCAMS commands, has a lot of restrictions on changing RECORDSIZE with ALTER:
Note a key restriction -- if there is a single data record, you cannot use ALTER and must unload the VSAM data set.Restrictions: RECORDSIZE is used only if all the following are true:
The object whose entry is being altered is an alternate index, a cluster, a path, or a data component.
The object whose entry is being altered contains no data records.
The maximum RECORDSIZE in the object's catalog entry is the default. For defaults, see the DEFINE command for the object.
If NONUNIQUEKEY is used for an alternate index, the record length to be specified accounts for the increased record size; this results from the multiple prime key pointers in the alternate index data record.
Use a maximum record length of at least seven bytes less than the control interval size, unless the record is a spanned record.
Use a record length large enough to contain all prime and alternate keys previously defined.
If RECORDSIZE in the object's catalog entry is not the default, and ALTER RECORDSIZE specifies that same value, processing continues for any other parameters given in the command, and there is no error message.
The general method, which works for everything, is to unload / delete / define / reload the VSAM data set.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute