VMS Help  —  COBOL  PROCEDURE_DIVISION, ACCEPT
  The ACCEPT statement makes low-volume data available to the program.
  The HP extensions to the ACCEPT statement (formats 3, 4 and 5) are
  COBOL language additions that facilitate video forms design and data
  handling.

1  –  1format FROM input

  The ACCEPT statement makes low-volume data available to the program.
  The HP extensions to the ACCEPT statement (formats 3, 4 and 5) are
  COBOL language additions that facilitate video forms design and data
  handling.

  Format 1 -

   ACCEPT dest-item [FROM input-source]

      [ AT END stment ] [ NOT AT END stment ]

      [ END-ACCEPT ]

1.1  –  dest-item

  is the identifier of a data item into which data is accepted.

1.2  –  input-source

  is a mnemonic-name defined in the SPECIAL-NAMES paragraph of the
  Environment Division.

1.3  –  stment

  is an imperative statement executed for an AT END or NOT AT END
  condition.

2  –  2format FROM

  The ACCEPT statement makes low-volume data available to the program.
  The HP extensions to the ACCEPT statement (formats 3, 4 and 5) are
  COBOL language additions that facilitate video forms design and data
  handling.

  Format 2 -

                         { DATE [YYYYMMDD] }
   ACCEPT dest-item FROM { DAY  [YYYYDDD]  }
                         { DAY-OF-WEEK     }
                         { TIME            }

2.1  –  dest-item

  is the identifier of a data item into which data is accepted.

3  –  3format_screen_extensions

  The ACCEPT statement makes low-volume data available to the program.
  The HP extensions to the ACCEPT statement (formats 3, 4 and 5) are
  COBOL language additions that facilitate video forms design and data
  handling.

  Format 3 -

   ACCEPT dest-item

      {|                  { line-num                      }      |}
      {| FROM LINE NUMBER { line-id [ PLUS [ plus-num ] ] }      |}
      {|                  { PLUS [ plus-num ]             }      |}
      {|                    { column-num                       } |}
      {| FROM COLUMN NUMBER { column-id [ PLUS [ plus-num ] ]  } |}
      {|                    { PLUS [ plus-num ]                } |}
      {| ERASE [TO END OF] { SCREEN }                            |}
      {|                   { LINE   }                            |}
      {| WITH BELL                                               |}
      {| UNDERLINED                                              |}
      {| BOLD                                                    |}
      {| WITH BLINKING                                           |}
      {| PROTECTED [| SIZE { prot-size-lit  }   |]               |}
      {|           [|      { prot-size-item }   |]               |}
      {|           [| WITH AUTOTERMINATE        |]               |}
      {|           [| WITH EDITING              |]               |}
      {|           [| WITH NO BLANK             |]               |}
      {|           [| WITH FILLER prot-fill-lit |]               |}
      {| WITH CONVERSION                                         |}
      {| REVERSED                                                |}
      {| WITH NO ECHO                                            |}
      {| DEFAULT IS { def-src-lit   }                            |}
      {|            { def-src-item  }                            |}
      {|            { CURRENT VALUE }                            |}
      {| CONTROL KEY IN key-dest-item                            |}

      { [ ON EXCEPTION stment ] [ NOT ON EXCEPTION stment  ] }
      { [ AT END stment ] [ NOT AT END stment  ]             }

      [ END-ACCEPT ]

3.1  –  dest-item

  is the identifier of a data item into which data is accepted.

3.2  –  line-num

  is a numeric literal that specifies a line position on the terminal
  screen.  Line-num must be a positive integer.  It cannot be zero.

3.3  –  line-id

  is the identifier of a data item that provides a line position on the
  terminal screen.

3.4  –  column-num

  is a numeric literal that specifies a column position on the terminal
  screen.  Column-num must be a positive integer.  It cannot be zero.

3.5  –  column-id

  is the identifier of a data item that provides a column position on
  the terminal screen.

3.6  –  plus-num

  is a numeric literal that increments the current value for line or
  column position, or that increments the value of line-id or
  column-id.  Plus-num can be zero or a positive integer.

3.7  –  prot-size-lit

  is a numeric literal that specifies the maximum length of the video
  screen field into which data can be typed.  Prot-size-lit must be a
  positive integer.  It cannot be zero.

3.8  –  prot-size-item

  is the identifier of a numeric integer data item that specifies
  the maximum length of the video screen field into which data can
  be typed.  It must be a positive integer; it cannot be zero.

3.9  –  prot-fill-lit

  is a single character alphanumeric literal that is used to initialize
  each character position of a protected video screen field into which
  data can be typed.

3.10  –  def-src-lit

  is a nonnumeric literal or a figurative constant.  However, it cannot
  be the figurative constant ALL literal.

3.11  –  def-src-item

  is the identifier of an alphanumeric data item.

3.12  –  key-dest-item

  is the identifier of a data item that defines a control key.
  Key-dest-item must specify an alphanumeric data item at least four
  characters in length.

3.13  –  stment

  is an imperative statement executed for an AT END, NOT AT END,
  ON EXCEPTION or NOT ON EXCEPTION condition.

4  –  4format screen extensions CONTROL KEY

  The ACCEPT statement makes low-volume data available to the program.
  The HP extensions to the ACCEPT statement (formats 3, 4 and 5) are
  COBOL language additions that facilitate video forms design and data
  handling.

  Format 4 -

   ACCEPT CONTROL KEY IN key-dest-item

      {|                  { line-num                      }      |}
      {| FROM LINE NUMBER { line-id [ PLUS [ plus-num ] ] }      |}
      {|                  { PLUS [ plus-num ]             }      |}
      {|                    { column-num                       } |}
      {| FROM COLUMN NUMBER { column-id [ PLUS [ plus-num ] ]  } |}
      {|                    { PLUS [ plus-num ]                } |}
      {| ERASE [TO END OF] { SCREEN }                            |}
      {|                   { LINE   }                            |}
      {| WITH BELL                                               |}

      { [ ON EXCEPTION stment ] [ NOT ON EXCEPTION stment  ] }
      { [ AT END stment ] [ NOT AT END stment  ]             }

      [ END-ACCEPT ]

4.1  –  line-num

  is a numeric literal that specifies a line position on the terminal
  screen.  Line-num must be a positive integer.  It cannot be zero.

4.2  –  line-id

  is the identifier of a data item that provides a line position on the
  terminal screen.

4.3  –  column-num

  is a numeric literal that specifies a column position on the terminal
  screen.  Column-num must be a positive integer.  It cannot be zero.

4.4  –  column-id

  is the identifier of a data item that provides a column position on
  the terminal screen.

4.5  –  plus-num

  is a numeric literal that increments the current value for line or
  column position, or that increments the value of line-id or
  column-id.  Plus-num can be zero or a positive integer.

4.6  –  key-dest-item

  is the identifier of a data item that defines a control key.
  Key-dest-item must specify an alphanumeric data item at least four
  characters in length.

4.7  –  stment

  is an imperative statement executed for an AT END, NOT AT END,
  ON EXCEPTION or NOT ON EXCEPTION condition.

5  –  5format_screen_section_extensions

  The ACCEPT statement makes low-volume data available to the program.
  The HP extensions to the ACCEPT statement (formats 3, 4 and 5) are
  COBOL language additions that facilitate video forms design and data
  handling.

  Format 5 -

   ACCEPT screen-name

      [    {| LINE NUMBER { line-num }     |} ]
      [    {|             { line-id  }     |} ]
      [ AT {|                              |} ]
      [    {| COLUMN NUMBER { column-num } |} ]
      [    {|               { column-id  } |} ]

      [ ON EXCEPTION stment ]

      [ NOT ON EXCEPTION stment2 ]

      [ END-ACCEPT ]

5.1  –  screen-name

  is the name of a screen item defined in the SCREEN SECTION of the
  program.

5.2  –  line-num

  is a numeric literal that specifies a line position on the terminal
  screen.  Line-num must be a positive integer.  It cannot be zero.

5.3  –  line-id

  is the identifier of a data item that provides a line position on
  the  terminal screen.

5.4  –  column-num

  is a numeric literal that specifies a column position on the
  terminal screen.  Column-num must be a positive integer.  It cannot
  be zero.

5.5  –  column-id

  is the identifier of a data item that provides a column position on
  the terminal screen.

5.6  –  stment

  is an imperative statement executed for an AT END, NOT AT END,
  ON EXCEPTION or NOT ON EXCEPTION condition.
Close Help