****************************************
      * Program name: move.cbl
      * This program provides several examples
      * of how to use the MOVE command.
      *
      * Copyright 2000 Deskware, Inc.
      ****************************************                                                             
       1 var1                      PIC X(04).
       1 var2                      PIC X(04).
       1 start_pos                 PIC 9(04).
       1 length_var                    PIC 9(04).
       1 gldi.
          5  gldi_1                PIC X(01).
          5  gldi_2                PIC X(01).
          5  gldi_3                PIC X(01).
          5  gldi_4                PIC X(01).
          5  gldi_5                PIC X(01).
          5  gldi_6                PIC X(01).

       DISPLAY `This program demonstrates the use of the `.
       DISPLAY `MOVE command. `.
       DISPLAY ``.

       DISPLAY `var1: <` & var1 & `>`.
       DISPLAY `var2: <` & var2 & `>`.
       DISPLAY `gldi: <` & gldi & `>`.
       DISPLAY ``.

       MOVE 2 TO length_var.
       DISPLAY length_var.
       DISPLAY var1.
       MOVE `AB`    TO var1(2:length_var).

       MOVE 1 TO start_pos.
       MOVE 4 TO length_var.
       MOVE var1(start_pos:length_var)   TO var2.
       DISPLAY `var1: <` & var1 & `>`.
       DISPLAY `var2: <` & var2 & `>`.
       DISPLAY ``.

       MOVE 1         TO gldi_1.
       MOVE 2         TO gldi_2.
       MOVE 3         TO gldi_3.
       MOVE 4         TO gldi_4.

       MOVE gldi   TO var1.
       DISPLAY `var1: <` & var1 & `>`.
       DISPLAY `gldi: <` & gldi & `>`.

       DISPLAY ``.
       DISPLAY `gldi_1: <` & gldi_1 & `>`.
       DISPLAY `var1: <`   & var1   & `>`.
       DISPLAY `var2: <`   & var2   & `>`.
       DISPLAY ``.

       MOVE gldi_1 TO  var1.
       DISPLAY `gldi_1: <` & gldi_1 & `>`.
       DISPLAY `var1: <`   & var1   & `>`.