Synergy DBL files

File types

Synergy DBL uses four types of files: ISAM, relative, sequential, and stream.

On OpenVMS, for more information about all file types, refer to your Guide to OpenVMS File Applications (which is part of your OpenVMS systems documentation set).

ISAM files

An ISAM file consists of a series of data records referenced by key. An ISAM file is created by the ISAMC subroutine or bldism utility on Windows and Unix, or by CREATE/FDL on OpenVMS. For more information, see Synergy DBMS.

Relative files

A relative file consists of a series of fixed-length data records referenced by their relative position within the file. A relative file is created when you specify the relative (R) submode when opening the file for output or update mode. Data records can be accessed by record number or sequentially.

Synergy DBL relative files provide easy, consistent migration of programs using fixed-length records from other Synergy/DE environments; they make it possible to bring an application to OpenVMS from another environment without changing the file characteristics or the manner in which the file is processed.

Sequential files

A sequential file consists of a series of data records referenced in the order in which they exist in the file. The size of records can vary within the file. A sequential file is created when you specify the sequential (S) submode when opening the file for output or update mode. Data records are sequentially written to and read from a sequential file; they cannot be accessed by record number.

Stream files

A stream file consists of a series of data records whose contents are defined by their record terminators. On Windows and Unix, there is no physical difference between stream files and sequential files except that stream files can be accessed randomly based on the size of the data area used in the I/O statements. On Windows and Unix, stream files are created by default if you open a file in output mode without specifying a submode. On OpenVMS, you can change the default to stream (instead of sequential) by compiling with /STREAM or by specifying /STREAM in the OPEN statement’s OPTION string and not specifying a submode on the OPEN statement with either method.

File specifications

Any place you can specify a filename in Synergy DBL—on command lines, in OPEN statements, in .INCLUDE statements, and so forth—you can specify a directory path or a search list logical for that file. A filename can contain spaces on Windows.

Note

The “at” sign (@) is invalid in a file specification in an OPEN statement unless you’re using it to denote a remote (xfServer) filename. See below for syntax.

xfServer file specifications

To specify a remote xfServer filename, use the format filename@localhost. For example,

open (1, o, "fred.ddf@localhost")

Alternatively, you can use an environment variable in an xfServer file specification, like this:

open(1, o, "TRN:fred.ddf")

where TRN=c:\temp@localhost.

Note

If you want to open a file to a server on a specific port, remember to call the SETLOG routine to set the environment variable SCSPORT before using the OPEN statement.

Search list logicals

A search list logical is an identifier defined at the operating system level as a list of one or more directories. When a search list logical is specified, Synergy DBL searches each of the directories listed for the specified file. If it’s specified when a file is created, Synergy DBL places the file in the first directory specified in the logical.

An example of defining a search list logical under the Unix Bourne shell is as follows:

DAT=/usr/fred,/usr/fred/dbl

An example of defining a search list on OpenVMS is as follows:

DEFINE DAT [usr.fred],[usr.fred.dbl]

If you use the DAT logical in a path specification, as shown in the example below, Synergy DBL looks for the specified file first in /usr/fred and then, if it can’t find it, in /usr/fred/dbl:

open(1, i, "DAT:afile")

Here’s another example:

xcall renam("DAT:newfile", oldfile)

In this example, the renamed file (newfile) is placed in /usr/fred, because it’s the first directory specified in the search list.

See Setting environment variables and initialization settings for more information about setting search list logicals on your operating system.

Default extensions

If you don’t specify an extension in your file specification, Synergy DBL assumes one. The default extension depends on the command or statement with which you are using your file specification. For example, on a compiler command line, the Synergy compiler assumes .dbl is the extension of your source file. Refer to the specific command or statement you are using to find out what file extension is assigned.