Here are described file formats of routine export which are used
in the MiniM Database Server.

For an export and import MiniM Database Server use standardized file formats
and standard conventions how to create file content. Standard allow portable
verdor-specific differences. Main file format specification is defined by
standard ANSI X11.1–1995 and current ISO 11756–1999.

Routine export file is a text file. All string from line begin up to line
feed symbol or up to file end (if line feed symbol is not reached) threated as
one line, one atomic portion of export. The symbol of line feed is
$c(10), and previous symbol $c(13) (if exist) is
removed and ignored.

First two lines of a file are file header. This lines does not fixed by
standard and are used for special information such as export comment, export
date and time and other. MiniM Database Server use only two conventions for this
first two lines:

ANSI è MSM

First line contain date and time of export.
Second line is an export comment.

Cache

First line is an export comment.
Second line contain date and time of export.

Also custom written exporting program can use this first two lines by own
opinion.

Next, after header's two lines follows routine export blocks and after last
one must be written one more empty line as export end indicator.

Routine export block consist of:

Line with routine name

Line-by-line routine body

Emptu line as routine end indicator

So, routine export file must contain at the end two empty lines - end of last
routine export and end of all export.

In practice, any line of the routine can be empty line if vendor support such
routines. And at export this line must be replaced to line with one space
symbol.

If file must contain several routines, after each empty line as a routine
terminator must follows next routine name, routine body and so one.

Autoimport format.

Autoimport format is a special calling convention about export header to
import routines in the file automatically, without other import software. If on
the export was specified autoimport option, first two lines contains special
MUMPS command sequence so this file can be passed to MiniM executable:

minim.exe < rouname.rou

In this case MiniM process reads and executes file content line-by line and
first line starts import. Other content of file will be read from current input
device |STD|. Autoimport commands can use first line or both two first lines.
MiniM Database Server use convention allowed to import file with autoimport
option as such as ordinal routine export file.

For example, MiniM Routine Editor on the export creates file with the
following autoimport header:

Common export conventions of routine export includes convention allowed to
import routines from file independently of the header content. This means that
the export software cannot use more than two first lines for special information
but can use file after last two empty lines.

For routine export files operator can use any file extension, the most widely
used extensions are: