Hi all.
I’m new to COBOL and I came from C/C++.
My question is: what is the difference between
LOCAL-STORAGE SECTION and WORKING-STORAGE SECTION.
As I understood, in terms of C, LOCAL-STORAGE SECTION – automatic storage class(stack), WORKING-STORAGE SECTION – static storage class. Am I right?
If yes, my next question:
A COBOL program for CICS should be at least quasi-reentrant in order to run correctly from several transactions concurrently.
If I compile/link-edit COBOL program without RENT option and I did not provide quasi-reentrancy in it (for example, I modify WORKING-STORAGE between two EXEC CICS calls) then I can get inconsistent concurrent execution.
I was almost sure about it before I read:
“Multithreading requires that all CICS application programs be reentrant; that is, they must be serially reusable between entry and exit points. CICS APPLICATION PROGRAMS USING THE EXEC CICS INTERFACE OBEY THIS RULE AUTOMATICALLY. For COBOL, C, and C++ programs, reentrancy is ensured by a fresh copy of working storage being obtained each time the program is invoked.”
Does it mean that I may to compile COBOL program without RENT option even if it modifies WORKING-STORAGE between two EXEC CICS calls?
Does it mean that COBOL program has its own copy of WORKING-STORAGE for every concurrent running transaction?
What about C? Does it mean that C program has its own copy of static storage for every concurrent running transaction?
Thanks.
I’m new to COBOL and I came from C/C++.
My question is: what is the difference between
LOCAL-STORAGE SECTION and WORKING-STORAGE SECTION.
As I understood, in terms of C, LOCAL-STORAGE SECTION – automatic storage class(stack), WORKING-STORAGE SECTION – static storage class. Am I right?
If yes, my next question:
A COBOL program for CICS should be at least quasi-reentrant in order to run correctly from several transactions concurrently.
If I compile/link-edit COBOL program without RENT option and I did not provide quasi-reentrancy in it (for example, I modify WORKING-STORAGE between two EXEC CICS calls) then I can get inconsistent concurrent execution.
I was almost sure about it before I read:
“Multithreading requires that all CICS application programs be reentrant; that is, they must be serially reusable between entry and exit points. CICS APPLICATION PROGRAMS USING THE EXEC CICS INTERFACE OBEY THIS RULE AUTOMATICALLY. For COBOL, C, and C++ programs, reentrancy is ensured by a fresh copy of working storage being obtained each time the program is invoked.”
Does it mean that I may to compile COBOL program without RENT option even if it modifies WORKING-STORAGE between two EXEC CICS calls?
Does it mean that COBOL program has its own copy of WORKING-STORAGE for every concurrent running transaction?
What about C? Does it mean that C program has its own copy of static storage for every concurrent running transaction?
Thanks.