Increase the length in VSAM.

Virtual Storage Access method - ESDS, KSDS, RRDS & LDS. Basic direct access method, Basic sequential -, Queued sequential -, Basic partitioned -, Indexed sequential -, Object - access method.
Post Reply
hp123
New Member
Posts: 6
Joined: Mon Nov 09, 2015 10:51 am

Increase the length in VSAM.

Post by hp123 »

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
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1885
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Increase the length in VSAM.

Post by Robert Sample »

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.
hp123
New Member
Posts: 6
Joined: Mon Nov 09, 2015 10:51 am

Re: Increase the length in VSAM.

Post by hp123 »

Is there no tool which can right way update the VSAM itself, Robert?
Robert Sample wrote:for VSAM or any other data set.
What other data sets are you talking about?
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Increase the length in VSAM.

Post by nicc »

What other data sets are you talking about?
ANY other dataset that one is trying to update - unless, of course, you do not mind being sacked if you corrupt the data irretrievably.
Regards
Nic
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1885
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Increase the length in VSAM.

Post by Robert Sample »

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:
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.
Note a key restriction -- if there is a single data record, you cannot use ALTER and must unload the VSAM data set.

The general method, which works for everything, is to unload / delete / define / reload the VSAM data set.
Post Reply

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

Register

Sign in

Return to “SMS & VSAM and BDAM, BSAM, QSAM, BPAM, ISAM, OAM.”