SDMS_SEL

Set file type access behavior

WTSupported in traditional Synergy 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)

4 = Alternate (Btrieve)

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

Tip

If alternate file access mechanisms (such as C-ISAM or Btrieve) are not in use, SDMS_SEL is not necessary, because Synergy ISAM is the only type available.

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 mechnism has been enabled, SDMS_SEL is ignored.

The following “select” file operations are affected: OPEN, XCALL ISAMC, XCALL ISCLR, XCALL DELET, and XCALL RENAM.

The default behavior for all “select” 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 “select” file operation. Specifying a nonexistent file_type will set the default behavior.

When behavior is set to 0, all “select” operations that follow will access files according to the seleccted behavior. Call SDMS_SEL with file_type set to 0 to cancel this behavior. When behavior is set to 1, only the next “select” file operation will be affected; subsequent “select” operations will revert to the default behavior.

Note

Currently, the only supported file interfaces are C-ISAM (a trademark of Informix Corporation), available for UNIX, and Btrieve (a trademark of Pervasive Software), available for Windows. However, this subroutine is designed to handle several additional file interfaces at once.

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