This issue resurfaced again recently and I would like to offer one other suggestion, while I like BridgeStone's suggestion to 're-build' the compnent list an easier option might be to just add a //DELCOMP EXEC PGM=CONDELE,PARM='*COMPONENTS' at the top of the generate processor. This would mean you effectively start with a clean plate each time, you use the component list from the last successful run to clean up. Personally I like that deleting the load avoids the situation where the user might not have noticed a failed generate, but WILL notice a missing load when they try to test. That said keeping a last kown good working version also has merit. Emlyn's suggestion of deliberate deletes also avoids the problem, and only cleans up when needed.
------------------------------
Sr Principal Software Engineer
------------------------------
Original Message:
Sent: 08-22-2013 10:31 AM
From: Uwe Brueckersteinkuhl
Subject: Hanging load modules from failed generates.
Hi Mike,
it's a known problem that PGM=CONDELE,PARM='*COMPONENTS' cannot delete components which are not present in the component list after a failed processor execution.
Our solution is that we have a special step in the generate processor which is invoked when the LINK step fails.
The LINK step has a STEP name (e.g.: "LINK").
Then we have following steps which write into the component list in case of a link error:
//******************************************************
//IFLNKFAI IF (LINK.RUN EQ FALSE) OR
// (LINK.RC GT 8 ) THEN
//*
//*-----------------------------------------------------
//* STEP CPYLOAD1 - COPY LOADMOD TO TEMP-DSN
//*-----------------------------------------------------
//CPYLOAD1 EXEC PGM=BSTCOPY,MAXRC=4
//SYSPRINT DD SYSOUT=T
//IN DD DISP=SHR,DSN=&LOADLIB.
//OUT DD DISP=(NEW,PASS),DSN=&&LOADOLD,
// SPACE=(CYL,(2,1,1)),
// RECFM=U,LRECL=0,BLKSIZE=27920,
// DSORG=PO,STORCLAS=SCWRK#00
//SYSIN DD DATA,DLM=$$
COPY I=IN,O=OUT
SELECT MEMBER=&C1ELEMENT
$$
//*
//*-------------------------------------------------------------
//* WHEN TEMP-DSN has a member you are sure you had a LOADMOD before
//*-------------------------------------------------------------
//IFCPYLOD IF (CPYLOAD1.RC EQ 0) THEN
//*
//*-------------------------------------------------------------
//* STEP CPYLOAD2 - COPY LOADMOD from TEMP-DSN to &LOADLIB
//*-------------------------------------------------------------
//CPYLOAD2 EXEC PGM=BSTCOPY,MAXRC=0
//SYSPRINT DD SYSOUT=T
//IN DD DISP=SHR,DSN=&&LOADOLD
//OUT DD DISP=SHR,DSN=&LOADLIB.,MONITOR=&MON
//SYSIN DD DATA,DLM=$$
COPY I=IN,O=OUT
SELECT MEMBER=((&C1ELEMENT,,R))
$$
//*
If you have more output components than only a LOADMOD (e.g. a DBRM) you have to double these steps for the DBRM.
Then you can use PGM=CONDELE,PARM='*COMPONENTS' in the delete processor.