An abend in L-Serv can cause the corruption of a file when LDMAMS is processing a COMPRESS. How can this be prevented?
The CA L-Serv LDMAMS Utility executing in a z/OS enviroment.
The LDMAMS COMPRESS has been interrupted which corrupts the partially rebuilt VSAM file.
The root cause of such situation can be an Abend in L-Serv or an external access to the dataset that is currently compressed.
It is recommended to backup a file before running a COMPRESS. This is also recommended when using LDMAMS utility within LServ.
Here is the best practice sequence to COMPRESS a VSAM dataset including a BACKUP:
1 - Run a LDMAMS step for each VSAM you need to COMPRESS.
2 - Add a LDMAMS Backup/COPY command before the COMPRESS command. The COMPRESS will start if the LDMAMS Copy completed successfully.
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 failed LDMAMS won't execute the command COMPRESS but will issue message :
'LDM0811E Statement skipped due to previous error'
This way, the REPRO allows to check that the KSDS is ready for the compress.
For further information, please see "Maintain Managed Files" in the CA-L-Serv Chapter found in the CA Common Services Administration Guide