SAMOPEN

The SAMOPEN routine opens the specified database and establishes all the necessary components to access the index and subfile (SYSOUT and/or panel) data. Only one database can be accessed at one time. Any database that was subsequently opened is automatically closed before the new database is opened.
view
The SAMOPEN routine opens the specified database and establishes all the necessary components to access the index and subfile (SYSOUT and/or panel) data. Only one database can be accessed at one time. Any database that was subsequently opened is automatically closed before the new database is opened.
Calling Parameters
  • Address of a 17-byte database identifier
  • Address of open type (optional)
Return Codes
Output Return Codes (general register 15):
  • 0
    Database successfully opened
  • 4
    Not used
  • 8
    Error in allocating/opening the database
Calling Example: Assembler
The following is an example using assembler:
. . CALL SAMOPEN,(DATABASE),VL OPEN DATABASE LTR 15,15 CHECK RETURN CODE BNZ DBERR . . . DATABASE DC....CL17'VIEW.SYSTEM1' SAR DATABASE
Calling Example: COBOL
The following is an example using COBOL:
. . . 77 DATA-BASE-NAME PIC X(17) VALUE 'VIEW.SYSTEM1'. CALL 'SAMOPEN' USING DATA-BASE-NAME. IF RETURN-CODE NOT = ZERO GO TO DBERR.