Understanding the way the CA L-Serv LDMAMS Utility functions will help administrators to secure the files to be COMPRESSED and eliminate the risk of file corruption.
search cancel

Understanding the way the CA L-Serv LDMAMS Utility functions will help administrators to secure the files to be COMPRESSED and eliminate the risk of file corruption.

book

Article ID: 38104

calendar_today

Updated On:

Products

COMMON SERVICES FOR Z/OS 90S SERVICES DATABASE MANAGEMENT SOLUTIONS FOR DB2 FOR Z/OS Common Services Xpertware

Issue/Introduction

Understanding the way the CA-L-Serv LDMAMS utility functions will help administrators use it to it's fullest advantage.    
The following Best Practices allow you to secure the file and guard against a loss of data while using this powerful utility.

Knowledge of L-Serv is an essential prerequisite. 

Environment

Release: CA90SV00200-12-Common Services-for z/OS
Component:

Resolution

The LDMAMS Utility logs any activity to the SYSPRINT DD.

  • This important information should be retained for further review.
    • It can be used to resolve any issues with a recently managed file.
  • During execution, LDMAMS issues message LDM08xxx during completion of internal steps.
                                                                                
    1 - How does LDMAMS function?                                                  
                                                                                
    The LDMAMS COMPRESS action executes 3 steps.                
    1  LDMAMS copies the data from the KSDS to the workfile,                    
    2a ------ resets the KSDS                                                   
    2b ------ copies the data from the workfile to the KSDS,                    
    but only 2a and 2b are done in sequence.  

LDMAMS issues message LDM0810I when it has completed the 1st step.     
At this point the workfile is similar to a backup of the KSDS.
However, the workfile is a temporary work dataset and will not be kept if  the next step fails.                                                
LDMAMS issue message LDM0812I when it has completed the COMPRESS.                     
                                                                       
If LDMAMS fail at any time before the step 2a or during the step 2a or the step 2b, there is a risk of corruption.                                                
                                                                        
To avoid this risk, we can improve the LDMAMS process by securing the files before the compress is executed.  The following two methods can be used to
secure your LDMAMS job:                   
                                                                           
1 : The first method is widely used; take a backup before the compress.                                      
      This can be done with LDMAMS, first, create a job that performs the following :                  
 11 Step - Backup                                                            
 12 Step - Compress        -> COND Step 1 must be OK                           
 13 Step - Restore KSDS  -> COND Step 1 must be OK and Step 2 executed but it failed.                                  
                                                                           
2 : The second method will do the same but in a single step, an LDMAMS job that executes these functions:                                                                          
 21 - Backup                                                                
 22 - Compress                                                              
                                                                           
The LDMAMS available commands that will accomplish these steps are:                    

1 - To backup      your KSDS defined with LServ ddname PRODKSDS to a cataloged file allocated with ddname KSDSBKP.                                       
2 - To Compress your KSDS defined with  LServ ddname PRODKSDS using a Workfile allocated with ddname PRODCOPY.                                      

                                                                         
The SYSIN contains the commands :                                                                                                                   
REPRO         INFILE(PRODKSDS) OUTFILE(KSDSBKP) REPLACE REUSE                  
COMPRESS INFILE(PRODKSDS) WORKFILE(PRODCOPY)                              
                                                                          
Note : Options REPLACE and REUSE may be coded in case KSDSBKP is not empty.
                                                                          
If the REPRO fails, LDMAMS won't execute the command COMPRESS but will issue message :                                                           
'LDM0811E Statement skipped due to previous error'                        
The failed REPRO prevents the COMPRESS from taking place and no action will be taken against the KSDS
A successful REPRO will allow LDMAMS to COMPRESS the file .
                                                                          
Method 2 is the preferred method since it easier to implement.                      
                                                                       
Note : Before attempting to compress a KSDS, any activities that require the KSDS, must be shutdown.                                                      
The LServ command 'DISPLAY >SESSIONS' lists the opened sessions in LServ.

It is safer to run the maintenance jobs when there is no user and job activity.                                                              

Additional Information

Article 38090 describes methods you can use to determine if any L-Serv managed files are currently in use. See Article 38090 

Further information on the LDMAMS Utility and other information on L-SERV is found in: