IAM (Innovation Access Method), is non-VSAM, but looks like VSAM to application programs. So why buy IAM, when VSAM comes with OS/390? The basic advantages of IAM are :-
VSAM needs multiple buffers to perform. IAM does this using a concept called IAM Real Time Tuning, which keeps the file index in virtual storage. This means that all of the index I/Os and index buffers used by VSAM are eliminated. IAM requires, at most, one I/O to retrieve any record identified by key within a data set. This reduces the need to perform physical I/O to look up and retrieve data. In a recent comparison between IAM and VSAM on real production data, batch run times were reduced by 40%. This is impressive given that the VSAM files were buffer tuned. A cautionary note. A batch job will typically only open one or two files at a time, so storage requirements are low. An on-line CICS system can have hundreds of files open at the same time, and this can required lots of virtual storage.
Buffering was enhanced in IAM 8.1 with the addition of Dynamic
Data Space. This uses an LRU algorithm to ensure that the correct
records are held in buffers, so enabling more current data to
be buffered and further reducing the requirement for real IO.
IAM can speed up error recovery. It can automatically journal file updates
for Enhanced Format IAM KSDS and ESDS files. This is especially
useful for batch failures, where recovery would mean restoring
to the last good backup, then re-running batch work to the point
of failure. This can take hours. The IAM journal allows you to
backout a failing job by rolling back the log updates to get back
to the start of the job. In comparison tests, recovery times reduced
from an average 2.5 hours to an average 30 minutes
IAM eliminates the 4GB limit for normal VSAM files. The actual file size available will depend on the DASD type, and DFSMS release, but its possible to get a 200GB IAM file with compression on IBM 3990 format DASD. Its been possible to extend all VSAM file types since OS/390 V2.10, but these all have to be SMS managed. IAM does not.
VSAM files tend to waste space, due to small block sizes, and the difficulty in releasing unused space. With IAM, you can choose use half track blocking. Also IAM's different file structure and use of compression means that data stored in an IAM file typically requires substantially less DASD space than when stored in a VSAM cluster. In recent tests with production data, IAM reduced space utilisation by 50%. IAM uses a propriety compression engine that gets the best trade-off between disk space reduction and CPU usage. IAM 8.1 included an enhancement to use z/Series hardware compression instead of IAM's native compression. This may be less space efficient, but it reduces CPU requirements. IAM does not work well with DFSMS compression, so the SMS dataclass should be defined with COMPACTION (NO).
Key sequence datasets are stored in key order by definition, and VSAM requires that free space be maintained to insert records. Once this free space is used up, it is necessary to split a block of records (called a control area), moving half to the end of the file. If IAM cannot add a new record to an existing block, it will add the record to an overflow area. The overflow area is indexed separately, and can reuse space freed up by deleted records. The overflow index is held in virtual storage for fast access. There are two types of IAM file, Enhanced Format and Compatible Format. With Compatible format the overflow area is defined up front and cannot be extended. With Enhanced format, extra disk extents will be dynamically added to the overflow area as required. The IAMINFO report will tell you how many overflow records are in use, and
how many are free
A consequence of the way IAM handles record inserts is that unlike VSAM, it does not suffer from CA splits and CI splits. In a VSAM KSDS allocation you specify FREESPACE parameters to leave room for record inserts. While IAM does not have control interval and control area concepts, it uses the FREESPACE(CI% CA%) as follows.
CI% is used to calculate the amount of space to keep free for the overflow area.
CA%: is used to decide how much DASD space to release at the end of a file load.
Prime Related Overflow was introduced with IAM 8.1. This matches
overflow blocks with primary data blocks and so reducing the requirement
for overflow indexing, which in turn improves performance.
Implementation Hints and Tips
IAM should be totally transparent to applications, and system commands. However
Innovation does recommend that you add an IAMINFO DD statement to
every batch job to aid in any required problem determination. IAM
supports KSDS and ESDS files. Older versions of IAM did not support
KSDS files with alternate indices, but this is supported with IAM
/AIX V7.0
IDCAMS commands are supported for IAM as they do for VSAM, so no maintenance JCL changes are needed. However, only DELETE, PRINT, REPRO and VERIFY work the same with both IAM and VSAM. LISTCAT ALL displays IAM files as non-VSAM in its standard SYSPRINT report. LISTCAT ALL also displays the file's IAM characteristics in an IAMPRINT DD report, which will be dynamically allocated if necessary.
IAM files are in proprietary format, therefore only systems which have IAM installed can successfully process the data in them. If you share data between several LPARS, then you need IAM licensed on all LPARs which will access the data. If you don't do this, then the data will appear to be corrupt from the unlicensed LPAR. This makes life 'interesting' when testing.
There are several was to create an IAM file
Use an IDCAMS DEFINE either with parameter OWNER(£IAM) specified or with £IAM somewhere in the data set name.
Use a standard DISP=NEW,CATLG JCL allocation with £IAM in the dataset name, or with an SMS Data Class or Storage Class that has £IAM in the name.
Allocate an IAM file using the IAM ISPF panels
The £IAM is UK standard, non-UK implementations need to use $IAM. While any of these methods will work, the £IAM in the file name makes it immediately obvious that a file is IAM, and so is a good standard.
Sample IDCAMS JCL to define an IAM ESDS with £IAM in the name
DEFINE CLUSTER -
(NAME(SAP1.PR01 CICS.A23RT) -
MODEL(SAP1.PR01CICS.A13T) -
OWNER(£IAM) ) -
DATA (NAME(SAP1.PR01CICS.A23RT.DATA) -
CYL(250,250) -
INDEX (NAME(SAP1.PR01CICS.A23RT.INDEX) -
CYL(25,25))
If you need alternate indexes then you define them and their paths using standard IDCAMS, or you could use the IAM ISPF panels.
The maximum size of an IAM file is about 3 TB if allocated in extended format on a 3390-54.
The maximum record size will depend on the key length and offset, but if the IA file is in Enhanced format and had the SPANNED attribute then the maximum record size is about 8 MB. Compatible mode files are restricted to 32,755 (variable length) or 32,760 (fixed length).
Reorganising IAM files
Although IAM files are physical sequential (DSORG=PS), indexed IAM files need to be reorganised the same as KSDS VSAM files. In the case of IAM, this is to reduce the amount of data that is stored in the overflow areas, as a large overflow area will require a large amount of virtual storage. Enhanced format files should be able to last longer than compatible format IAM files, as the overflow area can be extended. However, Innovation recommends that if you have 10% or more of your records in the overflow area, it should be reorganised. Like any other dataset, IAM files can fill up and cause applications to fail with an SB37 error.
IAM itself will issue an IAMW22 warning message if it thinks a reorganisation is needed. The reorg. process can be automated using FDRREORG, or you can use the normal IDCAMS REPRO process if you are not licensed for FDRREORG.
IAM RECORD LEVEL SHARING
Record Level Sharing (RLS) is explained in the VSAM RSL section.
IAM provides RLS functionality, and it also has a journalling facility
to log batch updates that are made to IAM files. This can be used
to back-out failed batch jobs, similar to VSAM TVS. The back-out
can be automated, so if a job abends, its updates are automatically
removed from the IAM file, either back to the beginning of the job,
or back to the last sync point. The journalling does not affect
CICS as CICS has its own journalling system.
VSAM RLS and TVS require that z/OS be part of a SYSPLEX, and store the sharing
and log records in the coupling facility. IAM does not do this;
it uses an IAM RLS address space and journalling datasets, although
sysplex sharing is planned for a future release. IAM implements
RLS by passing all I/O requests for the files it is sharing to an
IAM RLS address space. It then uses a lock manager to handle locking
requests. This implies that IAM can only provide RLS for applications
that run within the same z/OS LPAR.