You are on page 1of 17

VSAM - VIRTUAL STORAGE ACCESS METHOD An access method stores and retrieves data and is used in conjunction with

a programming language such as COBOL or PL/I to create applications A high performance file handling tool combing the functions of file organization and access method. HISTORY 1973, First VSAM introduced (standard VSAM) & had only KSDS (Key Sequenced Datasets) and ESDS (Entry-Sequenced Datasets) 1975, Enhanced VSAM introduced with RRDS (Relative Record Datasets) and alternate indexes for KSDS and catalog recovery. This replaced the above entirely 1979, DE/EF (Data Facility/ Extended Function) VSAM introduced with ICF (Integrated Catalog Facility) to replace the old VSAM catalog of the previous VSAM versions. 1983, DFP/VSAM Version 1 (Data Facility Product) introduced to replace DE/EF VSAM entirely and run under MVS/XA (Multiple Virtual System / eXtended Architecture) 1987, DFP/VSAM Version 2. Release 3.0 introduced to replace Version 1 entirely with Linear Datasets (LDS) 1988, DFP/VSAM Version 3. introduced to replace version 2 entirely to run under MVS/ESA (Enterprise Systems Architecture) 1991, DFP/VSAM Version 3. Release 3 introduced to replace the other DFP/VSAM Versions entirely. Here RRDS can contain variable-length records and enhancements were made to DFSMS facilities Benefits and Drawbacks : Major benefits : Quick and efficient retrieval of data owning to compact and efficient index Records can be accessed randomly by key or by address or sequentially. Although conventional data organizations also supports random access in indexed or direct files. VSAM stands out in that even in its sequential organization random access is made possibly by the Relative byte address or RBA Insertion of records is made easier by the use of imbedded free space Deletion of records physically deletes the records, thus ensuring the reclamation of such free space within a data set.

Concurrent usage of VSAM data sets is possible across partitions, regions, address spaces and systems. Data security is enforceable at different levels by password protection VSAM data sets device and operating system independent Major drawbacks : VSAM increases the disk space requirements of systems. This is because VSAM offers certain capabilities like partial self-reorganization to make things more efficient in data sets that can be modified. However, to take advantage of this feature, free space must deliberately be left. For data sets read-only no free-space need to be left. Except for read-only data sets, the integrity of VSAM data sets in a cross-system or cross-region shared environment must be controlled by the user. Types of VSAM data sets The different types of organization for VSAM data sets are : 1. 2. 3. 4. Entry-Sequenced data set (ESDS) Key-Sequenced data set (KSDS) Relative record data set (RRDS) Linear data set (LDS)

Entry-Sequenced data set (ESDS) As in a physical sequential file, the records in an ESDS are sequenced in the oeder in which they are written into the data set. New records are always added to the end of the data set Record 1 Data Component Record 5 Record 2 Record 3 Record 4

Next Record will be inserted here Data component containing the user data. ESDS has more update and access flexibility than a physical file. A record can be updated in place in an ESDS although the length cannot be changed. Random access of records are possible. Records however cannot be deleted. The records can be variable length and there is no imbedded free space.

Key-Sequenced Data Set (KSDS) Records are sequenced on a key field. With the key value of a key field, we can randomly access a record. A KSDS consists of two components : The Data Component, containing the user data including the key field and an Index Component containing pointers (addresses) to the location of the record to which the key field belongs as illustrated below

Storage area For index Component

Record Keys and Pointers

Storage area For data Component

Data records with their unique keys as one of their fields

The key field is normally just a portion of the entire data record and hence the index component is much smaller compared to the data component. The index and data components together are called Base cluster. The records are stored in physical sequence of primary key field. Both random and sequential retrieval and deletion of records are possible. Free space specified during the allocation of the KSDS is left at regular intervals during the initial load of data set. This space helps to keep the data component in physical sequence in spite of random insertions. However after many such insertions and deletions, the records are bound to become out of physical sequence. However the index component with its pointers to the actual data components helps keep the records in logical sequence. Occasional reorganizations put the records in a KSDS back to physical sequence. Records which can also be of variable length, can be updated in place, physically deleted and the resulting free space can be used for other insertions. It is also possible to access the records in a KSDS in a sequence other than that of the primary key. Such keys are called alternate keys and they can be non-unique. For Example, in a pay-roll system where employee number is the unique primary key and the employee name as alternate key.

Relative Record Data Set (RRDS) An RRDS data set split up into fixed-length slots. Each slot occupies a fixed position and is identified by its position relative position of each slot is called the Relative Record Number (RNN). Each slot may or may not contain an actual record. Relative Record Number 2 Data Component Slot 1 Slot 4 Slot 7 Slot 2 Empty Slot Slot 8 Empty slot Slot 6 Empty slot

Relative Record Number 9 Shaded slots in above have records, while the others are empty. An algorithm is formed to map a record to a RRN slot when the record can be stored. In a company with 10,000 employees whose employee numbers range from 1 to 10,000 the number can be used as the RRN. There are no alternate indexes and the lack of an index component is fairly obvious. Records can be inserted, deleted and updated randomly or sequentially. When a record is deleted the slots are freed up which remain in the same place. The slots being fixed in length implies that the record in an RRDS are also fixed length. Linear Data Set (LDS) An LDS is a data set, very similar to an ESDS without the control information. This kind of data set organization is primarily used by DB2. It has no records and Used for fast random access. It takes advantages of the computer's very fast paging hardware for retrieval and storage and the bytes are implicitly divided into 4K blocks or pages, and the paging hardware reads and writes blocks from disk. There is no free space, unused space, control field in LDS.

Internal Organization In a physical sequential data set, records are grouped into blocks and each block may have one or more records. VSAM uses a very similar unit of record called Control Interval (CI). A control interval may contain one or more records. Actually, internally a control is the smallest unit of information storage block, but it is transparent to applications, A CI is the smallest unit of information storage transferred between the storage devices and the buffers. CI's are part of a larger storage structure called Control Area (CA). A control area consists of multiple control intervals Control Interval Control Area 1 Record 1 Control Fields Record 2 Record 3

Control Interval Control Interval Control Area 2 Control Interval Control Interval Control Area 3 Control Interval The minimum size of a CA is one track while the maximum is one cylinder. During the Initial loading of records in the data set, it is possible to specify the percentage of free space within CA. In addition, a number of CAs at the end of the data set may be left free. FREE AREA USAGE When a new record is stored within a particular CI, depending on the value of primary key, if space is available within the CI. If space is not available within the CI, one of free CI available within the CA will be used. After all CI's in a particular CA are used up, free CAs left at end of the data set are used.

ACCESSING A RECORD IN A KSDS DATA SET The level of index is called the sequence set, and it contains primary keys and pointers to the control intervals in the sequential order of the primary keys. The second level if index is called the index set. The second level of index is called the index set. The data set has the index component and data component. The index component may have three levels of index set and one sequence set. (The number of index set levels depends on the size of the data set, CI size, CA size etc.) To retrieve a record with key 53, VSAM begins the search at the highest level of index. It starts comparing from left and compares the required key(53) with the value in the left most index position(26). If the value is not less than or equal to the required key, comparison continues with the next key value in the index. This continues till the key value with a greater than or equal to the required key is found. Consider the following KSDS data set:

Index Component

26

PTR

96

PTR

Index set

PTR

26

PTR 36 PTR 61 PTR

Sequence Set

2 3 5 Fr.sp

11 16 19 26

Free Sp. CI

27 29 31 36

41 44 53 56

64 96 Free Sp Data Component

CI 1

CI 2

CI 3

CI 4

CI 5

CI 6

CI 7

CA 1

CA 2

Here the key value 53 is less than the key value 96 percent in the second position in the index. Now VSAM uses the point in the index set to reach the sequence set. Now it does the comparison within the sequence set to locate the C1 (C1-5) within (CA-2) which the record may be present, then reads this C1 searches for the required record (53) and moves it to program. If he record is not present, returns the value '23' in the FILESTATUS. CONTROL INTERVAL AND CONTROL AREA SPLIT Suppose we want to add a record with key value 4, this records should go in between records between records having key values 3 and 5 which are present in the data set. If there is enough space in CI-1 the record stored in CI-1. If not VSAM locates the free CI within the same Ca moves approximately half of the records from CI-1 to CI-2 and stores the new record at the correct position. This is called Control Interval Split. When CI split occurs the sequence set is updated. Let us say that we want to add a record with key value 46, it should be inserted between records having key values 44 and 53 in CI-5, But let us assume that there is not enough free space within Ci-5 to accommodate the record. VSAM tries to locate a free CI within the CA. Since there is no free CI within the CA(CA-2), VSAM acquires a free CA within the data set. Here a free CA is available. VSAM acquires this CA (CA-3), moves approximately half of the records from CA-2 to CA-3 and update the index appropriately. This process is called Control Area Split. CI split and CA split will impact the system performance particularly in on-line systems. Spanned Records If some records are larger than the CI size, the records extend across CI boundaries (only for ESDS and KSDS). A spanned record begins on a CI boundary. It occupies two or more CIs in a control area. The unused space in the last CI can only be used to extend the record. It cannot contain any other record If the CI split is more, then it will decrease the performance Functional components of VSAM: Catalog Management: Manages the creation, maintenance update, backup and recovery of VSAM Catalogs Record Management: Handles the control and operation of VSAM objects other than catalogs, such KSDS.ESDS.RRDS as well as alternate indexes . Input Output Management: Responsible for control of the actual physical input and output operations issued against VSAM data set. Control Block Management: Provides for dynamic generation of certain critical VSAM control blocks.

Access Method Services (AMS): Multifunctional utility program which provides the user with extreme commonly needed VSAM - related services. Access Method Services (AMS) : AMS is used to perform various functions on VSAM data sets and catalogs. It 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: DEFINE USERCATALOG/MASTERCATALOG - Used by the system programmers to define a VSAM catalog. A user catalog has to be allocated in a master catalog prior to defining VSAM data sets in it. DEFINE SPACE - Allocates VSAM space on a particular disk space. This space is subsequently used to define sub-allocated VSAM data set within it. DEFINE CLUSTER - Allocates and catalogs a VSAM data set. For KSDS, it allocates both the data and index components REPRO - Used to load records into a VSAM data set. It is similar in some respects to the IEBGENER utility. DEFINE ALTERNATE INDEX - Used to define an alternate index for a KSDS or an ESDS. It only allocates the space the space for the alternate index and the records can be loaded into only by using the BLDINDEX command. The base cluster has to be defined to prior to defining the alternating index. BLDINDEX - As mentioned before, the alternate key-pointer pair records are loaded into the alternate index cluster by this command. Therefore, the base cluster has to be defined and loaded and the alternate index defined before using this command. DEFINE PATH - Established a path between the base cluster and an alternate index.. PRINT - Can be used to print a VSAM data set. It can also be used to print Physical Sequential (PS). Partitioned data set (PDS) members etc. VERIFY - During abnormal terminations of the system, VSAM files open at that time will be left open. This command closes the files, brings the index component in sync with the data components and updates the catalog. DELETE - Can be used to delete a VSAM cluster and also used to delete non-VSAM files. VSAM files cannot be deleted with the DELETE option of the DISPOSITION parameter of JCL ALTER - Can be used to alter certain parameter used while creating a VSAM cluster without actually delete-defining the data set.

DEFINE GDG - Can define a Generation Data Group (GDG) index. A GDG is a logical grouping of sequential files under the GDG index. LISTCAT - Lists the different attributes of a VSAM data set. JCL for invoking Access Method Services A skeleton JCL to invoke IDCAMS is given below. //JOBNAME JOB(ACCT),'NAME' //STEPNAME EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* IDCAMS Functional Commands /* // The IDCAMS functional commands with all right parameters are specified in the SYSIN DD part of 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 seventy second 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 with a "/*" and "*/" Defining a KSDS Cluster For example to define a KSDS data set for an customer Information system. Let us say layout of each customer record is : Customer number - A 6 digit number which uniquely identifies a customer - Primary Key Customer name - 10 characters Customer address - 15 characters Sex - 1 character - M or F Date of Birth - 10 characters - dd/mm/yy Sex 6 10 15 Date of Birth 1 10

Customer No Customer Name

Customer Address

//KSDSALC JOB (ACCT), 'KSDS ALLOCATE' //ALLOCATE EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* DEFINE CLUSTER (NAME (CUSTOMER.KSDS.CLUSTER) VOLUMES (TSOP01) CYLINDERS(10,2) CONTROLINTER VALSIZE(4096) FREESPACE(10,20) KEYS(6,0) RECORDSIZE(47,47) DATA (NAME(CUSTOMER.KSDS.DATA) CONTR0LINTERVALSIZE(1024)) /* // The first 6 bytes which is the customer no in the primary key of the records. Note the use of hyphen (-) as the continuation character. Let us examine the JCL line by line Line1: The JOB card may be different depending on installation standards Line2: The EXEC statement invokes the AMS Line3: The SYSPRINT will contain all messages from the AMS program. Line4: The SYSIN card indicates that the instream data containing the functional commands and their parameters follow Line5: DEFINE cluster is the functional command used to allocated a VSAM data set Line6: The NAME parameter indicates the name of the KSDS VSAM cluster. Note that one of the parenthesis is left open Line7: The VOLUMES parameter indicates the volume serial on which the space for the cluster will be located Line8: The CYLINDERS parameter indicates that 10 cylinders of primary space will be allocated. When this space is used up secondary space will be allocated in increments of a cylinder each. Line9: CONTROLINTERVALSIZE (CISZ) for the cluster will be 4096 bytes Line10: The FREESPACE parameter means that at that time of initial loading each control interval will have 10% of its space left free and 20% of control intervals in each control area will left unused. Line11: The KEYS parameter indicates that the primary key is 6 bytes long and starts at position 0 of the record Line12: RECORDSIZE parameter indicates that the average and maximum record lengths in that order. For fixed-length records, they will have the same value. Line13: DATA indicates the beginning of the data component parameters Line14: NAME indicates the name of the data component of the cluster Line15: INDEX indicates the beginning of the index component parameters Line16: NAME indicates the name of the index component of the cluster Line17: CONTROLINTERVALSIZE specifies the control interval size of the component and the instream data is terminated with a "/*" delimiter.

After execution of this JCL a KSDS cluster CUSTOMER.KSDS.CLUSTER would be allocated. The allocation messages would be in the SYSPRINT device. Now the cluster will be empty, by using the REPRO command, we can load records into the cluster. Defining an ESDS cluster Defining an ESDS is very similar to that of a KSDS except for the following differences: 1. Since ESDS doesn't have imbedded free space, the FREESPACE parameter is not used 2. The KEYS parameter has no meaning in the context of ESDS. 3. Since ESDS has no index component, the INDEX parameter is not used. 4. An additional parameter, NONINDEXED is used to tell AMS that an ESDS is being allocated // ESDSALC JOB (ACCT), 'ESDS ALLOCATE' //ALLOCATE EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD* DEFINE CLUSTER (NAME(CUSTOMER.ESDS.CLUSTER) VOLUMES(TSOP01) CYLINDER(10,2) CONTROLINTER VALSIZE(4096) RECORDSIZE(47,47) NONINDEXED) DATA (NAME(CLUSTER.ESDS.DATA)) /* //

If this JCL is executed after being customized to our installation standards, an ESDS cluster CUSTOMER.ESDS.CLUSTER would be allocated Note: 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 a RRDS is very similar to that of an ESDS except for the following differences: 1. Specify NUMBERED instead of NONINDEXED is used to tell AMS that an RRDS is being allocated 2. Since RRDS does not support variable length records, the average and maximum length of the records must be the same.

//RRDSALC JOB (ACCT), 'RRDS ALLOCATE' //ALLOCATE EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD* DEFINE CLUSTER (NAME(CUSTOMER.RRDS.CLUSTER) VOLUMES(TSOP01) CYLINDERS(10,2) CONTROLINTERVALSIZE(4096) RECORDSIZE(47,47) NUMBERED) DATA (NAME(CLUSTER.RRDS.DATA) /* // Note: If the NUMBERED parameter is 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 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 1. Specify LINEAR instead of NONINDEXED is used to tell AMS that an RRDS is being allocated 2. Need not specify CONTROLINTERVALSIZE since it can only be 4096 bytes //LDSALC JOB (ACCT), 'LDS ALLOCATE' //ALLOCATE EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD* DEFINE CLUSTER (NAME(CUSTOMER.LDS.CLUSTER) VOLUMES(TSOP01) CYLINDERS(10,2) LINEAR) DATA (NAME(CLUSTER.LDS.DATA) /* // Note: RECORDSIZE parameter is also omitted because an LDS doesn't have any concept of a record. It is just a long stream of characters

Loading VSAM Data sets Defining a VSAM cluster merely allocates a data set. It still has be loaded with records. This can be done in one of two ways. 1. Using the REPRO command 2. Using COBOL program REPRO is an IEBGENER -like utility to copy records from an input data set to an output data set. In order to use the REPRO command. We need to know the following: 1. 2. Name and type of the input data set and output data set (ESDS, KSDS, RRDS, physical sequential, etc.) Which records from the input are to be copied and which are to be skipped

Let us consider the layout of the input data set to be same as we used before. Customer number - A 6 digit number which uniquely identifies a customer - Primary Key Customer name - 10 characters Customer address - 15 characters Sex - 1 character - M or F Date of Birth - 10 characters - dd/mm/yyy 11111 22222 33333 44444 55555 66666 Alexis Thomas Mathews Marines Susan Jerome 100 Franklin St. 25, King St. 35, South Blvd. 212, Sunset Dr 12, E, Cary St. Hillside Dr M M M F F M 03/05/1966 02/04/2967 01/05/1969 03/04/1972 11/12/1965 08/08/1945

The name of the input data set, let us say, is CUSTOMER, TEST, INPUT. The process of loading data set involves, opening the input file, reading the records one by one and writing it onto the output file. All these functions are accomplished by the one command REPRO. Loading a KSDS The following JCL can be used to load records into a KSDS : //KSDSLD JOB(ACCT), 'REPRO JOB' //LOADKSDS EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //INPUT DD DSN=CUSTOMER.TEST.INPUT,DISP=OLD //OUTPUT DD DSN=CUSTOMER.KSDS.CLUSTER,DISP=OLD //SYSIN DD* REPRO INFILE(CUSTOMER.TEST.INPUT) OUTFILE(CUSTOMER.KSDS.CLUSTER) /* //

On successful execution of the JCL, all six records of the input file CUSTOMER.TEST.INPUT will be copied into CUSTOMER.KSDS.CLUSTER. The input file we used was actually stored in ascending order of the primary key of the KSDS, customer number. An error message would be issued into the SYSPRINT device for each out-of sequence record and after four such instances, the load operation would be aborted. Since in most situation, the input file will not be sorted in ascending order by primary key, it is imperative that we perform an external sort an the input file before the REPRO is performed. A sample JCL for performing this is given below: //KSDSLD JOB (ACCT), 'REPRO JOB' //******************************* //* SORT INPUT FILE * //******************************* //SORT EXEC PGM=SORT //SORTLIB SYS1.SORTLIB,DISP=SHR //SORTIN DD'DSN=CUSTOMER.TEST.INPUT,DISP=OLD //SORTOUT DD DSN=&&SORTED,DISP=(NEW,PASS,DELETE), // DCB=(RECFM=FB,LRECL=47,BLKSIZE=4700), // SPACE=(TRK,(5,1)),UNIT=SYSDA //SYSIN DD* SORT FIELDS=(1,6,CH,A) /* //******************************** //* LOAD KSDS * //******************************** //LOADKSDS EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //INPUT DD DSN=CUSTOMER.KSDS.CLUSTER,DISP=OLD //SYSIN DD* REPRO INFILE(CUSTOMER.TEST.INPUT) OUTFILE(CUSTOMER.KSDS.CLUSTER) /* //

Dynamic Allocation of Files Another variation of the original KSDS load JCL is given below: //KSDSLS JOB(ACCT),'REPRO JOB' //LOADKSDS EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD* REPRO INDATASET(CUSTOMER.DATA.INPUT) OUTDATASET(CUSTOMER.KSDS.CLUSTER) /* // Note: The DD statement for the input and output data sets are not present in this JCL. Also instead of the INFILE and OUTFILE parameters in the REPRO statement. We have used INDATASET and OUTDATASET. AMS performs a dynamic allocation of data sets. The important thing is that dynamic allocation can be only be done for data sets that are cataloged. REPRO INFILE(INPUT) OUTDATASET(CUSTOMER,KSDS.CLUSTER) And REPRO INDATASET (CUSTOMER.TEST.INPUT) OUTFILE(OUTPUT) These type of mixed format within the same REPRO statement are also valid Loading an ESDS Loading records into an ESDS is very similar to a KSDS. Since ESDS doesn't have any primary key, no sorting of input file is required. The records are written into the output ESDS in the exact same order in which they appear in the input A sample JCL for loading into an ESDS is given below: //ESDSLS JOB(ACCT),'REPRO JOB' //LOADESES EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //INPUT DD DSN=CULTOMER.TEST.INPUT,DISP=OLD //OUTPUT DD DSN=CUSTOMER.ESDS.CLUSTER.DISP=OLD //SYSIN DD* REPRO INFILE(CUSTOMER.TEST.INPUT) OUTFILE(CUSTOMER.ESDS.CLUSTER) /* //

Load an RRDS Records will be loaded into the RRDS beginning with relative record number RRN 1. A sample JCL for loading into an RRDS: //RRDSLD JOB(ACCT),'REPRO JOB' //LOADRRDS EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //INPUT DD DSN=CUSTOMER.TEST.INPUT.DISP=OLD //OUTPUT DD DSN=CUSTOMER.RRDS.CLUSTER.DISP=OLD //SYSIN DD* REPRO INFILE(CUSTOMER.TEST.INPUT) OUTFILE(CUSTOMER.RRDS.CLUSTER) /* // Options of the REPRO command REPLACE - Used to merge records into a VSAM file. It can be used when the target records already has records and is either a KSDS or RRDS REPRO INFILE(CUSTOMER.TEST.INPUT) OUTFILE(CUSTOMER.KSDS.CLUSTER) REPLACE -

If the target data set is a non-empty KSDS, all records in the source file whose keys do not match the keys of the target data set are added to the target data set those that match are replace in the target data set with the source records In the case of RRDS, the source data set must be an RRDS too. Records from non-RRDS source data set cannot merged with a RRDS target data set because only a source RRDS will have relative record numbers which will identify where the source records should be placed in the target data set. REUSE - If we use REUSE in REPRO, the records in target KSDS.ESDS.RRDS or LDS are logically deleted and the records from the source are added as if the target data set were empty. In order to use the REUSE option for REPRO, the target data set should have been defined with the REUSE option. Otherwise, the REPRO command will terminate with an error message. REPRO INDATASET(CUSTOMER.TEST.INPUT) OUTDATASET(CUSTOMER.KSDS.CLUSTER) REUSE

SKIP and COUNT - Used to selectively copy records from the source data set to the target data set opposed to fully copying REPRO INDATASET(CUSTOMER.TEST.INPUT) OUTDATASET(CUSTOMER.KSDS.CLUSTER) SKIP(2) COUNT(4) -

The first two records of the input file are skipped and the next four records are copied into the output file and copy is terminated. If SKIP is not coded, the default is SKIP(0) and if COUNT is not coded, from beginning to end until all the records in the input file are copied. FROMKEY and TOKEY - If the source data set is a KSDS from which only records that fall within a certain range need to be copied. We can use this option REPRO INDATASET(CUSTOMER.TEST.INPUT) OUTDATASET(CUSTOMER.KSDS.CLUSTER) FROMKEY(111111) TOKEY(333333) -

Will copy all records with key values ranging from 111111 to 333333. The range can be generic. For example, REPRO INDATASET(CUSTOMER.TEST.INPUT) OUTDATASET(CUSTOMER.KSDS.CLUSTER) FROMKEY(11) TOKEY(33) -

Will copy the records with 11 as the first two bytes of the key through the records having 33 as the first two bytes of the key.

You might also like