Summary -

In this topic, we have explained about the below sections -

LDS is a short form of Linear Data Set and is a byte-stream data set. LDS is the only form of a byte-stream data set in traditional z/OS files. LDS used by DB2, z/OS system functions heavily but rarely used in application programs.

Data from LDS accessed as byte-addressable strings in virtual storage. LDS has a control interval (CI) size multiple of 4096 bytes.

LDS has no control information in its CI. i.e., no RDFs and CIDFs.

LDS is the VSAM dataset organization used by DIV (Data-In-Virtual) facility.

Logical records should be blocked and deblocked by the application program to avoid concurrent updates. Logical records are not visible from the VSAM point of view. i.e., LDS is a non-VSAM data set with some VSAM facilities.

Unlike the ESDS and RRDS, LDS contains a DATA component only. LDS is mainly used by IBM DB2.

DEFINE LDS -

LDS data set can be created using the LINEAR parameter in the IDCAMS DEFINE CLUSTER command.

Syntax -

LDS- JCL for creating LDS dataset with minimum parameters -

//JOB CARD
//*------------------------------------------------------------------
//* Definition of LDS
//*------------------------------------------------------------------
//STEP01  EXEC PGM=IDCAMS
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
    DEFINE CLUSTER 				-
       (NAME(userid.CLUSTER.NAME) 		–
	CYLINDERS(primary secondary)		-
       	VOL(XXXXXX) 				–
	BUFFERSPACE(buffer-space)		–
	CISZ(ci-size)				– 
	FREESPACE(primary secondary)		–
        LINEAR	 				-
        NOREUSE 				-
        OWNER(userid) ) 			-
      DATA 					-
        (NAME(userid.CLUSTER.NAME.DATA)) 	-
      CATALOG(XXXXXX)
/*

Create LDS JCL -

Requirement - Create LDS using the IDCAMS utility.

Code -

Create LDS JCL
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
//MATEGJL JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),            
//             NOTIFY=&SYSUID                                           
//************************************************************          
//* DEFINE VSAM LDS CLUSTER                                             
//************************************************************          
//STEP01   EXEC PGM=IDCAMS                                              
//SYSPRINT DD SYSOUT=*                                                  
//SYSOUT   DD SYSOUT=*                                                  
//SYSIN    DD  *                                                        
  DEFINE CLUSTER(NAME(MATEGJ.TEST.LDS)  -                               
     CYLINDERS(2,1)       -                                             
     CISZ(4096)           -                                             
     VOLUMES(DEVHD4)      -                                             
     LINEAR               -                                             
     REUSE     )          -                                             
  DATA(NAME(MATEGJ.TEST.LDS.DATA))                                      
/*                                                                      
**************************** Bottom of Data ****************************

In the above JCL, MATEGJ is the userid and changes all as required.

Output -

Once the above JCL is submitted, check the MAXCC of the job for any errors. If the MAXCC is 00 or 04, LDS successfully created.

Create LDS Output

Verify the LDS in 3.4 (Dataset List utility) or any File management tools.

Create LDS Output

Explaining Example -

In the above example,

  • CYLINDERS(2,1) specifies the primary memory allocation is 2 CYLINDERS, and secondary memory allocation is 1 CYLINDER.
  • VOLUMES(DEVHD4) specifies that allocate the LDS on volume DEVHD4.
  • LINEAR parameter specifies the file is to create LDS.
  • REUSE specifies the memory can reuse immediately once the file gets deleted.
Note! In the above example, the LDS file was created with minimum parameters. Add the additional parameters based on the requirements. Refer total parameters description in Define Cluster topic.

Delete LDS -

Requirement - Delete LDS using the IDCAMS utility.

Code -

Delete LDS
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
//MATEGJD JOB (123),'MTH',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),            
//             NOTIFY=&SYSUID                                           
//************************************************************          
//* DELETING LDS                                                        
//************************************************************          
//STEP01   EXEC PGM=IDCAMS                                              
//SYSPRINT DD   SYSOUT=*                                                
//SYSIN    DD   *                                                       
      DELETE 'MATEGJ.TEST.LDS'                                          
/*                                                                      
**************************** Bottom of Data ****************************

In the above JCL, MATEGJ.TEST.LDS is the LDS name that is planned to delete.

Output -

Once the above JCL is submitted, check the MAXCC of the job for any errors. If the MAXCC is 00 or 04, LDS successfully got deleted.

DELETE LDS Output

Verify the LDS in 3.4 (Dataset List utility) or any File management tools if required to double-check.

DELETE LDS Output

Explaining Example -

In the above example, the MATEGJ.TEST.LDS (LDS file) successfully deleted and uncatalogued(space released).

Note! If the file is already deleted and trying to delete the file again, we may receive MAXCC as 08. So, verify the file once before proceeding for delete.