Greetings everyone! In converting some of our OPM programs into ILE, we ran into a problem using RCLRSC. Here is some simple CL code that represents the problem: PGM ADDPFM FILE(TESTLIB/TESTFILE) MBR(M000000001) TEXT('Test member') OVRDBF FILE(TESTFILE) TOFILE(TESTLIB/TESTFILE) MBR(M000000001) SHARE(*YES) CALL PGM(##TESTOVRR) RCLRSC DLTOVR FILE(TESTFILE) RMVM FILE(TESTLIB/TESTFILE) MBR(M000000001) ENDPGM Note that the program ##TESTOVRR is an RPGLE program that returns with *INLR *OFF. If compiled into the default activation group (DAG), this program works fine. However, when compiled into a named activation group (we are using QILE), the RMVM command fails (CPF7310) because TESTFILE is not closed (RCLRSC was removed, but we already knew it wouldn't work anyway). So, we added a CLOF TESTFILE to replace the RCLRSC. It failed (CPF4520) because no file was opened with that identifier. Finally, we added an explicit OPNDBF TESTFILE OPTION(*ALL) between the OVRDBF and the CALL. Now, the RMVM command fails again (CPF7310) because TESTFILE is not closed. The question is this: What can replace RCLRSC in the code above? I know some options, but I don't really like them for various reasons. 1) We could move *ON *INLR in the RPG program (this works). 2) We could call a different CL in a separate named activation group to do file cleanup with RCLACTGRP(QILE) after this CL ends (this works). Any suggestions? Am I missing something really obvious here? Are we running into some type of scoping problem here? Is it not possible to do this sequence of events in a single CL running in a named activation group? It seems to us that RCLRSC performs a function in the DAG that has no counterpart in a named activation group. We would greatly appreciate any help or guidance on this issue. Thank you and have a great day! Brian

Reply With Quote