SETDFN

Set the default filename path and extension

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
xcall SETDFN([path.extension][, option])

Arguments

path.extension

(optional) A field, literal, or record that contains the filename path and extension to be used as the new default by the runtime. (a)

option

(optional) Flag to indicate where path.extension will be applied: (n)

0 = The non-ISAM default path and extension (default)

1 = The ISAM default path and extension

2 = Both the ISAM and non-ISAM default path and extensions

Discussion

Note

Setting the default path and extension only works on your local machine. xfServer always uses the default path and extension.

Windows and Unix

On Windows and Unix, the SETDFN subroutine sets the default filename path and extension to be used by the runtime. If path.extension is missing or null, the original default filename path and extension is restored.

When SETDFN is activated, wherever a filename that does not include a fully rooted path (c:\path\ on Windows or /usr/path/ on Unix) is specified (by OPEN, XCALL DELET, XCALL COPY, SORT, MERGE, LPQUE, etc.), the default path will be added to the beginning of the filename. A trailing “\” or “/" (depending on the system) is required to indicate this is a path, not a filename. For example,

On Windows:

XCALL SETDFN("C:\Customer1\.dat", 0)
OPEN(1, I, "custmain")                 ;Attempts to open C:\Customer1\custmain.dat
OPEN(2, I, "ap\apcust")                ;Attempts to open C:\Customer1\ap\apcust.dat
OPEN(3, I, "C:\Customer2\custmain")    ;Attempts to open C:\Customer2\customain.dat

On Unix:

XCALL SETDFN("/usr3/customer1/.dat", 0)
OPEN(1, I, "custmain")                 ;Attempts to open /usr3/customer1/custmain.dat
OPEN(2, I, "ap/apcust")                ;Attempts to open /usr3/customer1/ap/apcust.dat
OPEN(2, I, "/usr4/customer2/custmain") ;Attempts to open /usr4/customer2/custmain.dat

OpenVMS

On OpenVMS, a path specified in SETDFN is only used if the specified file doesn’t include any path. If a file is specified with either a relative or absolute path, that path is used instead of the one in SETDFN. For example,

XCALL SETDFN("DKA100:[CUSTOMER1].dat", 0)
OPEN(1, I, "custmain")                 ;Attempts to open DKA100:[CUSTOMER1]custmain.dat

The initial default filename specifications used by the runtime library are SYS$DISK:[ ].DDF for non-ISAM operations and SYS$DISK:[ ].ISM for ISAM operations.