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

SET

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

3-92. SET COMMAND

3-93. Purpose.

The SET command alters default conditions normally established by EDIT/3000.

3-94. Form.

The form of the SET command is

   S[ET] [{BATCH

           POLL}] [,DELTA = increment] [,DEPTH = limit] [, {FIXED

                  VARIABLE}]
   [, FORMAT = {COBOL

                DEFAULT}] [,FROM = linenumber] [, {FRONT

                                                           REAR} ]
   [,LEFT = colnum] [,LENGTH = colnum] [, {QUIET

                                          DISPLAY}] [,LINES = maxlines]
   [,RIGHT = colnum] [, {SHORT

                         LONG}] [,SIZE = integer] [,TIME[S] = limit]
   [{,TABS [=(colnum [,colnum]...)]

     ,NOTABS}] [,TABCHAR[=string] ]

For example,

    SET BATCH, SHORT, QUIET

3-95. Description.

The default parameters for the SET command are underlined in the example. Before using a SET command, enter a VERIFY ALL command to display the conditions in effect.

The SET command can be entered on as many lines as necessary (end each line to be continued with an ampersand (&;) or you may repeat the SET portion of the SET command at the start of the next line). Separate the parameters in a SET command with commas.

The SET command parameters are explained in the following paragraphs, in alphabetical order.

  • SET BATCH/POLL. SET BATCH and SET POLL relate to where EDIT/3000 expects to find commands, text records, and where output will be sent. SET POLL is the default condition and means that EDIT/3000 expects to find commands and text records in the INPUT file. To operate in an interactive session in full batch mode (with text records following command records) in the USE file, SET BATCH is declared. SET POLL can be set to return to interactive mode and read text from the INPUT file.

  • SET DELTA = increment. SET DELTA defines the interval between lines in the WORK file. The default increment is 1 or 0.1, depending on the SET FORMAT option in effect. If SET FORMAT = DEFAULT (the default condition), the increment is 1; if SET FORMAT = COBOL, the increment is 0.1. The SET DELTA value establishes line number increments which are used in the ADD, GATHER, and JOIN commands, and (when the UNNUMBERED parameter is used) in TEXT commands. The SET DELTA value in effect can be overridden with the BY increment parameter of GATHER, INSERT, and JOIN commands.

  • SET DEPTH = limit. SET DEPTH defines the maximum nesting of USE commands (how many times a USE command can call itself or another USE command); and the number of BEGIN-END pairs allowed in a WHILE block. The default limit is 10.

  • SET FIXED/VARIABLE. SET FIXED and SET VARIABLE specify whether the WORK file contents are saved with a KEEP command into a file with fixed-length or variable-length records. The default condition is FIXED.

  • SET FORMAT = COBOL/DEFAULT. SET FORMAT = COBOL and SET FORMAT = DEFAULT are used to inform EDIT/3000 whether EDIT/3000 operation is related to a COBOL source program or not. The default condition is DEFAULT.

    SET FORMAT = COBOL informs EDIT/3000 that the current WORK file contents, when kept, must be acceptable to a COBOL compiler. The chosen SET FORMAT option also determines certain other SET command default conditions as shown in Table 3-1 “Default EDIT/3000 Operating Conditions”.

    Table 3-1 Default EDIT/3000 Operating Conditions

    SET COMMAND OPTIONSET FORMAT = DEFAULTSET FORMAT = COBOL
    FROM =11
    DELTA =10.1
    LEFT =11
    RIGHT =7274
    LENGTH =7274
    LINES =6060
    QUIET/DISPLAYDISPLAYDISPLAY
    SHORT/LONGLONGLONG
    BATCH/POLLPOLLPOLL
    DEPTH =1010
    TIMES =5050
    SIZE =00
    FRONT/REARREARFRONT
    FIXED/VARIABLEFIXEDFIXED
    TABS/NOTABSNOTABSNOTABS
    TABCHAR =CONTROL 1 ('9)CONTROL 1 ('9)

     

    In addition, when SET FORMAT = DEFAULT, the smallest increment allowed for line number intervals is .001. The maximum line number count allowed is 99999.999. This restricts sequence numbers derived from line numbers with the KEEP command to eight bytes, with a range from 00000001 through 99999999. If SET FORMAT = COBOL, the smallest increment allowed for line number intervals is .001 and the maximum line number count allowed is 999.999. This restricts sequence numbers derived from line numbers with the KEEP command to six bytes, with a range from 000001 to 999999.

  • SET FROM = linenumber. SET FROM = linenumber specifies the starting line number for text entered into the WORK file with an ADD command, or for text copied by the GATHER, JOIN, or TEXT filename, UNNUMBERED commands. The default is 1 (new text will start at line 1 in the WORK file).

  • SET FRONT/REAR. SET FRONT and SET REAR request EDIT/3000 to form sequence numbers from the front bytes (SET FRONT) of each record or from the rear bytes (SET REAR) of each record. The default condition depends on the SET FORMAT option in effect. If SET FORMAT = DEFAULT, the last eight bytes of each record are used. If SET FORMAT = COBOL, the first six bytes of each record are used.

  • SET LEFT = colnum. This parameter specifies the left margin for text records in the WORK file. The default condition is 1 and text will start in column number 1 of each record. SET LEFT must be less than or equal to SET RIGHT and SET LENGTH.

  • SET LENGTH = colnum. This parameter specifies the maximum length (record size) of all records in the WORK file and may not exceed 255 bytes. The default length depends on the SET FORMAT option in effect. If SET FORMAT = DEFAULT, length = 72; if SET FORMAT = COBOL, length = 74. SET LENGTH must never be less than SET RIGHT.

  • Some EDIT/3000 commands can increase the length of a line in the WORK file up to 50 percent larger than the length in effect (a warning message will be displayed but the command will execute). If a command attempts to increase the length of a line by more than 50 percent, however, an error message is displayed and the command terminates. In batch mode, EDIT/3000 operation also is terminated.

  • SET LINES = maxlines. This parameter specifies the number of lines that will be printed on each page of an offline listing. The default is 60 lines. A minimum of 10 and maximum of 9999 lines can be specified; the number includes 3 lines for the page title.

  • SET QUIET/DISPLAY. DISPLAY is the default condition (EDIT/3000 will display line numbers for lines to be added, and so forth). SET QUIET is equivalent to using the Q option for EDIT/3000 commands (except KEEP).

  • SET RIGHT = colnum. This parameter specifies the right margin for text records in the WORK file. The default is 72 if the SET FORMAT = DEFAULT parameter has been declared and 74 if the SET FORMAT = COBOL parameter has been declared. Colnum must be greater than or equal to that set with a SET LEFT command and may not exceed the length established for records. SET RIGHT must never exceed SET LENGTH.

  • SET SHORT/LONG. SET SHORT and SET LONG determine the length of EDIT/3000 messages. SET LONG is the default condition. SET SHORT cancels SET LONG and causes messages to be shortened. For example,

       /END
    
       IF IT IS OK TO CLEAR RESPOND "YES"
    
       CLEAR? YES
    
    
    
        END OF SUBSYSTEM
    
    
    
       /SET SHORT;END
    
       CLEAR? YES
    
    
    
        END OF SUBSYSTEM
    

    SET SHORT also is used to inhibit display of commands in a WHILE block.

  • SET SIZE = integer. SET SIZE establishes the actual size of the WORK file, in lines. The default is 0, when EDIT/3000 begins operation. With the default condition in effect, EDlT/3000 sets the size of the WORK file according to the source of text records, as follows:

    If the source device is a terminal, a card reader, or a magnetic tape unit, EDIT/3000 sets the size to allow up to 2000 records (unless the SET SIZE command has set the size to some other value in lines). If the source device is a disc file, EDIT/3000 sets the size as shown below:

    TEXT DISC FILE SIZE (DFS)ACTUAL SIZE OF WORK FILE
    (RECORDS)(RECORDS)
    up to 10002000
    1000 to 4000DFS + 50%
    greater than 4000DFS + 2000

    Note that for every 8 lines of text, EDIT/3000 uses one record for its own purpose. A numbered file also contains a directory at the end of the file. Because of this, approximately 88% of the records can be used for text lines. For example, if you do not SET SIZE explicitly before texting in a file with less than 1000 records, EDIT/3000 allows up to 2000 records in your WORK file, which means that approximately 1,767 (88% of 2000) lines of text are allowed.

    Size should be set explicitly whenever possible, especially if less than 2000 records (approximately 1,767 lines of text) is sufficient space in the WORK file.

  • SET TABCHAR = string. SET TABCHAR defines a tab character to be used when entering text beginning at a specific tab stop. The default tab character if none is specified is Control I. The length of string may not be greater than one character. A decimal value may be specified for string if the digits are preceded by an apostrophe. The decimal value for Control I is '9 (the ASCII Horizontal Tab character).

    When entering a line of text with the ADD or REPLACE command, the tab character is used to tab to the next column defined as a tab stop. To position at the second tab stop two tab characters are entered. For example, if the tab character is defined as follows:

          /SET TABCHAR = "!"
    

    and a line of text is to begin at the second tab stop, the addition looks like this:

        /ADD
    
            1       !!45.85
    
            2
    

    When the text is moved into the work file, the tab characters are replaced with a sufficient number of blanks to position up to the second tab stop and the number 45.85 is moved into the next five columns.

NOTE: Tab characters are recognized only in the ADD and REPLACE commands.
  • SET TABS=(colnum,...)/NOTABS. SET TABS=defines up to 12 tab stops to allow text to be entered beginning at a specified column. If no SET TABS command is used, the default condition is SET NOTABS. If SET TABS is used but no column numbers are specified, the default column numbers are:

  • (4,7,10,13,16,19,22,25,28,31,65,71) if FORMAT=DEFAULT is set,

  • (6,10,14,18,22,26,30,34,38,46,54,67) if FORMAT=COBOL is set.

    Each colnum parameter must be larger than the preceding colnum parameter and must lie between the LEFT and RIGHT limits.

    When using the TAB key (provided on some terminals) in conjunction with the Editor SET TABS feature, the following considerations apply:

  • It is the user's responsibility to make sure that the tab stops set on the terminal correspond to the tab stop column numbers specified with the Editor SET TABS command. The column positions depend upon the command that is to be used. The ADD and REPLACE commands print ten characters on the terminal before the first column of the line. The ADDQ command accepts the first column of the line beginning with the first cursor position.

  • When the TAB key is pressed, the Editor enters one tab character (Control I or a decimal 9) in the current line. The terminal positions the cursor to the next tab stop set on the terminal. When the line is moved into the WORK file, the Editor converts the tab character to the appropriate number of blanks to position the information at the proper columns. It is important to remember this when using the backspace (Control H). In this case, the terminal moves the cursor back one position but the Editor backspaces one character in the current line. If that character happens to be a tab character, the effect of backspacing is to return to the column position preceding the tab. For example, suppose a terminal tab stop is set at position 10 and the following commands are entered.

       /SET TABS = (10)
    
       /ADDQ
    
       145Ic       Hc
    
                  ^
    
                  |
    
        Cursor position
    
    NOTE: Ic indicates the tab key has been pressed and Hc indicates Control H or backspace entered.

    The terminal moves the cursor one character position to the left when the backspace character is entered. However, the Editor considers the cursor position to be the 4th column since it backspaced over the tab character.

         145Ic         Current line according to Editor
    
  • The tab stops may be set on the terminal either manually, or programmatically with an Editor USE file specified by the user. The code for TAB SET is Escape 1 (1e). The following USE file (named TABFIL) sets tabs in columns 10 and 20 of lines to be entered with the ADD command:

             SET TABS (10,20);
    
              Q "            1e    1e ";  (1e indicates Escape 1)
    

    To execute the USE file, enter the USE command and the file name. For example:

              /USE TABFIL
    

    Before setting new tabs, existing tabs should be reset with one of the following:

    • Escape 2 (or CLEAR TABS)

    • Escape 3 (or CONTROL CLEAR TABS (all) for HP 2645)

    • RESET TERMINAL key

  • SET TIME = limit. SET TIME defines the maximum number of times an EDIT/3000 WHILE block will execute. The default is 50 iterations.

3-96. Limitations.

Parameters of the SET command may be included in any order (separated by commas), however, some parameters are dependent on others and this must be considered. For example,

The value used in a SET LEFT command may not exceed the value used in a SET RIGHT command or any tab setting.

The value used in a SET RIGHT command may not exceed the value used in a SET LENGTH command or less than any tab setting.

After a WORK file has been created (with TEXT or ADD), the value of LENGTH must be less than the WORK file record size. However, before a WORK file is created, the maximum value used in SET LENGTH may be 255.

Such SET command pairs as SET SHORT, SET LONG, and SET QUIET, SET DISPLAY are, of course, mutually exclusive. (The last occurrence of such a pair is in effect.)

Commands that can extend existing lines (such as MODIFY, INSERT, and CHANGE) shift characters to the right of the RIGHT margin, although only that text within the left and right margins is actually altered. REPLACE is an exception to this; characters are not shifted to the right of the RIGHT margin. The REPLACE command displays only that text within the margins and only replaces that part of the line. The replacement string is padded :with blanks if it is shorter. A warning message is displayed if the string is longer than the LEFT/RIGHT range.

3-97. Examples.

Examples are provided for several SET command options.

  • SET DELTA

SET DELTA defines the interval between lines in the WORK file. In the following example, the interval is 1 (the default condition if SET FORMAT = DEFAULT) and lines entered with the ADD command are numbered 1, 2, and 3. After the SET DELTA = .001 command is entered, lines entered are numbered 1,1.001, and 1.002.

   /VERIFY DELTA

   DELTA =   1

   /ADD

       1       LlNE 1

       2       LINE 2

       3       LINE 3

       4       //

   ...

   /D ALL

   CLEAR?  Y

   /SET DELTA=.001

   /ADD

       1       LINE 1

       1.001   LINE 2

       1.002   LINE 3

       1.003  //

   ...
  • SET FROM

SET FROM determines the starting line number for text entered into an empty WORK file.

In the example, lines start at 1 and 101, depending on the SET FROM = linenumber option in effect.

   /VERIFY FROM

   FROM =     1

   /ADD

      1       LINE 1

      2       LINE 2

      3       //

   ...

   /D ALL

   IF IT IS OK TO CLEAR RESPOND "YES"

   CLEAR?  Y

   /SET FROM=101

   /ADD

      101     LINE 1

      102     LINE 2

      103     //

   ...
  • SET QUIET AND SET DISPLAY

The SET QUIET command is equivalent to using the Q parameter for EDIT/3000 commands (except KEEP).

In the example, after SET QUIET is entered, EDIT/3000 does not prompt with line numbers when the ADD command is executed.

When the LIST command executes, line numbers are not displayed.

Using the SET DISPLAY command sets QUIET to FALSE.

   /VERIFY QUIET

   DISPLAY = TRUE (I.E. QUIET = FALSE)

   /ADD

      1    LINE 1

      2    LINE 2

      3    //

   ...

   /SET QUIET

   /ADD

   LINE 3

   LINE 4

   //

   ...

   /LIST ALL

   LINE 1

   LINE 2

   LINE 3

   LINE 4



   /SET DISPLAY

   /LIST ALL

       1    LINE 1

       2    LINE 2

       3    LINE 3

       4    LINE 4
  • SET TABCHAR AND SET TABS

These commands define a tab character and tab stops to allow text to be entered beginning at specific columns. In the example, the tab character is defined as a percent sign (%), and tab stops are set at columns 5 and 30. When line 1 is added, two percent signs are entered to tab over to the second tab stop (column 30). Then the data is entered. Line 3 begins at the first tab stop. When the text is listed, it appears in the correct columns. This is the way the information has been stored in the work file.

   /SET TABCHAR = "%", TABS = TARS = (5,30)

   /VERIFY TABS,TABCHAR

   TABS = ( 5, 30)

   TAB CHARACTER = "%"

   /ADD

      1   JANUARY 16, 1977

      2   DEAR MR. JONES:

      3   WE ARE PLEASED TO ADVISE YOU THAT YOU HAVE WON

      4   A NEW POCKET CALCULATOR. YOU WILL RECEIVE IT IN

      5   ...

   /L 1/4

      1                           JANUARY 16, 1977

      2   DEAR MR. JONES:

      3       WE ARE PLEASED TO ADVISE YOU THAT YOU HAVE WON

      4   A NEW POCKET CALCULATOR. YOU WILL RECEIVE IT IN
Feedback to webmaster