OPEN-LIBRARY is used to define and open a global library. This is referenced in other statements by means of LIBRARY=*STD.
If two libraries are required in a statement, then the second library must be specified explicitly in the statement or via a link name.
Global libraries remain assigned until they are explicitly closed by means of the CLOSE-LIBRARY statement or until a new OPEN-LIBRARY statement is issued.
Global libraries are opened for reading as standard. If they are to be opened for reading and writing, the operand MODE=*UPDATE must be set. If a new library is set up, it must be generated with MODE=*UPDATE.
Format
OPEN-LIBRARY | ||||||||||||||||||||||||
|
Operands
LIBRARY = <filename 1..54 without-vers> / *LINK(...)
Specifies the library that is to be set up and opened as a global library.
LIBRARY = <filename 1..54 without-vers>
The library with the name specified here is set up as a global library and opened.
LIBRARY = *LINK(...)
The library assigned via the link name is set up as a global library and opened.
LINK-NAME = <structured-name 1..8>
Link name of the library; this name was defined by means of /ADD-FILE-LINK prior to calling LMSCONV.
MODE = *READ / *UPDATE(...)
Library open mode.
MODE = *READ
The library is opened only for reading. It must already exist.
The library is opened for reading and writing.
STATE = *ANY / *OLD / *NEW
Status of the library to be opened.
STATE = *ANY
The library may exist. If it does not exist, it will be created as a new library.
STATE = *OLD
The library must exist.
STATE = *NEW
The library must not exist. It will be created as a new library.
Examples
Assigning an existing library LIB1 as a global library:
//open-library library=lib1
Assigning an existing library as a global library via the link name:
/add-file-link link-name=glob-lib,file-name=lib1 //start-lmsconv . . . //open-library library=*link(link-name=glob-lib)
Creating a new library and assigning it as a global library:
//open-library library=lib1,mode=*update