\chapter{Environment division}
\begin{syntax}
  \begin{0-1}
    \key{ENVIRONMENT} \key{DIVISION}.
  \end{0-1}
  \newline
  \begin{0-1}
    \metaelement{configuration-section}
  \end{0-1}
  \newline
  \begin{0-1}
    \metaelement{input-output-section}
  \end{0-1}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\section{Configuration section}

\format{standard}

\begin{syntax}
  \key{CONFIGURATION} \key{SECTION}.
  \newline
  \begin{0-1}
    \metaelement{source-computer-paragraph}
  \end{0-1}
  \newline
  \begin{0-1}
    \metaelement{object-computer-paragraph}
  \end{0-1}
  \newline
  \begin{0-1}
    \metaelement{special-names-header}
    \begin{0-1}
      \metaelement{special-names-entry}
    \end{0-1} \ldots
  \end{0-1}
  \newline
  \begin{0-1}
    \metaelement{repository-paragraph}
  \end{0-1}
\end{syntax}

\format{micro-focus-and-gnucobol}

\begin{syntax}[\miscextcolour]
  \begin{0-1}
    \key{CONFIGURATION} \key{SECTION}.
  \end{0-1}
  \newline
  \begin{0+}
    \metaelement{source-computer-paragraph} \\
    \metaelement{object-computer-paragraph} \\
    \metaelement{special-names-header} \\
    \metaelement{special-names-entry} \\
    \metaelement{repository-paragraph}
  \end{0+}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SOURCE-COMPUTER paragraph}

The SOURCE-COMPUTER paragraph identifies the computer on which the compilation unit should be compiled.

\begin{syntax}
  \key{SOURCE-COMPUTER}.
  \begin{0-1}
    \begin{1=}
      \computername
    \end{1=}\gnucobol{\ldots}
    \deleted{
      \begin{0-1}
        WITH \key{DEBUGGING} \key{MODE}
      \end{0-1}
    }
    .
  \end{0-1}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{OBJECT-COMPUTER paragraph}

The OBJECT-COMPUTER paragraph identifies the computer on which the runtime module should be run.

\begin{syntax}
  \key{OBJECT-COMPUTER}.

  \begin{0-1}
    \begin{0-1}
      \begin{1=}
        \computername
      \end{1=}\gnucobol{\ldots}
    \end{0-1}\\\quad
    \begin{0-1}
      \deleted{
        \key{MEMORY} SIZE IS \integer
        \begin{1=}
          \key{CHARACTERS} \\
          \key{WORDS} \\
          \key{MODULES}
        \end{1=}
      } \\

      PROGRAM COLLATING \key{SEQUENCE} \defdmetaelement{collating-sequences}\\

      \deleted{\key{SEGMENT-LIMIT} IS \integer} \\
      CHARACTER \key{CLASSIFICATION} IS
      \begin{1=}
        \metaelement{locale-name-1} \\
        \key{LOCALE} \\
        \key{SYSTEM-DEFAULT} \\
        \key{USER-DEFAULT}
      \end{1=}
    \end{0-1}\ldots\ {}.
  \end{0-1}
\end{syntax}

where \defnmetaelement{collating-sequences} is:

\begin{syntax}
  \begin{1=}
    IS \metaelement{alphanumeric-collating-sequence}
    \pending{
      \begin{0-1}
        \metaelement{national-collating-sequence}
      \end{0-1}
    } \\

    \begin{1+}
      FOR \key{ALPHANUMERIC} IS \metaelement{alphanumeric-collating-sequence} \\
      \pending{FOR \key{NATIONAL} IS \metaelement{national-collating-sequence}}
    \end{1+}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SPECIAL-NAMES paragraph}

\begin{syntax}
  \begin{0-1}
    \key{SPECIAL-NAMES}.
  \end{0-1}

  \begin{0-1}
    \begin{1=}
      \defdmetaelement{mnemonic-name-clause} \\
      \defdmetaelement{alphabet-name-clause} \\
      \defdmetaelement{symbolic-characters-clause} \\
      \miscext{\defdmetaelement{symbolic-constant-class}} \\
      \key{LOCALE} \metaelement{locale-name-1} IS \literal \\
      \defdmetaelement{class-clause} \\

      \key{CURRENCY} SIGN IS \literal
      \begin{0-1}
        \pending{WITH \key{PICTURE-SYMBOL} \literal}
      \end{0-1} \\

      \key{DECIMAL-POINT} IS \key{COMMA} \\
      \miscext{\key{NUMERIC} \key{SIGN} IS \key{TRAILING} \key{SEPARATE}} \\
      \key{CURSOR} IS \identifier \\
      \key{CRT} \key{STATUS} IS \identifier \\
      \miscext{\pending{\key{SCREEN-CONTROL} IS \identifier}} \\
      \miscext{\pending{\key{EVENT-STATUS} IS \identifier}} \\
      \miscext{\key{TOP} IS \identifier}
    \end{1=}\ldots\ {}.
  \end{0-1}\ldots
\end{syntax}

where \defnmetaelement{mnemonic-name-clause} is

\begin{syntax}
  \mnemonicname
  \begin{1=}
    IS \key{CRT} \\
    \integer IS \systemname \\
    \begin{0-1}
      IS \switchname
    \end{0-1}
    \begin{1+}
      \key{ON} STATUS IS \switchstatusname \\
      \key{OFF} STATUS IS \switchstatusname
    \end{1+}
  \end{1=}
\end{syntax}

where \defnmetaelement{alphabet-name-clause} is

\begin{syntax}
  \key{ALPHABET} \metaelement{alphabet-name-1} IS
  \begin{1=}
    \begin{0-1}
      FOR \key{ALPHANUMERIC}
    \end{0-1}
    \begin{1=}
      \key{ASCII} \\
      \key{EBCDIC} \\
      \key{STANDARD-1} \\
      \key{STANDARD-2} \\
      \key{NATIVE} \\
      \key{LOCALE} \\
      \begin{1=}
        \literal
        \begin{0-1}
          \begin{1=}
            \key{THROUGH} \\
            \key{THRU}
          \end{1=}
          \literal \\
          \begin{1=}
            \key{ALSO} \literal
          \end{1=}\ldots
        \end{0-1}
      \end{1=}\ldots
    \end{1=} \\

    \begin{0-1}
      FOR \key{NATIONAL}
    \end{0-1}
    \begin{1=}
      \pending{\key{UTF-8}} \\
      \pending{\key{UTF-16}} \\
      \pending{\key{UCS-4}} \\
      \key{NATIVE} \\
      \key{LOCALE} \\
      \begin{1=}
        \literal
        \begin{0-1}
          \begin{1=}
            \key{THROUGH} \\
            \key{THRU}
          \end{1=}
          \literal \\
          \begin{1=}
            \key{ALSO} \literal
          \end{1=}\ldots
        \end{0-1}
      \end{1=}\ldots
    \end{1=} \\
  \end{1=}
\end{syntax}

where \defnmetaelement{symbolic-characters-clause} is

\begin{syntax}
  \key{SYMBOLIC} CHARACTERS
  \begin{1=}
    \begin{1=}
      \metaelement{symbolic-character-name-1}
    \end{1=}\ldots
    \begin{1=}
      \key{IS} \\
      \key{ARE}
    \end{1=}
    \begin{1=}
      \integer
    \end{1=}\ldots
  \end{1=}\ldots
  \begin{0-1}
    \key{IN} \key{WORD}
  \end{0-1}
\end{syntax}

where \defnmetaelement{symbolic-constant-clause} is

\begin{syntax}[\miscextcolour]
  \key{SYMBOLIC} \key{CONSTANT}
  \begin{1=}
    \identifier IS \literal
  \end{1=}\ldots
\end{syntax}

where \defnmetaelement{class-clause} is

\begin{syntax}
  \key{CLASS}
  \begin{0-1}
    FOR \key{ALPHANUMERIC} \\
    \pending{FOR \key{NATIONAL}} \\
  \end{0-1}
  \metaelement{class-name-1} IS
  \begin{1=}
    \literal
    \begin{0-1}
      \begin{1=}
        \key{THRU} \\
        \key{THROUGH}
      \end{1=}
      \literal
    \end{0-1}
  \end{1=}\ldots

  \pending{
    \begin{0-1}
      \key{IN} \metaelement{alphabet-name-1}
    \end{0-1}
  }
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{REPOSITORY paragraph}

\begin{syntax}
  \key{REPOSITORY}.

  \begin{0-1}
    \begin{1=}
      \key{FUNCTION}
      \begin{1=}
        \begin{1=}
          \functionname
        \end{1=}\ldots \\

        \key{ALL}
      \end{1=}
      \key{INTRINSIC} \\

      \key{FUNCTION} \functionname
      \begin{0-1}
        \key{AS} \literal
      \end{0-1} \\

      \key{PROGRAM} \programname
      \begin{0-1}
        \key{AS} \literal
      \end{0-1}
    \end{1=}\ldots\ {}.
  \end{0-1}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\section{Input-output section}

\begin{syntax}
  \begin{0-1}
    \key{INPUT-OUTPUT} \key{SECTION}.
  \end{0-1}\newline
  \begin{0-1}
    \metaelement{file-control-paragraph}
  \end{0-1}\newline
  \begin{0-1}
    \metaelement{i-o-control-paragraph}
  \end{0-1}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{FILE-CONTROL paragraph}

\begin{syntax}
  \begin{0-1}
    \key{FILE-CONTROL}.
  \end{0-1}\newline
  \begin{0-1}
    \defdmetaelement{file-control-entry}
  \end{0-1} \ldots
\end{syntax}

where \defnmetaelement{file-control-entry} is

\begin{syntax}
  \key{SELECT}
  \begin{0-1}
    \key{OPTIONAL} \\
    \miscext{\key{NOT} \key{OPTIONAL}}
  \end{0-1}
  \filename
  \begin{0-1}
    \defdmetaelement{actual-key-clause} \\
    \defdmetaelement{assign-clause} \\
    \defdmetaelement{access-mode-clause} \\
    \defdmetaelement{alternate-record-key-clause} \\
    \defdmetaelement{collating-sequence-clause} \\
    \defdmetaelement{collating-sequence-key-clause} \\
    \defdmetaelement{file-limit-clause} \\
    \defdmetaelement{file-status-clause} \\
    \defdmetaelement{lock-mode-clause} \\
    \defdmetaelement{nominal-key-clause} \\
    \defdmetaelement{organization-clause} \\
    \defdmetaelement{padding-character-clause} \\
    \defdmetaelement{password-clause} \\
    \defdmetaelement{record-delimiter-clause} \\
    \defdmetaelement{record-key-clause} \\
    \defdmetaelement{relative-key-clause} \\
    \defdmetaelement{reserve-clause} \\
    \defdmetaelement{sharing-clause} \\
    \defdmetaelement{track-area-clause} \\
    \defdmetaelement{track-limit-clause}
  \end{0-1}\ldots\ {}.
\end{syntax}

where \defnmetaelement{actual-key-clause} is

\ {} \newline
\begin{syntax}[\miscextcolour]
  \pending{
    \key{ACTUAL} KEY IS \identifier
  }
\end{syntax}

where \defnmetaelement{assign-clause} is

\begin{syntax}
  \key{ASSIGN} TO
  \begin{1=}
    \begin{0-1}
      \defdmetaelement{device-or-line-adv-file}
    \end{0-1}
    \literal \\

    \miscext{
      \begin{0-1}
        \key{EXTERNAL} \\
        \key{DYNAMIC}
      \end{0-1}
    }
    \begin{1=}
      \defdmetaelement{device} \\

      \begin{0-1}
        \defdmetaelement{device-or-line-adv-file}
      \end{0-1}
      \begin{1=}
        \metaelement{external-file-name} \\
        \miscext{\identifier}
      \end{1=}
    \end{1=} \\

    \begin{0-1}
      \defdmetaelement{device-or-line-adv-file}
    \end{0-1}
    \begin{1=}
      \key{USING} \\
      \miscext{\key{VARYING}}
    \end{1=}
    \identifier \\

    \miscext{\key{DISK} \key{FROM} \identifier} \\
  \end{1=}
\end{syntax}

where \defnmetaelement{device-or-line-adv-file} is

\begin{syntax}
  \begin{1=}
    \defdmetaelement{device} \\
    \miscext{\key{LINE} \key{ADVANCING} FILE}
  \end{1=}
\end{syntax}

where \defnmetaelement{device} is

\begin{syntax}
  \begin{1=}
    \miscext{\key{CARD-PUNCH}} \\
    \miscext{\key{CARD-READER}} \\
    \miscext{\key{CASSETTE}} \\
    \key{DISC} \\
    \xopen{\key{DISK}} \\
    \miscext{\key{DISPLAY}} \\
    \miscext{\key{INPUT}} \\
    \miscext{\key{INPUT-OUTPUT}} \\
    \miscext{\key{KEYBOARD}} \\
    \miscext{\key{MAGNETIC-TAPE}} \\
    \miscext{\key{OUTPUT}} \\
    \key{PRINT} \\
    \xopen{\key{PRINTER}} \\
    \miscext{\key{PRINTER-1}} \\
    \key{RANDOM} \\
    \key{TAPE}
  \end{1=}
\end{syntax}

where \defnmetaelement{access-mode-clause} is

\begin{syntax}
  \key{ACCESS} MODE IS
  \begin{1=}
    \key{SEQUENTIAL} \\
    \key{DYNAMIC} \\
    \key{RANDOM}
  \end{1=}
\end{syntax}

where \defnmetaelement{alternate-record-key-clause} is

\begin{syntax}
  \key{ALTERNATE} RECORD KEY IS \identifier
  \begin{0-1}
    \begin{1=}
      = \\
      \key{SOURCE} IS
    \end{1=}
    \begin{1=}
      \identifier
    \end{1=}\ldots
  \end{0-1}

  \begin{0-1}
    WITH
    \begin{0-1}
      \key{NO}
    \end{0-1}
    \key{DUPLICATES}
  \end{0-1}

  \miscext{
    \pending{
      \begin{0-1}
        \key{PASSWORD} IS \identifier
      \end{0-1}
    }
  }

  \begin{0-1}
    \key{SUPPRESS} \key{WHEN} \literal
  \end{0-1}
\end{syntax}

where \defnmetaelement{collating-sequence-clause} is

\begin{syntax}
  \pending{
    COLLATING \key{SEQUENCE}

    \begin{1=}
      IS \metaelement{alphanumeric-collating-sequence}
      \pending{
        \begin{0-1}
          \metaelement{national-collating-sequence}
        \end{0-1}
      } \\

      \begin{1+}
        FOR \key{ALPHANUMERIC} IS \metaelement{alphanumeric-collating-sequence} \\
        \pending{FOR \key{NATIONAL} IS \metaelement{national-collating-sequence}}
      \end{1+}
    \end{1=}
  }
\end{syntax}

where \defnmetaelement{collating-sequence-key-clause} is

\begin{syntax}
  \pending{
    COLLATING \key{SEQUENCE} \key{OF} \identifier IS \metaelement{alphabet-name-1}
  }
\end{syntax}

where \defnmetaelement{file-limit-clause} is

\begin{syntax}[\miscextcolour]
  \pending{
    \begin{1=}
      \key{FILE-LIMIT} \\
      \key{FILE-LIMITS}
    \end{1=}
    \begin{1=}
      IS \\
      ARE
    \end{1=}
    \begin{1=}
      \begin{1=}
        \identifier \\
        \literal
      \end{1=}
      \begin{1=}
        \key{THROUGH} \\
        \key{THRU}
      \end{1=}
      \begin{1=}
        \identifier \\
        \literal
      \end{1=}
    \end{1=} \ldots
  }
\end{syntax}

where \defnmetaelement{file-status-clause} is

\begin{syntax}
  \begin{0-1}
    \key{FILE} \\
    \key{SORT}
  \end{0-1}
  \key{STATUS} IS \identifier
  \miscext{
    \begin{0-1}
      \identifier
    \end{0-1}
  }
\end{syntax}

where \defnmetaelement{lock-mode-clause} is

\begin{syntax}
  \key{LOCK} MODE IS
  \begin{1=}
    \begin{1=}
      \begin{1=}
        \key{MANUAL} \\
        \key{AUTOMATIC}
      \end{1=}
      \begin{0-1}
        \key{WITH} LOCK \key{ON}
        \begin{0-1}
          \key{MULTIPLE}
        \end{0-1}
        \begin{1=}
          \key{RECORD} \\
          \key{RECORDS}
        \end{1=}
      \end{0-1}
      \begin{0-1}
        \miscext{\pending{WITH \key{ROLLBACK}}}
      \end{0-1}
    \end{1=} \\

    \miscext{
      \key{EXCLUSIVE}
      \pending{
        \begin{0-1}
          WITH \key{MASS-UPDATE}
        \end{0-1}
      }
    }
  \end{1=}
\end{syntax}

where \defnmetaelement{nominal-key-clause} is

\begin{syntax}[\miscextcolour]
  \pending{
    \key{NOMINAL} KEY IS \identifier
  }
\end{syntax}

where \defnmetaelement{organization-clause} is

\begin{syntax}
  \begin{0-1}
    \begin{1=}
      \key{ORGANIZATION} \\
      \miscext{\key{ORGANISATION}}
    \end{1=}
    IS
  \end{0-1}
  \begin{1=}
    \key{INDEXED} \\
    \xopen{\key{LINE} \key{SEQUENTIAL}} \\
    \miscext{RECORD BINARY} \key{SEQUENTIAL} \\
    \key{RELATIVE}
  \end{1=}
\end{syntax}

where \defnmetaelement{padding-character-clause} is

\begin{syntax}
  \pending{
    \key{PADDING} CHARACTER IS
    \begin{1=}
      \identifier \\
      \literal
    \end{1=}
  }
\end{syntax}

where \defnmetaelement{password-clause} is

\begin{syntax}[\miscextcolour]
  \pending{
    \key{PASSWORD} IS \identifier
  }
\end{syntax}

where \defnmetaelement{record-delimiter-clause} is

\begin{syntax}
  \key{RECORD} \key{DELIMITER} IS
  \begin{1=}
    \pending{\key{STANDARD-1}} \\
    \key{LINE-SEQUENTIAL} \\
    \key{BINARY-SEQUENTIAL}
  \end{1=}
\end{syntax}

where \defnmetaelement{record-key-clause} is

\begin{syntax}
  \key{RECORD} KEY IS \identifier
  \begin{0-1}
    \begin{1=}
      \miscext{=} \\
      \key{SOURCE} IS
    \end{1=}
    \begin{1=}
      \identifier
    \end{1=}\ldots
  \end{0-1}

  \miscext{
    \pending{
      \begin{0-1}
        \key{PASSWORD} IS \identifier
      \end{0-1}
    }
  }

  \miscext{
    \begin{0-1}
      WITH
      \begin{0-1}
        \key{NO}
      \end{0-1}
      \key{DUPLICATES}
    \end{0-1}
  }
\end{syntax}

where \defnmetaelement{relative-key-clause} is

\begin{syntax}
  \key{RELATIVE} KEY IS \identifier
\end{syntax}

where \defnmetaelement{reserve-clause} is

\begin{syntax}
  \pending{
    \key{RESERVE}
    \begin{1=}
      \key{NO} \\
      \integer
    \end{1=}
    \begin{0-1}
      AREA \\
      AREAS
    \end{0-1}
  }
\end{syntax}

where \defnmetaelement{sharing-clause} is

\begin{syntax}
  \key{SHARING} WITH
  \begin{1=}
    \key{ALL} OTHER \\
    \key{NO} OTHER \\
    \key{READ} \key{ONLY}
  \end{1=}
\end{syntax}

where \defnmetaelement{track-area-clause} is

\begin{syntax}[\miscextcolour]
  \pending{
    \key{TRACK-AREA} IS
    \begin{1=}
      \identifier \\
      \literal
    \end{1=}
    CHARACTERS
  }
\end{syntax}

where \defnmetaelement{track-area-clause} is

\begin{syntax}[\miscextcolour]
  \pending{
    \key{TRACK-LIMIT} IS \integer
    \begin{1=}
      \key{TRACK} \\
      \key{TRACKS}
    \end{1=}
  }
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{I-O-CONTROL paragraph}
\begin{syntax}
  \begin{0-1}
    \key{I-O-CONTROL}.
  \end{0-1}\newline
  \begin{1=}
    \pending{
      \key{APPLY} \key{COMMIT} ON \identifier\ldots
    } \\

    \miscext{
      \pending{
        \key{APPLY}
        \begin{1=}
          \key{CORE-INDEX} \\
          \key{EXTENDED-SEARCH} \\
          \key{LOCK-HOLDING} \\
          \key{PRINT-CONTROL} \\
          \key{RECORD-OVERFLOW} \\
          \key{WRITE-ONLY} \\
          \key{WRITE-VERIFY}
        \end{1=}
        ON \filename\ldots
      }
    } \\

    \miscext{
      \pending{
        \key{APPLY}
        \begin{1=}
          \key{CYL-INDEX} \\
          \key{MASTER-INDEX}
        \end{1=}
        TO \integer ON \filename\ldots
      }
    } \\

    \miscext{
      \pending{
        \key{APPLY} \key{CYL-OVERFLOW} OF \integer
        \begin{1=}
          \key{TRACK} \\
          \key{TRACKS}
        \end{1=}
        ON \filename\ldots
      }
    } \\

    \miscext{
      \pending{
        \key{APPLY}
        \begin{1=}
          \key{CORE-INDEX} \\
          \key{REORG-CRITERIA}
        \end{1=}
        TO \identifier ON \filename\ldots
      }
    } \\

    \key{SAME}
    \begin{0-1}
      \key{RECORD} \\
      \key{SORT} \\
      \key{SORT-MERGE}
    \end{0-1}
    AREA FOR
    \begin{1=}
      \filename
    \end{1=}\ldots \\

    \deleted{
      \key{MULTIPLE} FILE TAPE CONTAINS
      \begin{1=}
        \filename
        \begin{0-1}
          \key{POSITION} \integer
        \end{0-1}
      \end{1=}\ldots
    } \\

    \deleted{
      \key{RERUN} ON \filename EVERY
      \begin{1=}
        \integer \key{RECORDS} \\
        \key{END} OF
        \begin{1=}
          \key{REEL} \\
          \key{UNIT}
        \end{1=}
      \end{1=}
    }
  \end{1=}\ldots\ {}.
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "grammar.tex"
%%% End:
