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.
Release: CA90SV00200-12-Common Services-for z/OS
The LDMAMS Utility logs any activity to the SYSPRINT DD.
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.
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: