As mentioned briefly before. Access Method Services (AMS) is used to perform various functions on VSAM data sets and catalogs. AMS has a utility program called IDCAMS that can be invoked through a standard JCL and will perform the various functions of the AMS through its commands. The most commonly used AMS commands are:
JCL for Invoking Access Method Services
A skeleton JCL to invoke IDCAMS is given below.
The IDCAMS functional commands with all the right parameters are specified in the SYSIN DD part of the JCL as illustrated above. It can be specified in-stream or in a data set. All functional commands and their parameters must start in or after the second column and cannot extend beyond the 72nd column. The AMS messages will go to the SYSPRINT data set.
If a functional command extends to the next line, a continuation character, in AMS a hyphen must be entered on the previous line. Comments can also be given within a functional command if enclosed within a "/*" and a "*/".
Defining a KSDS Cluster
The update routine is an example of KSDS clusters, and the display routine is an example of both KSDS clusters and alternate indexes.
For these examples, the clusters and alternate indexes should be defined as follows:
The update routine is passed the following:
The display routine is passed the following:
By definition, the primary key is unique and therefore the employee number was chosen for this key. The user_id is also a unique key; therefore, it was chosen as the unique alternate index key. The name field may not be unique; therefore, it was chosen as the non-unique alternate index key.
Suppose you want to define a KSDS data set for an Customer Information system.
Let us say the layout of each customer record is:
The layout of the customer record is shown in the following figure.
Layout of the Customer Record
The JCL for allocating the KSDS data set is given below:
Take a screenshot
The first 6 bytes, which is the customer no, is the primary key of the record. Note the use of hyphen (-) as the continuation character. This indicates that the AMS command is not yet complete and that the following line should be treated as a continuation of the previous line.
Let us examine the JCL line by line.
If this JCL were executed after being customized to your installation standards, a KSDS cluster CUSTOMER.KSDS.CLUSTER would be allocated. The allocation messages would be in the SYSPRINT device Note that we have just created the cluster and it will still be empty. You would have to load records into the cluster using a program or the REPRO command. This will be discussed in a later section. Note that there are more extensive options for allocation of a KSDS cluster. Refer to an IBM manual for details.
Defining an ESDS Cluster
Defining an ESDS is very similar to that of a KSDS except for the following differences. Since ESDS does not have imbedded free space, the FREESPACE parameter is not used
If this JCL is executed after being customized to your installation standards, an ESDS cluster CUSTOMER.ESDS.CLUSTER would be allocated. Note that if the NONINDEXED parameter is omitted AMS would assume the default value INDEXED and allocate a KSDS cluster with default values for FREESPACE, KEYS, index component etc.
Defining an RRDS Cluster
Defining an RRDS is very similar to that of an ESDS except for the following differences.
If this JCL were executed after being customized to your installation standards, an RRDS cluster CUSTOMER.RRDS.CLUSTER would be allocated. Note that if the NUMBERED parameter were omitted AMS would assume the default value INDEXED and again allocate a KSDS cluster with default values for FREESPACE, KEYS, index component etc.
Defining an LDS Cluster
It should be recalled that an LDS is very similar to an ESDS except for that it doesn't have any control fields in a Control interval. Defining an LDS is very similar to that of an ESDS except for the following differences.
If this JCL were executed after being customized to your installation standards, an LDS cluster CUSTOMER.LDS.CLUSTER would be allocated. Note that the RECORDS1ZE parameter is omitted because an LDS doesn't have any concept of a record. It is just a long stream of characters.
IBM Mainframe Related Interview Questions
|IBM Lotus Notes Interview Questions||IBM-CICS Interview Questions|
|COBOL Interview Questions||Linux Interview Questions|
|IBM-JCL Interview Questions||IBM Mainframe Interview Questions|
|IBM AIX Interview Questions||IBM WAS Administration Interview Questions|
|IBM Lotus Domino Interview Questions||IBM Integration Bus Interview Questions|
|Mainframe DB2 Interview Questions||Unix Production Support Interview Questions|
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.