I have two modules called 'A' and 'B'. Module 'A' opens the ORACLE database connection, and Calls 'B', which queries the database using the 'SELECT' statement.
When I hard code the module name during CALL, the called module uses the database connection opened in the module 'A'. Pls refer below:
CALL "B"
But, when I moved the module name into a variable and try to call the module, as below
MOVE "B" TO VAR-MODULE-NAME
CALL VAR-MODULE-NAME.
the called module is not using the database connection, which results in an error "ORA-01012 - Not Logged On".
And both the modules are compiled as follows:
cob2 B.cbl -o B -L
cob2 A.cbl -o A -L or cob2 A.cbl B.cbl A -L
Can anyone answer my query? Also, can anyone answer that some compiler options needs to be modified?
Dynamic Linking in COBOL
When I hard code the module name during CALL, the called module uses the database connection opened in the module 'A'. Pls refer below:
CALL "B"
But, when I moved the module name into a variable and try to call the module, as below
MOVE "B" TO VAR-MODULE-NAME
CALL VAR-MODULE-NAME.
the called module is not using the database connection, which results in an error "ORA-01012 - Not Logged On".
And both the modules are compiled as follows:
cob2 B.cbl -o B -L
cob2 A.cbl -o A -L
Can anyone answer my query? Also, can anyone answer that some compiler options needs to be modified?
Profile Answers by mohanaraj_j Questions by mohanaraj_j
Questions by mohanaraj_j
Related Answered Questions
Related Open Questions