When compiling a COBOL program, it is possible for a CREATE ACCESS MODULE statement to yield different results in different CVs; it can work successfully in one and not in another. This can happen even if there is a single COBOL compile proc that all the programmers use, regardless of the target CV. .
Environment
This situation can arise in any CA IDMS environment where SQL is deployed.
Resolution
When a program has SQL statements only in the Data Division, an RCM (Relational Command Module) will not be produced by the pre-compiler. An RCM is only produced when a program contains SQL DML statements in the Procedure Division. That is the way it's designed to work. This makes sense because an RCM contains pre-optimized pseudo-code for executable SQL DML statements; that is it's sole purpose. So without any DML statements to pre-optimize, there is no reason to have an RCM.
In some cases, clients may find that they have an older RCM in their DDLDML area from an earlier version of the same program (which did contain SQL DML in the Procedure division); or from another program by the same name that contains SQL DML. The CREATE ACCESS MODULE statement has no way of knowing whether a particular RCM is the one intended to be included or not; if it finds an RCM by the appropriate name it will use it and will complete without error. To determine if that is the case, log on to the IDMS CV and task IDD, then enter these commands: SiGNON DICTNAME=<compile-dictionary>. DISPLAY LOAD MODULE <program-name>. If this shows a load module with "Type is RCM", then check the timestamp. It will reveal whether this is from the most recent pre-compile or something older.
If this occurs, go into IDD and issue these commands to delete the old RCM: SiGNON DICTNAME=<compile-dictionary>. DELETE LOAD MODULE <program-name>. Once the outdated RCM is deleted, the CREATE ACCESS MODULE will work as designed - it will fail because there is no RCM for this program.
Additional Information
For more information about developing SQL applications and the role that an RCM plays, see this documentation: https://docops.ca.com/ca-idms/19/en/using/programming-idms-sql/sql-application-development
For the role the pre-compiler plays in creating an RCM, and options for naming the RCM, see this documentation: https://docops.ca.com/ca-idms/19/en/using/programming-idms-sql/preparing-and-executing-the-program/precompiling-the-program
For syntax and information about creating an Access Module, see this documentation: https://docops.ca.com/ca-idms/19/en/using/programming-idms-sql/preparing-and-executing-the-program/creating-the-access-module