Use this general macro to open a virtual storage access method (VSAM) data
set.
Format
- label
- An optional label can be used with this macro.
- addr
- This parameter specifies the address of the access method control block
(ACB) for the data set that is being opened. You can specify the
address in register notation (by using a register enclosed in parentheses) or
by using an expression that generates an addressable data area.
Entry Requirements
- Register 9 (R9) must point to an entry control block (ECB) that contains a
valid VSAM context block anchored in field CE2VSAM.
- Registers 11 and 12 (R11 and R12) must contain the standard TPF ECB page
index values for ECB pages 2 and 3, respectively.
Return Conditions
- A condition code of 0 indicates that the data set was opened
successfully.
- A nonzero condition code indicates that the data set was not opened
successfully.
- Register 15 (R15) contains the error code.
Programming Considerations
- This macro can be run on any I-stream.
- This macro can be called only by E-type programs.
- The contents of R10, R14, and R15 are destroyed; the contents of all
other registers are preserved.
Examples
In the following example, two data sets are opened.
.
.
.
VGENC BLK=ACB, Generate an ACB
DDNAME=TPFPNID, ..DDname
MACRF=(KEY,DIR,IN) ..Options
BNZ ERROR Process Errors
LR R1,R14 Save ACB (1) pointer in R1
VGENC BLK=ACB, Generate an ACB
DDNAME=TPFPNIG, ..DDname
MACRF=(KEY,DIR,IN) ..Options
BNZ ERROR Process Errors
LR R2,R14 Save ACB (2) pointer in R2
VOPNC ACB=(R1) Open PNIDFILE
BNZ ERROR ..Open error
VOPNC ACB=(R2) Open PNIGFILE
BNZ ERROR ..Open error
.
.
.
TPFPNID DC CL8'PNIDFILE' Data Definition Name (1)
TPFPNIG DC CL8'PNIGFILE' Data Definition Name (2)