VSAM - LDS


Advertisements


LDS is known as Linear Data Set. Linear dataset is the only form of byte-stream dataset which is used in used in traditional operating system files. Linear datasets are rarely used. Following are the key features of LDS −

  • Linear datasets does not contain RDF's and CIDF's as it does not have any control information embedded in its CI.

  • Data that can be accessed as byte-addressable strings in virtual storage in Linear datasets.

  • Linear datasets has a control interval size of 4KBytes.

  • LDS is a kind of non-vsam file with some VSAM facilities like use of IDCAMS and VSAM specific information in the catalog.

  • DB2 is currently the biggest user of Linear Data Sets.

  • IDCAMS is used to define an LDS but it is accessed using a Data-In-Virtual (DIV) macro.

  • Linear dataset does not have concepts of records. All LDS bytes are data bytes.

Defining LDS cluster

The following syntax shows which parameters we can use while creating LDS cluster. The parameter description remains the same as mentioned in VSAM - Cluster module.

DEFINE CLUSTER (NAME(lds-file-name)      -
BLOCKS(number)                           -
VOLUMES(volume-serial)                   -
LINEAR                                   -
CISZ(number)                             -
[READPW(password)]                       -
[FOR(days)|TO(date)]                     -
[UPDATEPW(password)]                     -
[REUSE / NOREUSE])                       -
DATA                                     -
   (NAME(lds-file-name.data))  

Example

Following example shows how to create an LDS cluster in JCL using IDCAMS utility −

//SAMPLE JOB(TESTJCL,XXXXXX),CLASS = A,MSGCLASS = C
//STEP1  EXEC PGM = IDCAMS
//SYSPRINT DD  SYSOUT = *
//SYSIN    DD  *
   DEFINE CLUSTER (NAME(MY.VSAM.LDSFILE)   -
   LINEAR                                  -
   TRACKS(1,1)                             -
   CISZ(4096) )                            -                            
   DATA (NAME(MY.VSAM.LDSFILE.DATA))      
/*

If you will execute the above JCL on Mainframes server. It should execute with MAXCC = 0 and it will create MY.VSAM.LDSFILE VSAM file.

Deleting LDS Cluster

LDS cluster is deleted using IDCAMS utility. DELETE command removes the entry of the VSAM cluster from the catalog and optionally removes the file, thereby freeing up the space occupied by the object.

DELETE data-set-name CLUSTER  
[ERASE / NOERASE] 
[FORCE / NOFORCE] 
[PURGE / NOPURGE] 
[SCRATCH / NOSCRATCH]

Above syntax shows which parameters we can use while deleting LDS cluster. The parameter description remains the same as mentioned in VSAM - Cluster module.

Example

Following example shows how to delete an LDS cluster in JCL using IDCAMS utility −

//SAMPLE JOB(TESTJCL,XXXXXX),CLASS = A,MSGCLASS = C
//STEPNAME EXEC PGM = IDCAMS
//SYSPRINT DD  SYSOUT = *
//SYSIN    DD  *
   DELETE MY.VSAM.LDSFILE CLUSTER
/*

If you will execute the above JCL on Mainframes server. It should execute with MAXCC = 0 and it will delete MY.VSAM.LDSFILE VSAM Cluster.



Advertisements