What Is an Alternate Index?
An alternate index is another file related to the cluster, but sorted using an alternate key that can have duplicates.
How Do You Create an Alternate Index?
You use the IDCAMS utility with the DEFINE AIX option after you build the cluster and then do another IDCAMS with the BLDINDEX option to populate the alternate index.
What Parameter In The Define Aix Option Is Used To Determine The Maximum Number Of Duplicate Keys Allowable?
The RECORDSIZE parameter. There are 2 numbers that follow this: the 1st is the average and the 2nd is the maximum. The values are equal to 5 + (cluster key length) + N*(alternate key length), where N is the allowable number of duplicates.
Name A Few Common Vsam Status Codes?
00-OK
02-READ a duplicate alternate key
10-end of file reached while doing a READ
22-trying to WRITE a duplicate primary key
23-record not found while doing a READ
97-file integrity verified, do an IDCAMS VERIFY
What Is Buffering and How Does It Apply To Vsam Files?
When large blocks of data are used, more main storage is required than when smaller blocks are used, but large blocks save CPU time and disk space. Additionally, extra buffers may save elapsed time since the program does not have to wait for an I/O to complete for it to continue processing.
In the JCL, you specify BUFNI (number of index buffers) and BUFND (number of data buffers) as sub parameters of the AMP parameter.
For random access, the BUFNI is one more than the number of index levels and a BUFND of 2 is fine.
For sequential access, a BUFNI of 1 and a minimum of 5 for BUFND is fine.
For dynamic access, the values of each is the higher of the numbers for either random or sequential.
What Are the Different Types Of Vsam Files Available?
ESDS: Entry Sequence Data Set
KSDS: Key Sequence Data Set
RRDS: Relative Data Set
What Is Idcams?
IDCAMS is the Access Method Services program. You run the IDCAMS program and supply AMS commands thru SYSIN. (examples of AMS commands are DELETE, DEFINE, REPRO etc..)
What Is Control Interval, Control Area?
Control Interval is analogous to a physical block for QSAM files. It is the unit of i/o. Must be between 512 bytes to 32 k. Usually either 2K or 4K. A larger control interval increases performance for sequential processing while the reverse is true for random access. Under CICS when a record is locked, the entire CI gets locked.
Control area is a group of control intervals. CA is used during allocation. CA size is calculated based on the allocation type (cyl, tracks or records) and can be max of 1 cylinder
What Is Freespace?
Coded in the DEFINE as FREESPACE (ci ca) where ci is the percentage of each control interval to be left free for insertions, ca is the percentage of control intervals in each control area to be left empty.
How Do You Decide On Optimum Values For Ci, Freespace Etc..?
CI size should be based on record length, type of processing. Usually CI is 4K. If record length is larger(>1K), choose 6K or 8K.
FREE SPACE should be large if more number of insertions are envisaged. Usual values are (20 20) when heavy updates are expected. CI size can be calculated.
Would You Specify Freespace For An Esds?
No. Because you cannot insert records in an ESDS, also when you rewrite a record, it must be of the same length. Thus putting any value for freespace does not make any sense.
What Is Shareopts?
SHAREOPTS is a parameter in the DEFINE and specifies how an object can be shared among users. It is coded as SHAREOPTS(a b), where a is the cross region share option ie how two or more jobs on a single system can share the file, while b is the cross system share option ie how two or more jobs on different MVSes can share the file. Usual value is (2 3).
What Is The Meaning Of Each Of The Values In Shareopts(2 3)?
Value of 2 for cross region means that the file can be processed simultaneously by multiple users provided only one of them is an updater. Value of 3 for cross system means that any number of jobs can process the file for input or output (VSAM does nothing to ensure integrity).
How Do You Define A Ksds ?
DEFINE CLUSTER(cluster name) with the INDEXED parameter. Also specify the ds name for the DATA component & the ds INDEX component. Other important parms are RECORDSIZE, KEYS, SHARE OPTIONS.
What Happens When You Open An Empty Vsam File In A Cobol Program For Input?
A VSAM file that has never contained a record is treated as unavailable. Attempting to open for input will fail. An empty file can be opened for output only. When you open for output, COBOL will write a dummy record to the file & then delete it out.
What Does a File Status Of 02 On A Vsam Indicate?
Duplicate alternate key. Happens on both input and output operation
What Is the Difference Between Sequential Files And Esds Files?
Sequential(QSAM) files can be created on tape while ESDS files cannot.
Also, you can have ALTINDEX for an ESDS while no such facility exists for QSAM files.
How Do You Load a Vsam Data Set With Records?
Using the REPRO command.
How Do You Define A Gdg?
Use the DEFINE GENERATIONDATAGROUP command. In the same IDCAMS step, another dataset must be defined whose DCB parameters are used when new generations of the GDG are created. This dataset is known as the model dataset. The ds name of this model dataset must be the same as that of the GDG, so use a disp of keep rather than catlg and also specify space=(trk,0)
How Are Different Versions Of Gdg Named?
base-file-name.GnnnnnV00 where nnnn= generation number (upto 255).
nnnn will be 0000 for the 1st generation.
What Is Idcams?
IDCAMS is the Access Method Services program. You run the IDCAMS program and supply AMS commands thru SYSIN. (examples of AMS commands are DELETE, DEFINE, REPRO etc..).
What Is Control Interval, Control Area?
Control Interval is analogous to a physical block for QSAM files. It is the unit of i/o. Must be between 512 bytes to 32 k. Usually either 2K or 4K. A larger control interval increases performance for sequential processing while the reverse is true for random access. Under CICS when a record is locked, the entire CI gets locked.
Control area is a group of control intervals. CA is used during allocation. CA size is calculated based on the allocation type (cyl, tracks or records) and can be max of 1 cylinder
What Is Freespace?
Coded in the DEFINE as FREESPACE(ci ca) where ci is the percentage of each control interval to be left free for insertions, ca is the percentage of control intervals in each control area to be left empty.
What Is Shareopts?
SHAREOPTS is a parameter in the DEFINE and specifies how an object can be shared among users. It is coded as SHAREOPTS(a b), where a is the cross region share option ie how two or more jobs on a single system can share the file, while b is the cross system share option ie how two or more jobs on different MVSes can share the file. Usual value is (2 3).
What Is File Status in Vsam?
The File STATUS clause of the FILE-CONTROL paragraph allows for each file to be associated with a file status key (i.e., the 2-character data item specified in the FILE STATUS clause). If the FILE STATUS clause is specified for a given file, a value indicating the status of each I/O operation against that file is placed in the associated file status key. This value is stored in the file status key as soon as the I/O operation is completed (and before execution of any EXCEPTION/ERROR declarative or INVALID KEY/AT END phrase associated with the I/O request).
How Do You Convert Flat Files To Vsam Files?
Flat files are converted into VSAM files by following process:
·         Identify the primary key, when the whole record can be primary key.
·         Alternate key can also be used, if needed
·         File is to be sorted by primary key or the whole record
·         Utilize the SORT statement for dropping duplicates.
·         A JCL command (IDCAMS – Define Cluster) need to be submitted by using the result of sorting mechanism(mentioned above) as input
·         Use the command IDCAMS REPRO for loading the flat file into the VSAM file.
Explain The Information Contained In Ci
·         Control information consists of Record Descriptor Field and Control Interval Descriptor Field.
·         Each CI contains one CIDF that consists of the last 4 bytes
·         CIDF consists of information about the offset and length of free space in the CI
·         In case of fixed size records, each CI contains 2 RDFs each RDF is of 3 bytes length
·         In case of variable length size records, there will be a separate RDF for each record in the CI.
·         The data portion of the CI should be in the multiples of 512 bytes / 2048 bytes.
·         The maximum size of the CI is 32 KB. - The size of index portion of CI could be any of these
·         512, 1024,2048,4096
Difference Between Vsam And Database Tables
·         VSAM file can not run SQL queries. -VSAM lacks any kind of relation -VIEWS and SYNONYMS can not be defined on VSAM files -RDBMS concepts can not be applied in VSAM files.
·         SQL queries can be run in database table - Data fetching is more efficient than VSAM files - RDBMS concepts are applicable in DB2 database - ALIAS VIEWS can be defined on tables for sharing customized data.
What Is Meant By Dirty Read In Vsam?
·         High degree of concurrent access to VSAM files is achieved by dirty read - It is done by avoiding the complications associated with CI and CA splits - The dirty read protocol is summarized as:
·         The VSAM file mandatorily be defined with cross-region SHARE POINTS 4. - The file allocation must be with DISP=SHR - ENQ must be followed for all operations of the files, for data set - Data set name is specified for ENQ name - Any string can be used for the ENQ gname - The user’s buffer must be refreshed with GET request, after obtaining a lock - No lock is held during a wait - DEQ function should be called at the end of all the file operations of enqueue.
What Is the Purpose Of The Verify Function Of Idcams?

To re-sync the end of the file information with the catalog information, the VERIFY function is used.
Request to Download PDF

Post A Comment:

0 comments: