3. Embedded SQL for COBOL : Preprocessor Operation : The COBOL Compiler—VMS : How to Place User-Written Embedded SQL Routines in Shareable Images
 
Share this page                  
How to Place User-Written Embedded SQL Routines in Shareable Images
When you plan to place your code in a shareable image, note the following about the psect attributes of your global or external variables:
As a default, some compilers mark global variables as shared (SHR: every user who runs a program linked to the shareable image sees the same variable) and others mark them as not shared (NOSHR: every user who runs a program linked to the shareable image gets their own private copy of the variable).
Some compilers support modifiers you can place in your source code variable declaration statements to explicitly state which attributes to assign a variable.
The attributes that a compiler assigns to a variable can be overridden at link time with the psect_attr link option, which overrides attributes of all variables in the psect.
Consult your compiler reference manual for further details.
Note:  For operating system specific information on compiling and linking ESQL/COBOL programs, see the Readme file.