Tips+on+using+VSAM+datasets

Owner(s):

If you have any doubts about the structural integrity of the index and data components, you can use the command: EXAMINE IDCAMS. This will return with problems if there are any. The output will be one of the IDCxxxxx messages, where the x's will be replaced by the code of the error.
 * How do I check my VSAM data set?**

Look in MVS System Messages, Volume 3 (GDE - IEB) for the explanation for these messages.


 * What are some common VSAM problems?**

Below is a list of some of the most common VSAM problem. Each one will be accompanied by the questions, 'How did this happen?' and 'What do I do for recovery?'

How did this happen? -VSAM data set is being accessed by a subsystem as CICS -VSAM data set is being accessed by your program** What do I do for recovery? In the second case, try re-running the program, or restoring your backup and then re-run the job.**
 * Lack of virtual storage:**
 * Error Message format:** IDC3351I **VSAM{OPEN|CLOSE|I/O}**
 * can be 136, 132, or 40.
 * An abend occurs due to the lack of virtual storage; one of two things happened:
 * In the first case, CICS was performing the synchpoint and journaling, and will be able to recover the data by rolling it back.

Initial loading problems: Error Message format: **IDC3308I**Duplicate Record, or IDC3351I **VSAM {Open|Close|I/O}** How did this happen? option is on with a duplicate record, or you attempted to sot a record in skip- sequential mode out of ascending key sequence.** What do I do for recovery? the input file. The program needs to be sorted and re-run.**
 * can be 8, 12, or 116.
 * You attempted to store a record with a duplicate key, or you used the unique key
 * In the first case, there is no need for recovery because the data is saved in the

Structural Damage: Error Message format: **IDC3351I** VSAM {Open|Close|I/O} Because KSDS or VRRDS VSAM data sets are organized with an index, they can fail more easily and in more ways than other data sets. If any pointers become corrupt, the data can be lost or duplicated. It is crucial that the EXAMINE command is run on the data set as soon as possible because some damage can cause further breakage until the original diagnosis may be impossible to determine. Once this command is run, a possible solution could be to read the data in physical sequential mode through its data component. Refer to __3.4.4, Broken Index scenario__ for more details.
 * can be 8, 12, or 116.
 * How did this happen?**
 * What do I do for recovery?**


 * How do I backup my VSAM Data Sets?**

It is important to back up data by using methods such as using the SMS management class with ABARS for backups. This will allow a restore of your data in the cases of hardware errors and application errors. You can also make a remote copy for disaster recovery. The BWO -Backup While Open- allows a logical dump for an IMS or CICS/VSAM data set while it is open. When you define a cluster with IDCAMS, you must declare it with a BWO. The options for BWO are

For RLS processing, this will activate BWO for CICS. In non RLS processing, CICS will determine whether to use BWO of the specification in CICS control data named FCT.
 * TYPECICS**

Use this parameter to enable BWP processing in an IMS environment.
 * TYPEIMS**

This parameter is for situations when BWO does not apply to the cluster.
 * NO**


 * How do I keep my system maintained?**

Maintaining a VSAM data set involves a few categories. Some of the consequences of placing SYSVSAM in the exclusion list include: loss of records, overlaid records, duplicate records, invalid index structures, invalid catalog records, invalid data set dumps, backups, restores, or migrations, incorrect extends of the data set, and incorrect release of space in the data set."(ibm.com/redbooks)
 * Reorganization: VSAM uses a new DASD storage technology which implements: numerous high-capacity, small-size FBA, SCSI/SSA disks; redundancy in different types of RAID; large amounts of cache, mainly to avoid the write penalty caused by RAID; plenty of microcode in order to support RAID, cache algorithms, the mapping between the disks and the logical 3390/3380 volumes (as seen by z/OS), and in the RVA case, the virtualization of the 3390/3380.
 * VSAM data sharing: "To protect the integrity of your VSAM data sets, VSAM uses internal locks and issues ENQs in SYSVSAM major name, which invokes the MVS Enqueue Manager routine to serialize the resource locally. To serialize the full cluster across systems, it is required to have the Global Resource Serialization (GRS) or an equivalent product with the caution of //not placing// SYSVSAM resource name in RNL exclusion list.
 * Extended Addressability: the main idea in the extended addressability is to make applications transparent to the function.

To keep your system maintained, apply PTF selective services in your operating system, especially the ones associated with VSAM. Use the search word “dsbreaker” to find fixes associated with broken VSAM data sets.


 * Where can I find more information?**

If you need more information, visit the VSAM Knowledge Database. This interactive, question and answer diagnostic tool should be able to get you the answer you need. This database can be found at __http://knowledge.storage.ibm.com/__