****************************************
      * Program name: execute.cbl
      * This program provides several examples
      * of EXECUTE command usage.
      *
      * Copyright 2000 Deskware, Inc.
      ****************************************

      * This first example demonstrates simple
      * EXECUTE usage with a literal and gldi
      * as arguments.
      ******************************************
          1 string_gldi.
           5 filler pic x value accent.
           5 string pic x(n) value `Hello, world.`.
           5 filler pic x value accent.
          execute `DISPLAY ` string_gldi.

      * The example below demonstrates
      * EXECUTE usage with a multiple literal,
      * keyword, and variable arguments.
      ******************************************

          1 string_var pic x(n) value `Hello, `.
          execute `DISPLAY ` accent string_var accent ` & ` accent `world.`
                   accent.

      * The example below demonstrates
      * true dynamic usage of EXECUTE, with
      * a source variable argument to a
      * MOVE statement called by EXECUTE changing
      * dynamically as a loop is incremented.
      ******************************************
          1  move_exec.
            5  `move line_`.
            5  num_position pic 99.
            5  ` to license_line_item`.

          1 line_01 pic x(7) value `line111`.
          1 line_02 pic x(7) value `line222`.
          1 line_03 pic x(7) value `line333`.
          1 line_04 pic x(7) value `line444`.
          1 line_05 pic x(7) value `line555`.

          1 license_line_item pic x(7).

          perform until num_position = 5
              add 1 to num_position
              display `move_exec = ` & accent & move_exec & accent
              execute `move line_` num_position ` to license_line_item`
              display `license_line_item = ` & accent & license_line_item & accent
          end-perform.