SDMS_SEL
WSupported on Windows
|
USupported on Unix
|
|
|
xcall SDMS_SEL(file_type, behavior)
Arguments
file_type
One of the following file types:
0 = Default order
1 = Synergy ISAM
3 = Alternate: C-ISAM (deprecated)
behavior
One of the following behaviors:
0 = Set and retain the selected file access behavior.
1 = Set the selected file access behavior, one time only.
Discussion
SDMS_SEL is only needed when an alternate file access mechanism is in use. Most of the time SDMS_SEL is not necessary because Synergy ISAM is the only type available. It is never used unless you are using dbr.cis, which is no longer supported. Currently, the only alternate file interface is C-ISAM (a registered trademark of IBM), available for Unix. However, this option is deprecated and only works with the dbr.cis file. |
The SDMS_SEL subroutine allows altering the default file access behavior when an alternate file access mechanism has been enabled. When no alternate file access mechanism is enabled, SDMS_SEL is ignored.
The behavior argument affects the following operations: OPEN, XCALL ISAMC, XCALL ISCLR, XCALL DELET, and XCALL RENAM. The default behavior for all open operations that access an existing file is to first attempt to open the file as an alternate (as ordered above) and then to attempt to open the file as Synergy ISAM. The default behavior for a create operation is to create the specified file as the first enabled alternate file type (as ordered above).
To alter the default behavior and explicitly specify a single file type, call SDMS_SEL with the appropriate file_type before calling the desired file operation. Specifying a nonexistent file_type will set the default behavior.
When behavior is set to 0, all operations that follow will access files according to the chosen behavior. Call SDMS_SEL with file_type set to 0 to cancel this behavior. When behavior is set to 1, only the next file operation will be affected; subsequent operations will revert to the default behavior.
Examples
The following example converts a Synergy error number into a text string using the Synergy message file. The call to SDMS_SEL tells the OPEN to look for a Synergy ISAM file rather than checking for alternate file types.
.define MSGCHN ,23 subroutine interpret_runerror error_number ,n error_text ,a record rec fac ,a3 num ,d5 code ,a10 text ,a200 proc xcall sdms_sel(1, 1) open(MSGCHN, i:i, "DBLDIR:syntxt") num = error_number read(MSGCHN, rec, "RNT" + ^a(num)) error_text = text(2, 200) close MSGCHN xreturn endsubroutine