The following list describes the available OPSVSAM functions:
var = OPSVSAM('OPEN','ddname','dsname','I' or 'O','RLS' or 'RES'
One or both of these variables must be specified:
ddname
dsname
If only the ddname variable is specified, the file must be preallocated to that ddname. If only the dsname variable is specified, the file is dynamically allocated to a system-generated ddname. If both the ddname and dsname variables are specified, the dsname is allocated to the specified ddname.
Input ('I') is the default open mode. To update a file, the output mode ('O') must be specified.
RLS (Record Level Sharing) is a feature of z/OS that allows VSAM files to be shared across systems in a sysplex. Consult your systems programming group regarding the availability of this feature. To use RLS, the VSAM file must be SMS-managed and defined with the LOG(NONE) parameter.
Important! RES specifies that a reserve should be issued for the data set to serialize access across systems. The major name for the reserve is the ddname that is used and the minor name is SVDB. Because a reserve can cause system performance problems, consult with your systems programming group before using this option.
The default is not to use RLS or RES.
var = OPSVSAM('CLOSE','ddname')
If the file was an OPEN function dynamically, it is deallocated dynamically.
var = OPSVSAM('CLOSET','ddname')
Note: An OPEN function is not required to continue file processing.
var = OPSVSAM('ENDREQ','ddname')
var = OPSVSAM('POINT','ddname','key',key length,'KGE' or 'KEQ')
var = OPSVSAM('READ','ddname','key',key length,'KGE' or 'KEQ')
var = OPSVSAM('READUP','ddname','key',key length,'KGE' or 'KEQ')
var = OPSVSAM('UPDATE','ddname','record')
var = OPSVSAM('DELETE','ddname')
var = OPSVSAM('INSERT','ddname','record','KEY',key length)
Example: OPSVSAM
This example illustrates the performance of VSAM file operations on a VSAM KSDS with a character key length of 10 that begins in position 1 of a maximum 100-byte record:
Signal On Syntax Name VSAM_ERROR /* Dynamically allocate and open the VSAM file */ vrc = Opsvsam('OPEN',,'TEST.VSAM.KSDS','O') If opsrc > 0 Then Signal VSAM_ERROR /* Insert a new record with key = OPSMVS */ newrec = Substr('OPSMVS',1,opskeyln) || 'TEST DATA RECORD' vrc = Opsvsam('INSERT',opsdd,newrec) If opsrc > 0 Then If opsrc = 8 & opsre = 8 Then Say 'Duplicate record:' newrec Else Signal VSAM_ERROR /* Retrieve and delete the record we just added */ vrc = Opsvsam('READUP',opsdd,Substr(newrec,1,opskeyln)) If opsrc = 0 Then vrc = Opsvsam('DELETE',opsdd) Else Signal VSAM_ERROR /* Clean up and exit */ Signal ALL_DONE /* VSAM error procedure */ VSAM_ERROR: Say 'OPSVSAM error: RC='opsrc 'REASON='opsre 'DD='opsdd Do While Queued() > 0 Pull xdqmsg Say xdqmsg End ALL_DONE: lrc = opsrc vrc = Opsvsam('CLOSE',opsdd) Exit lrc
|
Copyright © 2014 CA Technologies.
All rights reserved.
|
|