HPlogo EDIT/3000 Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 EDIT/3000 COMMANDS

GATHER

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

3-38. GATHER COMMAND

3-39. Purpose.

The GATHER command removes text from one location to another in the WORKfile.

3-40. Form.

The form of the GATHER command is

   G[ATHER][Q] {range

                ALL[{TO

        , } {linenumber} {TO

                                                     , } linenumber] } [{BY

                                            , } increment]


For example,

   GATHER 55/89 TO 8.01 BY .01

            ^       ^       ^

            |       |       |

          range linenumber increment
NOTE: Use the SETSIZE command (see paragraph 3-92) to set the SIZE to a large value if extensive gathering is to be done.

3-41. Description.

When the range parameter is specified in a GATHER command, the linenumber parameter must be specified also, as for example,

     GATHER 80/100 TO 230.1

or

    GATHER 80/100,230.1 (a comma may be used instead of TO)

EDIT/3000 will move lines 80 through 100 to 230.1, incrementing each line by the SET DELTA = increment in effect (the default is 1 if SET FORMAT = DEFAULT and 0.1 if SET FORMAT = COBOL), and deleting lines 80 through 100 from their original locations. The SET DELTA = increment in effect could have been overridden by using the increment parameter in the GATHER command (see paragraph 3-92 for a discussion of the SET command).

EDIT/3000 will adjust the increment in effect until the minimum increment of .001 is reached in order to fit the lines to be moved into the space available between existing lines. If lines to be moved will not fit into the available space, the operation will halt, an error message will be displayed, and no text will be moved.

When text to be moved would overlap existing lines, line numbers must be changed before the GATHER command is used. One method of accomplishing this is with a HOLD command as follows:

    HOLD 10/15 (Hold 6 lines of text)



    DELETE 10/15 (Delete the 6 lines)



    GATHER 100/1500 TO 10 (Add 1401 lines between lines 10 and 15)



    FIND *



    ADD linenumber,HOLD,NOW (Add the 6 lines held 

                                 in the HOLD file to the end of the 1401 

                                 lines which were moved.

                                 linenumber = last line + increment 

                                 in effect)

To override the SET DELTA = increment in effect, the BY increment parameter is used in the GATHER command.

To renumber all lines in the WORK file, the GATHER ALL command is used. New line numbers are assigned, starting with the SET FROM = linenumber in effect (default = 1). Each line is incremented by the SET DELTA = increment in effect (default = 1 if SET FORMAT = DEFAULT and 0.1 if SET FORMAT = COBOL). The new line numbers are not displayed.

In an interactive session, a GATHER command (except GATHER ALL) can be terminated before it is complete by typing CONTROL Y.

3-42. Limitations.

EDIT/3000 will reject a GATHER command and print an error message if:

  1. A TO linenumber (or ,linenumber) parameter is not provided. Exception: when a GATHER ALL command is used, this parameter is optional.

  2. A linenumber specified in the TO portion of a GATHER command already exists in the WORK file.

  3. The SET DELTA = increment in effect cannot be adjusted by EDIT/3000 to allow as many line numbers as there are lines to be moved.

  4. A BY increment (or ,increment) parameter is specified that does not allow as many line numbers as there are lines to be moved.

3-43. Examples.

Several variations of the GATHER command are shown in the following examples. The location of the pointer is illustrated at the conclusion of each GATHER command.

  • GATHER range TO linenumber BY increment

The following example uses the command GATHER 8/11 to 2.1 BY .01 to move lines 8 through 11 to 2.1, 2.11, 2.12, and 2.13. The pointer is located at the first position of the last line moved (2.13). Lines 8 through 11 are deleted.

   /LIST ALL

        1      1-2.  WHAT IS EDIT/3000?

        2

        3      EDIT/3000 IS A SUBSYSTEM OF THE HP 3000

        4      MULTIPROGRAMMING EXECUTIVE OPERATING SYSTEM

        5      (MPE/3000) THAT IS USED TO CREATE AND

        6      MANIPULATE ASCII FILES.

        7

        8      CHARACTERS, STRINGS OF CHARACTERS, OR ENTIRE

        9      LINES OF CHARACTERS CAN BE INSERTED, DELETED,

       10      REPLACED, MODIFIED, SEARCHED FOR, AND OTHERWISE

       11      MANIPULATED BY USING EDIT/3000 COMMANDS.

   /GATHER 8/11 TO 2.1 BY .01

        8      =>    2.1

        9      =>    2.11

       10      =>    2.12

       11      =>    2.13

   /FIND*

        2.13 MANUIPULATED BY USING EDIT/3000 COMMANDS.

   /LIST ALL

        1      1-2.  WHAT IS EDIT/3000?

        2

        2.1    CHARACTERS, STRINGS OF CHARACTERS, OR ENTIRE

        2.11   LINES OF CHARACTERS CAN BE INSERTED, DELETED,

        2.12   REPLACED, MODIFIED, SEARCHED FOR, AND OTHERWISE

        2.13   MANIPULATED BY USING EDIT/3000 COMMANDS.

        3      EDIT/3000 IS A SUBSYSTEM OF THE HP 3000

        4      MULTIPROGRAMMING EXECUTIVE OPERATING SYSTEM

        5      (MPE/3000) THAT IS USED TO CREATE AND

        6      MANIPULATE ASCII FILES.

        7
  • GATHERQ range TO linenumber

The next example moves lines 2.1, 2.11, 2.12, and 2.13 from their present positions to a location starting at line 7.1 and the GATHER ALL command renumbers all lines to integer-type numbers. The WORK file is now in the same condition as it was before the GATHER commands were used.

   /GATHERQ 2.1/2.13 TO 7.1

   /FIND*

       7.4     MANIPULATED BY USING EDIT/3000 COMMANDS

               ^ (1 )



   /LIST ALL

       1      1-2.  WHAT IS EDIT/3000?

       2

       3      EDIT/3000 IS A SUBSYSTEM OF THE HP 3000

       4      MULTIPROGRAMMING EXECUTIVE OPERATING SYSTEM

       5      (MPE/3000) THAT IS USED TO CREATE AND

       6      MANIPULATE ASCII FILES.

       7

       7.1    CHARACTERS, STRINGS OF CHARACTERS, OR ENTIRE

       7.2    LINES OF CHARACTERS CAN BE INSERTED, DELETED,

       7.3    REPLACED, MODIFIED, SEARCHED FOR, AND OTHERWIS

       7.4    MANIPULATED BY USING EDIT/3000 COMMANDS.

   /GATHER ALL;LIST ALL

       1      1-2.  WHAT IS EDIT/3000?

       2

       3      EDIT/3000 IS A SUBSYSTEM OF THE HP 3000

       4      MULTIPROGRAMMING EXECUTIVE OPERATING SYSTEM

       5      (MPE/3000) THAT IS USED TO CREATE AND

       6      MANIPULATE ASCII FILES.

       7

       8      CHARACTERS, STRINGS OF CHARACTERS, OR ENTIRE

       9      LINES OF CHARACTERS CAN BE INSERTED, DELETED,

      10      REPLACED, MODIFIED, SEARCHED FOR, AND OTHERWISE

      11      MANIPULATED BY USING EDIT/3000 COMMANDS.
Feedback to webmaster