JCLCHECK with Control-M DD Statement not De-Allocated after exiting ISPF EDIT

Document ID : KB000111846
Last Modified Date : 22/08/2018
Show Technical Document Details
Issue:
Using %EJCK

and on Panel JCK21 

RESOLVE - Resolve external variables by calling product. . . . => CTM 
=> DSN=> ASG.JCLCHECK.PARMS MEM=> 

after exiting ISPF EDIT and trying to get into Control-M,
receive message CTM85DS DAALOCIN DDNAME IS ALLOCATED. PLEASE FREE IT AND TRY AGAIN. 
Resolution:
When using JCLCHECK EJCK Clist with CONTROL-M, sometimes CONTROL-M  allocates the CTM files and does not free it,

You can free the CTM files by updating the JCLCHECK EJCK Clist  with FREE FI(DAALOCIN) at the end of the CTM allocations section of the EJCK Clist.

See following example of the EJCK Clist section:

/* ****************** ALLOCATE SPECINTRAL CTM FILES ****************** */ 
IF &JK@RES = CTM THEN DO  
FREE FI(SYSPRINT)  
ISPEXEC SELECT CMD(%JCKUSRCM) 
ISPEXEC VGET (CTMALOC CTMPARM CTMPRM2 CTMPREN RESRECD)  
IF &STR(&CTMALOC) ¬= THEN + 
ALLOC FI(DAALOCIN) DA('&CTMALOC') REUSE SHR  
IF &STR(&CTMPARM) ¬= THEN + 
ALLOC FI(DAPARM) DA('&CTMPARM','&CTMPRM2') REUSE SHR  
IF &STR(&CTMPREN) ¬= THEN + 
ALLOC FI(DAPRENV) DA('&CTMPREN') REUSE SHR  
IF &STR(&RESRECD) ¬= THEN + 
ALLOC FI(RECORD) DA('&RESRECD') REUSE SHR  
FREE FI(DAALOCIN)  
END