\chapter{Data division}

\begin{syntax}
  \begin{0-1}
    \key{DATA} \key{DIVISION}.
  \end{0-1}\newline
  \begin{0-1}
    \metaelement{file-section}
  \end{0-1}\newline
  \begin{0-1}
    \metaelement{working-storage-section}
  \end{0-1}\newline
  \pending{
    \deleted{
      \begin{0-1}
        \metaelement{communication-section}
      \end{0-1}
    }
  }\newline
  \begin{0-1}
    \metaelement{local-storage-section}
  \end{0-1}\newline
  \begin{0-1}
    \metaelement{report-section}
  \end{0-1}\newline
  \begin{0-1}
    \metaelement{screen-section}
  \end{0-1}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\section{File section}

\begin{syntax}
  \begin{0-1}
    \key{FILE} \key{SECTION}.
  \end{0-1}\newline
  \begin{1=}
    \metaelement{file-description-entry}
    \begin{1=}
      \metaelement{record-description} \\
      \metaelement{constant-definition}
    \end{1=}\ldots
  \end{1=}\ldots
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{File description entry}

\begin{syntax}
  \begin{1=}
    \key{FD} \\
    \key{SD}
  \end{1=}
  \filename
  \begin{0-1}
    \metaelement{block-clause} \\

    \pending{
      \key{CODE-SET} IS \metaelement{alphabet-name-1}
      \begin{0-1}
        \key{FOR}
        \begin{1=}
          \identifier
        \end{1=} \ldots
      \end{0-1}
    } \\

    \deleted{
      \key{DATA}
      \begin{1=}
        \key{RECORD} \\
        \key{RECORDS}
      \end{1=}
      \begin{0-1}
        IS \\
        ARE
      \end{0-1}
      \begin{1=}
        \identifier
      \end{1=}\ldots
    } \\

    IS \key{EXTERNAL} \\
    IS \key{GLOBAL} \\

    \deleted{
      \key{LABEL}
      \begin{1=}
        \key{RECORD} \\
        \key{RECORDS}
      \end{1=}
      \begin{0-1}
        IS \\
        ARE
      \end{0-1}
      \begin{1=}
        \key{STANDARD} \\
        \key{OMITTED}
      \end{1=}
    } \\

    \metaelement{linage-clause} \\

    \deleted{
      \key{RECORDING} MODE IS
      \begin{1=}
        \begin{1=}
          \key{F} \\
          \key{FIXED} \\
        \end{1=} \\

        \begin{1=}
          \key{V} \\
          \key{VARIABLE} \\
        \end{1=} \\

        \key{U} \\
        \key{S}
      \end{1=}
    } \\

    \pending{
      \begin{1=}
        \key{REPORT} IS \\
        \key{REPORTS} ARE
      \end{1=}
      \begin{1=}
        \identifier
      \end{1=}\ldots
    } \\

    \deleted{
      \key{VALUE} \key{OF}
      \begin{1=}
        \key{FILE-ID} \\
        \key{ID} \\
        \identifier
      \end{1=}
      IS
      \begin{1=}
        \literal \\
        \identifier
      \end{1=}
    } \\

    \metaelement{record-clause}
  \end{0-1}\ldots\ {}.
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\section{Working-storage section}
\begin{syntax}
  \key{WORKING-STORAGE} \key{SECTION}.\newline
  \begin{0-1}
    \metaelement{constant-definition} \\
    \metaelement{record-description}
  \end{0-1}\ldots
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\section{Communication section}
\begin{syntax}[\deletedcolour]
  \pending{
    \key{COMMUNICATION} \key{SECTION}.\newline
    \begin{0-1}
      \metaelement{communication-description-entry}
      \begin{0-1}
        \metaelement{record-description} \\
        \metaelement{constant-definition}
      \end{0-1}\ldots
    \end{0-1}\ldots
  }
\end{syntax}

\subsection{Communication description entry}

% TO-DO: Format more neatly.
\format{input}
\begin{syntax}[\deletedcolour]
  \key{CD} \metaelement{entry-name} FOR
  \begin{0-1}
    \key{INITIAL}
  \end{0-1}
  \key{INPUT}
  \begin{0-1}
    \begin{1+}
      SYMBOLIC \key{QUEUE} IS \identifier \\
      SYMBOLIC \key{SUB-QUEUE-1} IS \identifier \\
      SYMBOLIC \key{SUB-QUEUE-2} IS \identifier \\
      SYMBOLIC \key{SUB-QUEUE-3} IS \identifier \\
      \key{MESSAGE} \key{DATE} IS \identifier \\
      \key{MESSAGE} \key{TIME} IS \identifier \\
      SYMBOLIC \key{SOURCE} IS \identifier \\
      \key{TEXT} \key{LENGTH} IS \identifier \\
      \key{END} \key{KEY} IS \identifier \\
      \key{STATUS} \key{KEY} IS \identifier \\
      MESSAGE \key{COUNT} IS \identifier
    \end{1+} \\

    \hspace{1em}
    \begin{minipage}[!h]{0.4\textwidth}
      \hspace{-2.15em} \identifier \identifier \identifier \identifier \identifier \identifier \identifier \identifier \identifier \identifier \identifier
    \end{minipage}
  \end{0-1}
  .
\end{syntax}

\format{output}
\begin{syntax}[\deletedcolour]
  \key{CD} \metaelement{entry-name} FOR \key{OUTPUT}
  \begin{0+}
    \key{DESTINATION} \key{COUNT} IS \identifier \\
    \key{TEXT} \key{LENGTH} IS \identifier \\
    \key{STATUS} \key{KEY} IS \identifier \\
    \key{DESTINATION} \key{TABLE} \key{OCCURS} \integer TIMES
    \begin{0-1}
      \key{INDEXED} BY
      \begin{1=}
        \cobolindexname
      \end{1=}\ldots
    \end{0-1} \\
    \key{ERROR} \key{KEY} IS \identifier \\
    \key{DESTINATION} IS \identifier \\
    \key{SYMBOLIC} \key{DESTINATION} IS \identifier
  \end{0+}
  .
\end{syntax}

\format{I-O}
\begin{syntax}[\deletedcolour]
  \key{CD} \metaelement{entry-name} FOR INITIAL \key{I-O}
  \begin{0-1}
    \begin{1+}
      \key{MESSAGE} \key{DATE} IS \identifier \\
      \key{MESSAGE} \key{TIME} IS \identifier \\
      SYMBOLIC \key{TERMINAL} IS \identifier \\
      \key{TEXT} \key{LENGTH} IS \identifier \\
      \key{END} \key{KEY} IS \identifier \\
      \key{STATUS} \key{KEY} IS \identifier
    \end{1+} \\

    \identifier \identifier \identifier \identifier \identifier \identifier
  \end{0-1}
  .
\end{syntax}

\section{Local-storage section}
\begin{syntax}
  \key{LOCAL-STORAGE} \key{SECTION}.\newline
  \begin{0-1}
    \metaelement{constant-definition} \\
    \metaelement{record-description}
  \end{0-1}\ldots
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\section{Linkage section}
\begin{syntax}
  \key{LINKAGE} \key{SECTION}.\newline
  \begin{0-1}
    \metaelement{constant-definition} \\
    \metaelement{record-description}
  \end{0-1}\ldots
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\section{Report section}
\begin{syntax}
  \key{REPORT} \key{SECTION}.\newline
  \begin{0-1}
    \metaelement{constant-definition} \\
    \metaelement{report-description}
  \end{0-1}\ldots
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{Report description}

\begin{syntax}
  \key{RD} \reportname

  \begin{0-1}
    IS \key{GLOBAL} \\

    % TO-DO: Check where WITH came from.
    \gnucobol{WITH} \key{CODE} IS
    \begin{1=}
      \identifier \\
      \literal
    \end{1=} \\

    \begin{1=}
      \key{CONTROL} \\
      \key{CONTROLS}
    \end{1=}
    \begin{0-1}
      IS \\
      ARE
    \end{0-1}
    \begin{1=}
      \begin{1=}
        \identifier
      \end{1=}\ldots \\

      \key{FINAL}
      \begin{0-1}
        \identifier
      \end{0-1}\ldots \\
    \end{1=} \\

    \defdmetaelement{page-limits-clause}
  \end{0-1}\ldots\ {}.\newline

  \begin{1=}
    \metaelement{report-group-description-1}
  \end{1=}\ldots
\end{syntax}

where \defnmetaelement{page-limits-clause} is

\begin{syntax}
  \key{PAGE}
  \begin{0-1}
    \key{LIMIT} \\
    \key{LIMITS}
  \end{0-1}
  \begin{0-1}
    IS \\
    ARE
  \end{0-1}
  \begin{1=}
    \integer \\
    \identifier
  \end{1=}
  \begin{1=}
    \key{LINE} \\
    \key{LINES}
  \end{1=}

  \begin{0-1}
    \begin{1=}
      \integer \\
      \identifier
    \end{1=}
    \begin{1=}
      \key{COLUMNS} \\
      \key{COLS}
    \end{1=}
  \end{0-1}

  \begin{0-1}
    \key{HEADING} IS
    \begin{1=}
      \integer \\
      \identifier
    \end{1=} \\

    \key{FIRST}
    \begin{1=}
      \key{DETAIL} \\
      \key{DE}
    \end{1=}
    IS
    \begin{1=}
      \integer \\
      \identifier
    \end{1=} \\

    \key{LAST}
    \begin{1=}
      \key{CONTROL} \key{HEADING} \\
      \key{CH}
    \end{1=}
    IS
    \begin{1=}
      \integer \\
      \identifier
    \end{1=} \\

    \key{LAST}
    \begin{1=}
      \key{DETAIL} \\
      \key{DE}
    \end{1=}
    IS
    \begin{1=}
      \integer \\
      \identifier
    \end{1=} \\

    \key{FOOTING} IS
    \begin{1=}
      \integer \\
      \identifier
    \end{1=} \\

    \miscext{
      \key{LINE} \key{LIMIT} IS
      \begin{1=}
        \integer \\
        \identifier
      \end{1=}
    }
  \end{0-1} \ldots
\end{syntax}

where \defnmetaelement{report-group-description} is

\begin{syntax}
  \metaelement{level-number} \metaelement{entry-name}
  \begin{0-1}
    \metaelement{blank-clause} \\
    \metaelement{column-clause} \\
    \key{GROUP} INDICATE \\
    \metaelement{justified-clause} \\
    \metaelement{line-clause} \\
    \metaelement{next-group-clause} \\
    \metaelement{picture-clause} \\
    \metaelement{present-when-clause} \\
    \metaelement{occurs-clause} \\
    \metaelement{sign-clause} \\
    \metaelement{source-clause} \\
    \metaelement{sum-clause} \\
    \metaelement{type-clause} \\
    \key{USAGE} IS \key{DISPLAY} \\
    \metaelement{value-clause} \\
    \metaelement{varying-clause}
  \end{0-1}\ldots\ {}.
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\section{Screen section}
\begin{syntax}
  \key{SCREEN} \key{SECTION}.\newline
  \begin{0-1}
    \metaelement{constant-definition} \\
    \metaelement{screen-description}
  \end{0-1}\ldots
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{Screen description}
\begin{syntax}
  \metaelement{level-number} \metaelement{entry-name}
  \miscext{
    \pending{
      \begin{0-1}
        \metaelement{control-definition}
        \begin{0-1}
          \metaelement{control-attributes}
        \end{0-1}\ldots
      \end{0-1}
    }
  }
  \begin{0-1}
    \metaelement{appearance-attribute-clauses} \\

    \begin{1=}
      \key{AUTO} \\
      \miscext{\key{AUTO-SKIP}} \\
      \miscext{\key{AUTOTERMINATE}} \\
    \end{1=} \\

    \metaelement{column-clause} \\
    \miscext{\pending{\metaelement{ccol-clause}}} \\
    \miscext{\pending{\metaelement{cline-clause}}} \\
    \miscext{\pending{\metaelement{csize-clause}}} \\

    \key{ERASE}
    \begin{1=}
      \key{EOL} \\
      \key{EOS} \\

      \begin{0-1}
        \miscext{TO} \key{END} OF
      \end{0-1}
      \begin{1=}
        \key{LINE} \\
        \key{SCREEN}
      \end{1=}
    \end{1=} \\

    \begin{1=}
      \key{FULL} \\
      \miscext{\key{LENGTH-CHECK}} \\
    \end{1=} \\

    IS \key{GLOBAL} \\
    \miscext{\pending{\key{GRID}}} \\

    \miscext{\key{INITIAL}} \\
    \miscext{\pending{\key{LEFTLINE}}} \\
    \metaelement{justified-clause} \\
    \metaelement{line-clause} \\

    \miscext{
      \begin{1=}
        \key{NO-ECHO} \\
        \key{NO} \key{ECHO} \\
        \key{OFF}
      \end{1=}
    } \\

    \metaelement{occurs-clause} \\
    \metaelement{picture-clause} \\

    \begin{1=}
      \key{REQUIRED} \\
      \miscext{\key{EMPTY-CHECK}}
    \end{1=} \\

    \metaelement{source-destination-clauses} \\

    \key{SECURE} \\
    \metaelement{sign-clause} \\
    \miscext{\pending{\metaelement{size-clause}}} \\
    \metaelement{usage-clause} \\
    \metaelement{value-clause}
  \end{0-1}\ldots\ {}.
\end{syntax}

% TO-DO: Move to own section and have separate control definition section.

% where \defnmetaelement{control-definition} is

% \begin{syntax}[\miscextcolour]
%   \begin{1=}
%     \key{ACTIVEX} \\
%     \key{BAR} \\
%     \key{BITMAP} \\
%     \key{CHECK-BOX} \\
%     \key{COMBO-BOX} \\
%     \key{DATE-ENTRY} \\
%     \key{ENTRY-FIELD} \\
%     \key{FRAME} \\
%     \key{LABEL} \\
%     \key{LIST-BOX} \\

%     \key{OBJECT}
%     \begin{1=}
%       \identifier \\
%       \integer
%     \end{1=} \\

%     \key{PUSH-BUTTON} \\
%     \key{RADIO-BUTTON} \\
%     \key{SCROLL-BAR} \\
%     \key{STATUS-BAR} \\
%     \key{TREE-VIEW} \\
%     \key{WEB-BROWSER}
%   \end{1=}
% \end{syntax}

% where \defnmetaelement{control-attributes} is

% \begin{syntax}[\miscextcolour]
%   \begin{1=}
%     \key{STYLE}
%     \begin{0-1}
%       IS \\
%       =
%     \end{0-1}
%     \begin{1=}
%       \identifier \\
%       \integer
%     \end{1=} \\

%     \begin{0-1}
%       \key{NOT}
%     \end{0-1}
%     \metaelement{control-style-name} \\

%     \begin{1=}
%       \key{PROPERTY} \integer \\
%       \metaelement{control-property-name}
%     \end{1=}
%     \begin{0-1}
%       IS \\
%       ARE \\
%       =
%     \end{0-1}
%     \begin{1=}
%       \identifier \\
%       \literal
%     \end{1=}\ldots
%   \end{1=} \ldots \\
% \end{syntax}
%
%where \defnmetaelement{control-style-name} is
% \begin{syntax}[\miscextcolour]
%   \begin{1=}
%     \key{PERMANENT} \\
%     \key{TEMPORARY} \\
%     \key{NOTAB} \\
%     \key{HEIGHT-IN-CELLS} \\
%     \key{WIDTH-IN-CELLS} \\
%     \key{THREEDIMENSIONAL} \\
%     \key{OVERLAP-LEFT} \\
%     \key{OVERLAP-TOP} \\
%     \key{SELF-ACT} \\
%     \key{NOTIFY} \\
%     \key{LEFT} \\
%     \key{RIGHT} \\
%     \key{CENTER} \\
%     \key{NO-KEY-LETTER} \\
%     \key{TRANSPARENT} \\
%     \key{NO-BOX} \\
%     \key{MULTILINE} \\
%     \key{VSCROLL} \\
%     \key{VSCROLL-BAR} \\
%     \key{USE-RETURN} \\
%     \key{USE-TAB} \\
%     \key{UPPER} \\
%     \key{LOWER} \\
%     \key{NO-AUTOSEL} \\
%     \key{READ-ONLY} \\
%     \key{NOTIFY-CHANGE} \\
%     \key{NUMERIC} \\
%     \key{SPINNER} \\
%     \key{AUTO-SPIN} \\
%     \key{DEFAULT-BUTTON} \\
%     \key{ESCAPE-BUTTON} \\
%     \key{OK-BUTTON} \\
%     \key{CANCEL-BUTTON} \\
%     \key{NO-AUTO-DEFAULT} \\
%     \key{BITMAP} \\
%     \key{SQUARE} \\
%     \key{FRAMED} \\
%     \key{UNFRAMED} \\
%     \key{FLAT} \\
%     \key{VTOP} \\
%     \key{LEFT-TEXT} \\
%     \key{UNSORTED} \\
%     \key{NOTIFY-DBLCLICK} \\
%     \key{NOTIFY-SELCHANGE} \\
%     \key{PAGED} \\
%     \key{NO-SEARCH} \\
%     \key{DROP-DOWN} \\
%     \key{STATIC-LIST} \\
%     \key{DROP-LIST} \\
%     \key{RAISED} \\
%     \key{LOWERED} \\
%     \key{ENGRAVED} \\
%     \key{RIMMED} \\
%     \key{HEAVY} \\
%     \key{VERY-HEAVY} \\
%     \key{ALTERNATE} \\
%     \key{FULL-HEIGHT} \\
%     \key{BUTTONS} \\
%     \key{FIXED-WIDTH} \\
%     \key{BOTTOM} \\
%     \key{VERTICAL} \\
%     \key{FLAT-BUTTONS} \\
%     \key{HOT-TRACK} \\
%     \key{NO-DIVIDERS} \\
%     \key{NO-FOCUS} \\
%     \key{DOTTED} \\
%     \key{DASH} \\
%     \key{DOTDASH} \\
%     \key{BOXED} \\
%     \key{HSCROLL} \\
%     \key{COLUMN-HEADINGS} \\
%     \key{ROW-HEADINGS} \\
%     \key{TITLED-HEADINGS} \\
%     \key{CENTERED-HEADINGS} \\
%     \key{ADJUSTABLE-COLUMNS} \\
%     \key{SHOW-LINES} \\
%     \key{LINES-AT-ROOT} \\
%     \key{SHOW-SEL-ALWAYS} \\
%     \key{USE-ALT} \\
%     \key{SHORT-DATE} \\
%     \key{CENTURY-DATE} \\
%     \key{LONG-DATE} \\
%     \key{TIME} \\
%     \key{NO-F4} \\
%     \key{NO-UPDOWN} \\
%     \key{RIGHT-ALIGN} \\
%     \key{SHOW-NONE}
%   \end{1=}
% \end{syntax}

where \defnmetaelement{appearance-attribute-clauses} is

\begin{syntax}
  \begin{0-1}
    \begin{1=}
      \key{BACKGROUND-COLOR} \\
      \miscext{\key{BACKGROUND-COLOUR}}
    \end{1=}
    IS
    \begin{1=}
      \identifier \\
      \integer
    \end{1=}
  \end{0-1}

  \begin{0-1}
    \key{BELL} \\
    \miscext{\key{BEEP}}
  \end{0-1}

  \key{BLANK}
  \begin{1=}
    \key{LINE} \\
    \key{SCREEN}
  \end{1=}

  \begin{1=}
    \key{BLINK} \\
    \miscext{\key{BLINKING}}
  \end{1=}

  \pending{
    WITH
    \begin{1=}
      \key{COLOR} \\
      \key{COLOUR}
    \end{1=}
    IS
    \begin{1=}
      \identifier \\
      \integer
    \end{1=}
  }

  \begin{0-1}
    \begin{1=}
      \key{FOREGROUND-COLOR} \\
      \miscext{\key{FOREGROUND-COLOUR}}
    \end{1=}
    IS
    \begin{1=}
      \identifier \\
      \integer
    \end{1=}
  \end{0-1}

  \begin{0-1}
    \key{HIGHLIGHT} \\
    \miscext{\key{HIGH}} \\
    \miscext{\key{BOLD}} \\
    \key{LOWLIGHT} \\
    \miscext{\key{LOW}}
  \end{0-1}

  \pending{
    \miscext{
      \begin{0-1}
        WITH \key{STANDARD}
      \end{0-1}
    }
  }

  \pending{
    \miscext{
      \begin{0-1}
        WITH \key{BACKGROUND-HIGH}
      \end{0-1}
    }
  }

  \pending{
    \miscext{
      \begin{0-1}
        WITH \key{BACKGROUND-STANDARD}
      \end{0-1}
    }
  }

  \pending{
    \miscext{
      \begin{0-1}
        WITH \key{BACKGROUND-LOW}
      \end{0-1}
    }
  }

  \pending{
    \miscext{
      \begin{0-1}
        \key{OVERLINE}
      \end{0-1}
    }
  }

  \miscext{
    \begin{0-1}
      \key{PROMPT}
      \begin{0-1}
        \key{CHARACTER} IS
        \begin{1=}
          \identifier \\
          \literal
        \end{1=}
      \end{0-1}
    \end{0-1}
  }

  \begin{0-1}
    \key{REVERSE-VIDEO} \\
    \miscext{\key{REVERSED}} \\
    \miscext{\key{REVERSE}}
  \end{0-1}

  \begin{0-1}
    \key{UNDERLINE} \\
    \miscext{\key{UNDERLINED}}
  \end{0-1}
\end{syntax}

where \defnmetaelement{source-destination-clauses} is

\begin{syntax}
  \begin{0-1}
    \key{FROM}
    \begin{1=}
      \identifier \\
      \literal
    \end{1=} \\
  \end{0-1}

  \begin{0-1}
    \key{TO} \identifier
  \end{0-1}

  \begin{0-1}
    \key{USING} \identifier
  \end{0-1}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\section{Record description}
\format{data-description}
\begin{syntax}
  \metaelement{level-number} \metaelement{entry-name}
  \begin{0-1}
    \key{ANY}
    \begin{1=}
      \key{LENGTH} \\
      \gnucobol{\key{NUMERIC}}
    \end{1=} \\

    \metaelement{blank-when-zero-clause} \\

    IS \key{EXTERNAL}
    \begin{0-1}
      \key{AS} \literal
    \end{0-1} \\

    \miscext{IS \key{EXTERNAL-FORM}} \\

    \miscext{
      IS \key{IDENTIFIED} BY
      \begin{1=}
        \identifier \\
        \literal
      \end{1=}
    } \\

    IS \key{GLOBAL} \\

    \metaelement{justified-clause} \\

    \pending{\miscext{
        \key{LIKE} \identifier
        \begin{0-1}
          ( \literal )
        \end{0-1}
    }} \\

    \metaelement{occurs-clause} \\

    \begin{1=}
      \key{PICTURE} \\
      \key{PIC}
    \end{1=}
    IS \metaelement{picture-string-1}
    \begin{0-1}
      \key{LOCALE}
      \begin{0-1}
        IS \metaelement{locale-name-1}
      \end{0-1}
      \key{SIZE} IS \integer
    \end{0-1}\\

    \key{REDEFINES} \identifier \\

    \key{SAME} AS \identifier \\

    \metaelement{sign-clause} \\
    \metaelement{special-names-clause} \\

    IS \key{TYPEDEF}
    \pending{
      \begin{0-1}
        \key{STRONG}
      \end{0-1}
    } \\

    \key{TYPE} TO \metaelement{type-name-1}

    \begin{1=}
      \key{SYNCHRONIZED} \\
      \miscext{\key{SYNCHRONISED}} \\
      \key{SYNC}
    \end{1=}
    \begin{0-1}
      \key{LEFT} \\
      \pending{\key{RIGHT}}
    \end{0-1} \\

    \metaelement{usage-clause} \\

    \metaelement{value-clause}
  \end{0-1}\ldots\ {}.
\end{syntax}

\format{renames}
\begin{syntax}
  66 \identifier \key{RENAMES} \identifier
  \begin{0-1}
    \begin{1=}
      \key{THROUGH} \\
      \key{THRU}
    \end{1=}
    \identifier
  \end{0-1}.
\end{syntax}

\format{condition-name}
\begin{syntax}
  88 \identifier
  \begin{1=}
    \key{VALUE} \\
    \key{VALUES}
  \end{1=}
  \begin{0-1}
    IS \\
    ARE
  \end{0-1}
  \begin{1=}
    \literal
    \begin{0-1}
      \begin{1=}
        \key{THROUGH} \\
        \key{THRU}
      \end{1=}
      \literal
    \end{0-1}
  \end{1=} \ldots

  \begin{0-1}
    WHEN SET TO \key{FALSE} IS \literal
  \end{0-1}.
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\section{Constant definition}

\format{standard}
\begin{syntax}
  \begin{1=}
    1 \\
    01
  \end{1=}
  \identifier \key{CONSTANT}
  \begin{0-1}
    IS \key{GLOBAL}
  \end{0-1}
  \begin{1=}
    AS
    \begin{1=}
      \literal \\
      \begin{1=}
        \key{BYTE-LENGTH} \\
        \key{LENGTH}
      \end{1=}
      OF \identifier
    \end{1=} \\

    \key{FROM} \identifier
  \end{1=}.
\end{syntax}

\format{micro-focus}
\begin{syntax}[\miscextcolour]
  78 \identifier
  \gnucobol{
    \begin{0-1}
      IS \key{GLOBAL}
    \end{0-1}
  }
  \begin{1=}
    \key{VALUE} \\
    \key{VALUES}
  \end{1=}
  \begin{0-1}
    IS \\
    ARE
  \end{0-1}
  \begin{1=}
    \literal \\
    \key{START} OF \identifier \\
    \key{NEXT}
  \end{1=}
  .
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\section{Data division clauses}

\subsection{ANY LENGTH clause}

The ANY LENGTH clause specifies that the length of the data item will be determined at runtime.

\begin{syntax}
  \key{ANY}
  \begin{1=}
    \key{LENGTH} \\
    \gnucobol{\key{NUMERIC}} \\
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{AUTO clause}

The AUTO clause specifies that the screen cursor will immediate move to the next screen item when the current screen item is full.

\begin{syntax}
  \begin{1=}
    \key{AUTO} \\
    \miscext{\key{AUTO-SKIP}} \\
    \miscext{\key{AUTOTERMINATE}} \\
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{BACKGROUND-COLOR clause}

The BACKGROUND-COLOR clause specifies the background-color of the screen item.

\begin{syntax}
  \begin{1=}
    \key{BACKGROUND-COLOR} \\
    \miscext{\key{BACKGROUND-COLOUR}}
  \end{1=}
  IS
  \begin{1=}
    \identifier \\
    \literal
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{BACKGROUND-HIGH clause}

\begin{syntax}[\miscextcolour]
  \pending{\key{BACKGROUND-HIGH}}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{BACKGROUND-LOW clause}

\begin{syntax}[\miscextcolour]
  \pending{\key{BACKGROUND-LOW}}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{BACKGROUND-STANDARD clause}

\begin{syntax}[\miscextcolour]
  \pending{\key{BACKGROUND-STANDARD}}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{BELL clause}

\begin{syntax}
  \begin{1=}
    \key{BELL} \\
    \miscext{\key{BEEP}}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{BLANK clause}

\begin{syntax}
  \key{BLANK}
  \begin{1=}
    \key{LINE} \\
    \key{SCREEN}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{BLANK WHEN ZERO clause}

The BLANK WHEN ZERO clause causes an item to be blanked when a value of zero is stored in it.

\begin{syntax}
  \key{BLANK} WHEN
  \begin{1=}
    \key{ZERO} \\
    \miscext{\key{ZEROES}} \\
    \miscext{\key{ZEROS}}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{BLINK clause}

\begin{syntax}
  \begin{1=}
    \key{BLINK} \\
    \miscext{\key{BLINKING}}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{BLOCK clause}

% TO-DO: CHECK!
The BLOCK clause specifies the size of a physical record, that is, how many logical records should be read in one physical I/O operation.

\begin{syntax}
  \key{BLOCK} CONTAINS \integer
  \begin{0-1}
    \key{TO} \integer
  \end{0-1}
  \begin{0-1}
    \key{CHARACTERS} \\
    \key{RECORDS}
  \end{0-1}\\
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{COLOR clause}

\begin{syntax}[\miscextcolour]
  \pending{
    WITH
    \begin{1=}
      \key{COLOR} \\
      \key{COLOUR}
    \end{1=}
    IS
    \begin{1=}
      \identifier \\
      \literal
    \end{1=}
  }
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{COLUMN clause}

The COLUMN clause specifies what column an item should be printed or displayed at.

\format{report-section}
\begin{syntax}
  \begin{1=}
    \key{COLUMN} \\
    \key{COLUMNS} \\
    \key{COL} \\
    \key{COLS}
  \end{1=}
  \begin{0-1}
    NUMBER \\
    NUMBERS
  \end{0-1}
  \begin{0-1}
    \key{LEFT} \\
    \key{RIGHT} \\
    \key{CENTER}
  \end{0-1}
  \begin{0-1}
    IS \\
    ARE
  \end{0-1}
  \begin{1=}
    \begin{0-1}
      \key{PLUS}
    \end{0-1}
    \integer \\

    \begin{1=}
      \integer
    \end{1=} \ldots
  \end{1=}
\end{syntax}

\format{screen-section}
\begin{syntax}
  \begin{1=}
    \key{COLUMN} \\
    \key{COL} \\
    \miscext{\key{POSITION}} \\
    \miscext{\key{POS}} \\
  \end{1=}
  NUMBER IS
  \begin{0-1}
    + \\
    - \\
    \key{PLUS} \\
    \key{MINUS}
  \end{0-1}
  \begin{1=}
    \identifier \\
    \integer
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{CCOL clause}

\begin{syntax}[\miscextcolour]
  \pending{
    \key{CCOL} NUMBER IS
    \begin{0-1}
      + \\
      - \\
      \key{PLUS} \\
      \key{MINUS}
    \end{0-1}
    \begin{1=}
      \identifier \\
      \integer
    \end{1=}
  }
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{CLINE clause}

\begin{syntax}[\miscextcolour]
  \pending{
    \key{CLINE} NUMBER IS
    \begin{0-1}
      + \\
      - \\
      \key{PLUS} \\
      \key{MINUS}
    \end{0-1}
    \begin{1=}
      \identifier \\
      \integer
    \end{1=}
  }
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{CSIZE clause}

\begin{syntax}[\miscextcolour]
  \pending{
    \key{CSIZE}
    \begin{0-1}
      IS \\
      =
    \end{0-1}
    \begin{1=}
      \identifier \\
      \integer
    \end{1=}
  }
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{DATA RECORDS clause}

\begin{syntax}[\deletedcolour]
  \key{DATA}
  \begin{1=}
    \key{RECORD} IS \\
    \key{RECORDS} ARE
  \end{1=}
  \begin{1=}
    \identifier
  \end{1=}\ldots
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{DESTINATION clause}

\begin{syntax}[\deletedcolour]
  \pending{\key{DESTINATION} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{DESTINATION COUNT clause}

\begin{syntax}[\deletedcolour]
  \pending{\key{DESTINATION} \key{COUNT} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{DESTINATION TABLE OCCURS clause}

\begin{syntax}[\deletedcolour]
  \pending{
    \key{DESTINATION} \key{TABLE} \key{OCCURS} \integer TIMES
    \begin{0-1}
      \key{INDEXED} BY
      \begin{1=}
        \cobolindexname
      \end{1=}\ldots
    \end{0-1}
  }
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{END KEY clause}

\begin{syntax}[\deletedcolour]
  \pending{\key{END} \key{KEY} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{Entry name}

The entry name specifies the name of the item being declared.

\begin{syntax}
  \begin{0-1}
    \key{FILLER} \\
    \identifier
  \end{0-1}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}


\subsection{ERASE clause}

The ERASE clause indicates part of the screen to be blanked before displaying the item.

\begin{syntax}
  \key{ERASE}
  \begin{1=}
    \key{EOL} \\
    \key{EOS} \\

    \begin{0-1}
      \miscext{TO} \key{END} OF
    \end{0-1}
    \begin{1=}
      \key{LINE} \\
      \key{SCREEN}
    \end{1=}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{ERROR KEY clause}

\begin{syntax}[\deletedcolour]
  \pending{\key{ERROR} \key{KEY} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{EXTERNAL clause}

\begin{syntax}
  IS \key{EXTERNAL}
  \begin{0-1}
    \key{AS} \literal
  \end{0-1}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{EXTERNAL-FORM clause}

\begin{syntax}[\miscextcolour]
  \begin{1+}
    IS \key{EXTERNAL-FORM} \\

    IS \key{IDENTIFIED} BY
    \begin{1=}
      \identifier \\
      \literal
    \end{1=}
  \end{1+}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{FOREGROUND-COLOR clause}

\begin{syntax}
  \begin{1=}
    \key{FOREGROUND-COLOR} \\
    \miscext{\key{FOREGROUND-COLOUR}}
  \end{1=}
  IS
  \begin{1=}
    \identifier \\
    \literal
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{FROM clause}

\begin{syntax}
  \key{FROM}
  \begin{1=}
    \identifier \\
    \literal
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{FULL clause}

% TO-DO: Check! Is it until the screen can be exited successfully?
The FULL clause specifies that the item must be filled entirely before the cursor can move to another item.

\begin{syntax}
  \begin{1=}
    \key{FULL} \\
    \miscext{\key{LENGTH-CHECK}} \\
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{GLOBAL clause}

The GLOBAL clause specifies that an item may be accessed from within nested programs.

\begin{syntax}
  IS \key{GLOBAL}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{GRID clause}

\begin{syntax}[\miscextcolour]
  \pending{\key{GRID}}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{HIGHLIGHT clause}

\begin{syntax}
  \begin{1=}
    \key{HIGHLIGHT} \\
    \miscext{\key{HIGH}} \\
    \miscext{\key{BOLD}}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{INITIAL clause}

\begin{syntax}
  \key{INIITAL}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{JUSTIFIED clause}

The JUSTIFIED clause causes data smaller than the data item to be padded by spaces on the left to fill the item.

\begin{syntax}
  \begin{1=}
    \key{JUSTIFIED} \\
    \key{JUST}
  \end{1=}
  RIGHT
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{LABEL RECORDS clause}

\begin{syntax}[\deletedcolour]
  \key{LABEL}
  \begin{1=}
    \key{RECORD} IS \\
    \key{RECORDS} ARE
  \end{1=}
  \begin{1=}
    \key{STANDARD} \\
    \key{OMITTED}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{LEFTLINE clause}

\begin{syntax}[\miscextcolour]
  \pending{\key{LEFTLINE}}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{Level-number}

A 1- or 2-digit integer having a value that is either between 1 and 49 or is 66, 77, \miscext{78} or 88.

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{LIKE clause}

\begin{syntax}[\miscextcolour]
  \pending{
    \key{LIKE} \identifier
    \begin{0-1}
      ( \literal )
    \end{0-1}
  }
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{LINAGE clause}

% TO-DO: Define logical page.
The LINAGE clause specifies the page limits of a logical page.

\begin{syntax}
  \key{LINAGE} IS
  \begin{1=}
    \identifier \\
    \literal
  \end{1=}
  LINES
  \begin{0-1}
    \begin{1=}
      \key{BOTTOM} \\
      \key{TOP} \\
      WITH \key{FOOTING} AT
    \end{1=}
    \begin{1=}
      \identifier \\
      \literal
    \end{1=} \\
  \end{0-1}
  \ldots \\
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{LINE clause}

The LINE clause specifies the line an item should be printer or displayed on.

\format{report section}
\begin{syntax}
  \begin{1=}
    \key{LINE}
    \begin{0-1}
      NUMBER \\
      NUMBERS
    \end{0-1}
    \begin{0-1}
      \key{IS} \\
      \gnucobol{\key{ARE}}
    \end{0-1}\\

    \key{LINES} ARE
  \end{1=}
  \begin{1=}
    \begin{0-1}
      + \\
      \key{PLUS}
    \end{0-1}
    \integer \\
    ON \key{NEXT} \key{PAGE}
  \end{1=}\ldots
\end{syntax}

\format{screen item}
\begin{syntax}
  \key{LINE} NUMBER IS
  \begin{0-1}
    + \\
    - \\
    \key{MINUS} \\
    \key{PLUS}
  \end{0-1}
  \begin{1=}
    \identifier \\
    \integer
  \end{1=}
\end{syntax}

\format{screen control}
\begin{syntax}[\miscextcolour]
  \pending{
    \key{LINES}
    \begin{0-1}
      IS \\
      =
    \end{0-1}
    \begin{1=}
      \identifier \\
      \integer
    \end{1=}
    \begin{0-1}
      \key{CELL} \\
      \key{PIXEL}
    \end{0-1}
  }
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{LOWLIGHT clause}

\begin{syntax}
  \begin{1=}
    \key{LOWLIGHT} \\
    \miscext{\key{LOW}}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{MESSAGE COUNT clause}

\begin{syntax}[\deletedcolour]
  \pending{\key{MESSAGE} \key{COUNT} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{MESSAGE DATE clause}

\begin{syntax}[\deletedcolour]
  \pending{\key{MESSAGE} \key{DATE} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{MESSAGE TIME clause}

\begin{syntax}[\deletedcolour]
  \pending{\key{MESSAGE} \key{TIME} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{NEXT GROUP clause}

The NEXT GROUP clause specifies the number of blank lines that should follow the end of a report group.

\begin{syntax}
  \key{NEXT} \key{GROUP} IS
  \begin{1=}
    \begin{0-1}
      + \\
      \key{PLUS}
    \end{0-1}
    \integer \\
    ON \key{NEXT} \key{PAGE}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{NO ECHO clause}

\begin{syntax}[\miscextcolour]
  \begin{1=}
    \key{NO} \key{ECHO} \\
    \key{NO-ECHO} \\
    \key{OFF}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{OCCURS clause}

% TO-DO: Define tables and subscripts.
The OCCURS clause describes tables, repeated data items accessible by subscripts.

\format{usual}
\begin{syntax}
  \key{OCCURS}

  \begin{1=}
    \integer
    \begin{0-1}
      \key{TO} \integer
    \end{0-1}
    TIMES
    \begin{0-1}
      \key{DEPENDING} ON \identifier
    \end{0-1} \\

    \pending{
      \key{DYNAMIC}
      \begin{0-1}
        \key{CAPACITY} IN \identifier
      \end{0-1}
      \begin{0-1}
        \key{FROM} \integer
      \end{0-1}
      \begin{0-1}
        \key{TO} \integer
      \end{0-1}
      \begin{0-1}
        \key{INITIALIZED}
      \end{0-1}
    }
  \end{1=}

  \begin{0+} % TO-DO: This 0+ is a GnuCOBOL extension
    \begin{1=}
      \begin{1=}
        \key{ASCENDING} \\
        \key{DESCENDING}
      \end{1=}
      KEY IS
      \begin{1=}
        \identifier
      \end{1=}\ldots
    \end{1=}\ldots \\

    \key{INDEXED} BY
    \begin{1=}
      \cobolindexname
    \end{1=}\ldots
  \end{0+}
\end{syntax}

\format{report section}
\begin{syntax}
  \key{OCCURS} \integer
  \begin{0-1}
    \key{TO} \integer
  \end{0-1}
  TIMES
  \begin{0-1}
    \key{DEPENDING} ON \identifier
  \end{0-1}
  \begin{0-1}
    \key{STEP} \integer
  \end{0-1}
\end{syntax}

\format{screen section}
\begin{syntax}
  \key{OCCURS} \integer TIMES
\end{syntax}

\format{unbounded}
\begin{syntax}[\miscextcolour]
  \key{OCCURS}
  \begin{0-1}
    \integer \key{TO}
  \end{0-1}
  \key{UNBOUNDED} TIMES \key{DEPENDING} ON \identifier

  \begin{0+}
    \begin{1=}
      \begin{1=}
        \key{ASCENDING} \\
        \key{DESCENDING}
      \end{1=}
      KEY IS
      \begin{1=}
        \identifier
      \end{1=}\ldots
    \end{1=}\ldots \\

    \key{INDEXED} BY
    \begin{1=}
      \cobolindexname
    \end{1=}\ldots
  \end{0+}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{OVERLINE clause}

\begin{syntax}[\miscextcolour]
  \pending{\key{OVERLINE}}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{PICTURE clause}

The PICTURE clause describes the general characteristics and editing requirements of an elementary data item.

\begin{syntax}
  \begin{1=}
    \key{PICTURE} \\
    \key{PIC}
  \end{1=}
  IS \metaelement{picture-string-1}
  \begin{0-1}
    \key{LOCALE}
    \begin{0-1}
      IS \metaelement{locale-name-1}
    \end{0-1}
    \key{SIZE} IS \integer
  \end{0-1}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{PRESENT WHEN clause}

The PRESENT WHEN clause specifies a condition under which a report section entry will be processed.

\begin{syntax}
  \begin{1=}
    \key{PRESENT} \\
    \miscext{\key{ABSENT}}
  \end{1=}
  \begin{1=}
    \key{WHEN} \condition \\

    \miscext{
      \begin{1=}
        \key{BEFORE} \\
        \key{AFTER}
      \end{1=}
      NEW
      \begin{0-1}
        \key{PAGE} \\
        \identifier \\
        OR
      \end{0-1} \ldots
    } \\

    \miscext{
      \begin{1=}
        \key{JUSTIFIED} \\
        \key{JUST}
      \end{1=}
      \begin{1=}
        \key{BEFORE} \\
        \key{AFTER}
      \end{1=}
      NEW \key{PAGE}
    }
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{PROMPT clause}

\begin{syntax}[\miscextcolour]
  \key{PROMPT}
  \begin{0-1}
    \key{CHARACTER} IS
    \begin{1=}
      \identifier \\
      \literal
    \end{1=}
  \end{0-1}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{RECORD clause}

The RECORD clause specifies the number of bytes of a logical record.

\begin{syntax}
  \key{RECORD}
  \begin{1=}
    CONTAINS \integer
    \begin{0-1}
      \key{TO} \integer
    \end{0-1}
    CHARACTERS \\
    IS \key{VARYING} in size
    \begin{0-1}
      FROM \integer
    \end{0-1}
    \begin{0-1}
      \key{TO} \integer
    \end{0-1}
    CHARACTERS \\\qquad
    \key{DEPENDING} ON \identifier
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{RECORDING MODE clause}

\begin{syntax}[\deletedcolour]
  \key{RECORDING} MODE IS
  \begin{1=}
    \begin{1=}
      \key{F} \\
      \key{FIXED} \\
    \end{1=} \\

    \begin{1=}
      \key{V} \\
      \key{VARIABLE} \\
    \end{1=} \\

    \key{U} \\
    \key{S}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{REDEFINES clause}

The REDEFINES clause indicates the data shares the same memory as an item with a different description.

\begin{syntax}
  \key{REDEFINES} \identifier
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{REPORT clause}

\begin{syntax}
  \pending{
    \begin{1=}
      \key{REPORT} IS \\
      \key{REPORTS} ARE
    \end{1=}
    \begin{1=}
      \identifier
    \end{1=}\ldots
  }
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{REQUIRED clause}

\begin{syntax}
  \begin{1=}
    \key{REQUIRED} \\
    \miscext{\key{EMPTY-CHECK}}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{REVERSE-VIDEO clause}

\begin{syntax}
  \begin{1=}
    \key{REVERSE-VIDEO} \\
    \miscext{\key{REVERSED}} \\
    \miscext{\key{REVERSE}}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SAME AS clause}

\begin{syntax}
  \key{SAME} AS \identifier
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SECURE clause}

\begin{syntax}
  \key{SECURE}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{STATUS KEY clause}

\begin{syntax}[\deletedcolour]
  \pending{\key{STATUS} \key{KEY} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SIGN clause}

The SIGN clause defines how to store item's sign.

\begin{syntax}
  SIGN IS
  \begin{1=}
    \key{LEADING} \\
    \key{TRAILING}
  \end{1=}
  \begin{0-1}
    \key{SEPARATE} CHARACTER
  \end{0-1}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SIZE clause}

\begin{syntax}[\miscextcolour]
  \pending{
    \key{SIZE}
    \begin{0-1}
      IS \\
      =
    \end{0-1}
    \begin{1=}
      \identifier \\
      \integer
    \end{1=}
  }
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SOURCE clause}

The SOURCE clause identifies data to be used in processing a report section entry.

\begin{syntax}
  \key{SOURCE} IS \metaelement{number-1}
  \begin{0-1}
    \metaelement{rounded-phrase}
  \end{0-1}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SPECIAL-NAMES clause}

\begin{syntax}[\miscextcolour]
  IS \key{SPECIAL-NAMES}
  \begin{1=}
    \key{CURSOR} \\
    \pending{\key{SCREEN} \key{CONTROL}} \\
    \pending{\key{EVENT} \key{STATUS}} \\
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{STANDARD clause}

\begin{syntax}[\miscextcolour]
  WITH \key{STANDARD}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SUM clause}

The SUM clause provides a list of data items to be summed for use in an elementary report item.

\begin{syntax}
  \key{SUM} OF
  \begin{1=}
    \metaelement{number-1}
  \end{1=}\ldots
  \begin{0-1}
    \begin{1=}
      \key{RESET} ON
      \begin{1=}
        \identifier \\
        \key{FINAL}
      \end{1=} \\

      \key{UPON} \identifier
  \end{1=}
  \end{0-1}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SYMBOLIC DESTINATION clause}

\begin{syntax}[\deletedcolour]
  \pending{\key{SYMBOLIC} \key{DESTINATION} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SYMBOLIC QUEUE clause}

\begin{syntax}[\deletedcolour]
  \pending{SYMBOLIC \key{QUEUE} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SYMBOLIC SOURCE clause}

\begin{syntax}[\deletedcolour]
  \pending{SYMBOLIC \key{SOURCE} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SYMBOLIC SUB-QUEUE-1 clause}

\begin{syntax}[\deletedcolour]
  \pending{SYMBOLIC \key{SUB-QUEUE-1} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SYMBOLIC SUB-QUEUE-2 clause}

\begin{syntax}[\deletedcolour]
  \pending{SYMBOLIC \key{SUB-QUEUE-2} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SYMBOLIC SUB-QUEUE-3 clause}

\begin{syntax}[\deletedcolour]
  \pending{SYMBOLIC \key{SUB-QUEUE-3} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SYMBOLIC TERMINAL clause}

\begin{syntax}[\deletedcolour]
  \pending{\key{SYMBOLIC} \key{TERMINAL} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{SYNCHRONIZED clause}

% TO-DO: Check "should".
The SYNCHRONIZED clause specifies an item should be aligned in a byte boundary and in what way.

\begin{syntax}
  \begin{1=}
    \key{SYNCHRONIZED} \\
    \miscext{\key{SYNCHRONISED}} \\
    \key{SYNC}
  \end{1=}
  \begin{0-1}
    \pending{\key{LEFT}} \\
    \pending{\key{RIGHT}}
  \end{0-1}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{TEXT LENGTH clause}

\begin{syntax}[\deletedcolour]
  \pending{\key{TEXT} \key{LENGTH} IS \identifier}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{TO clause}

\begin{syntax}
  \key{TO} \identifier
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{TYPE clause}

The TYPE clause for a data description entry specifies that the data is given by a type declaration.

The TYPE clause for a report group specifies when the group is printed.

\format{type-name}
\begin{syntax}
  \key{TYPE} TO \metaelement{type-name-1}
\end{syntax}

\format{report-group}
\begin{syntax}
  \key{TYPE} IS
  \begin{1=}
    \begin{1=}
      \key{CONTROL} \key{HEADING} \\
      \key{CH}
    \end{1=}
    \begin{0-1}
      ON \\
      FOR
    \end{0-1}
    \begin{1=}
      \identifier \\
      \key{FINAL}
    \end{1=}
    \begin{0-1}
      \key{OR} \key{PAGE}
    \end{0-1} \\

    \begin{1=}
      \key{CONTROL} \key{FOOTING} \\
      \key{CF}
    \end{1=}
    \begin{0-1}
      ON \\
      FOR
    \end{0-1}
    \begin{0-1}
      \begin{1=}
        \identifier \\
        \key{FINAL}
      \end{1=}
      \begin{0-1}
        \key{OR} \key{PAGE}
      \end{0-1} \\

      \key{ALL}
    \end{0-1} \\

    \begin{1=}
      \key{DETAIL} \\
      \key{DE}
    \end{1=} \\

    \begin{1=}
      \key{PAGE} \key{FOOTING} \\
      \key{PF}
    \end{1=} \\

    \begin{1=}
      \key{PAGE} \key{HEADING} \\
      \key{PH}
    \end{1=} \\

    \begin{1=}
      \key{REPORT} \key{FOOTING} \\
      \key{RF}
    \end{1=} \\

    \begin{1=}
      \key{REPORT} \key{HEADING} \\
      \key{RH}
    \end{1=}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsubsection{TYPEDEF clause}

\begin{syntax}
  IS \key{TYPEDEF}
  \pending{
    \begin{0-1}
      \key{STRONG}
    \end{0-1}
  }
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{UNDERLINE clause}

The UNDERLINE clause specifies that each character of a field is to be displayed with an underline.

\begin{syntax}
  \begin{1=}
    \key{UNDERLINE} \\
    \miscext{\key{UNDERLINED}}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{USAGE clause}

The USAGE clause specifies the representation of a data item in memory.

\begin{syntax}
  \begin{0-1}
    \key{USAGE} IS
  \end{0-1}
  \begin{1=}
    \key{BINARY} \\
    \key{BIT} \\

    \defdmetaelement{fixed-length-integers} \\
    \defdmetaelement{computational-usages} \\

    \key{DISPLAY} \\

    \pending{\key{FLOAT-BINARY-32}} \\
    \pending{\key{FLOAT-BINARY-64}} \\
    \pending{\key{FLOAT-BINARY-128}} \\
    \key{FLOAT-DECIMAL-16} \\
    \key{FLOAT-DECIMAL-34} \\
    \key{FLOAT-LONG} \\
    \key{FLOAT-SHORT} \\

    \key{INDEX} \\

    \pending{\key{NATIONAL}} \\

    \key{PACKED} \key{DECIMAL} \\
    \miscext{\key{POINTER}} \\
    \key{PROGRAM-POINTER} \\

    \miscext{\defdmetaelement{handle-usages}} \\

    \miscext{\metaelement{type-name-1}}
  \end{1=}
\end{syntax}

where \defnmetaelement{fixed-length-integers} is

\begin{syntax}
  \begin{1=}
    \begin{1=}
      \key{BINARY-CHAR} \\
      \key{BINARY-SHORT} \\

      \begin{1=}
        \key{BINARY-LONG} \\
        \gnucobol{\key{BINARY-INT}}
      \end{1=} \\

      \gnucobol{\key{BINARY-C-LONG}} \\

      \begin{1=}
        \key{BINARY-DOUBLE} \\
        \gnucobol{\key{BINARY-LONG-LONG}} \\
      \end{1=} \\
    \end{1=}
    \begin{0-1}
      \key{SIGNED} \\
      \key{UNSIGNED}
    \end{0-1} \\

    \miscext{\key{SIGNED-SHORT}} \\
    \miscext{\key{SIGNED-INT}} \\
    \miscext{\key{SIGNED-LONG}} \\

    \miscext{\key{UNSIGNED-SHORT}} \\
    \miscext{\key{UNSIGNED-INT}} \\
    \miscext{\key{UNSIGNED-LONG}}
  \end{1=}
\end{syntax}

where \defnmetaelement{computation-usages} is

\begin{syntax}
  \begin{1=}
    \begin{1=}
      \key{COMP} \\
      \key{COMPUTATIONAL}
    \end{1=} \\

    \miscext{
      \begin{1=}
        \key{COMP-0} \\
        \key{COMPUTATIONAL-0}
      \end{1=}
    } \\

    \miscext{
      \begin{1=}
        \key{COMP-1} \\
        \key{COMPUTATIONAL-1}
      \end{1=}
    } \\

    \miscext{
      \begin{1=}
        \key{COMP-2} \\
        \key{COMPUTATIONAL-2}
      \end{1=}
    } \\

    \xopen{
      \begin{1=}
        \key{COMP-3} \\
        \key{COMPUTATIONAL-3}
      \end{1=}
    } \\

    \miscext{
      \begin{1=}
        \key{COMP-4} \\
        \key{COMPUTATIONAL-4}
      \end{1=}
    } \\

    \xopen{
      \begin{1=}
        \key{COMP-5} \\
        \key{COMPUTATIONAL-5}
      \end{1=}
    } \\

    \miscext{
      \begin{1=}
        \key{COMP-6} \\
        \key{COMPUTATIONAL-6}
      \end{1=}
    } \\

    \miscext{
      \begin{1=}
        \key{COMP-N} \\
        \key{COMPUTATIONAL-N}
      \end{1=}
    } \\

    \miscext{
      \begin{1=}
        \key{COMP-X} \\
        \key{COMPUTATIONAL-X}
      \end{1=}
    } \\
  \end{1=}
\end{syntax}

where \defnmetaelement{handle-usages} is

\begin{syntax}[\miscextcolour]
  \begin{1=}
    \key{HANDLE}
    \begin{0-1}
      OF
      \begin{1=}
        \pending{
          \key{FONT}
          \begin{0-1}
            \key{DEFAULT-FONT} \\
            \key{FIXED-FONT} \\
            \key{TRADITIONAL-FONT} \\
            \key{SMALL-FONT} \\
            \key{MEDIUM-FONT} \\
            \key{LARGE-FONT}
          \end{0-1}
        } \\

        \pending{
          \key{LAYOUT-MANAGER}
          \begin{0-1}
            \key{LM-RESIZE}
          \end{0-1}
        } \\

        \pending{\key{MENU}} \\
        \key{SUBWINDOW} \\
        \key{THREAD} \\
        \key{VARIANT} \\
        \key{WINDOW}
      \end{1=}
    \end{0-1}
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{USING clause}

\begin{syntax}
  \key{USING} \identifier
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{VALUE clause}

The VALUE clause specifies the initial value of the local-storage and working-storage section data items and the values to be used in INITALIZE statements.

The VALUE clause for condition-names specifies the values under which a condition-name is true (or false).

\format{initialization}
\begin{syntax}
  \begin{1=}
    \key{VALUE} \\
    \gnucobol{\key{VALUES}}
  \end{1=}
  \begin{0-1}
    IS \\
    \gnucobol{ARE}
  \end{0-1}
  \literal
\end{syntax}

\format{condition}
\begin{syntax}
  \begin{1=}
    \key{VALUE} \\
    \gnucobol{\key{VALUES}}
  \end{1=}
  \begin{0-1}
    IS \\
    \gnucobol{ARE}
  \end{0-1}
  \begin{1=}
    \literal
    \begin{0-1}
      \begin{1=}
        \key{THROUGH} \\
        \key{THRU}
      \end{1=}
      \literal
    \end{0-1}
  \end{1=} \ldots

  \begin{0-1}
    WHEN SET TO \key{FALSE} IS \literal
  \end{0-1}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{VALUE OF clause}

\begin{syntax}[\deletedcolour]
  \begin{1=}
    \key{VALUE} \\
    \gnucobol{\key{VALUES}}
  \end{1=}
  \key{OF}
  \begin{1=}
    \key{FILE-ID} \\
    \key{ID} \\
    \identifier
  \end{1=}
  IS
  \begin{1=}
    \literal \\
    \identifier
  \end{1=}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{VARYING clause}

The VARYING clause declares counters to be used in printing repeated items in the report writer.

\begin{syntax}
  \pending{
    \key{VARYING} \identifier \key{FROM} \metaelement{number-1} \key{BY} \metaelement{number-2}
  }
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

\subsection{VOLATILE clause}

The VOLATILE clause indicates an item may change in ways outside the control of the program.

\begin{syntax}[\miscextcolour]
  \pending{\key{VOLATILE}}
\end{syntax}

\subsubsection{Syntax rules}

\subsubsection{General rules}

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