z/OS ISPF Edit and Edit Macros
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


AUTONUM—Number Lines Automatically

z/OS ISPF Edit and Edit Macros
SC19-3621-00

The AUTONUM primary command sets autonum mode, which controls the automatic renumbering of data when it is saved.

Syntax

Read syntax diagramSkip visual syntax diagram
            .-ON--.   
>>-AUTONUM--+-----+--------------------------------------------><
            '-OFF-'   

ON
Turns on automatic renumbering. When number mode is also on, the data is automatically renumbered when it is saved.
OFF
Turns off automatic renumbering. Data is not renumbered.

Description

When number mode is on (see (xref refid="number"), the first line of a data set or member is normally line number 000100, the second number is 000200, and so forth. However, as lines are inserted and deleted, the increment between line numbers can change.

For example, you might think that when a line is inserted between 000100 and 000200, line 000200 would be given the number 000300 and the new line would become 000200. Instead, the existing lines retain their numbers and the new line is given line number 000110.

Therefore, if the original line number increments are important to you, the AUTONUM command renumbers your lines automatically so that the original increments are maintained.

Autonum mode is saved in the edit profile. To check the current settings of number mode and autonum mode:

  1. On the command line, type:
    PROFILE 3
  2. Press Enter. The first line of the edit profile shows the number mode setting and the third line shows the autonum mode setting.

To turn on autonum mode:

  1. On the command line, type:
    AUTONUM ON
  2. Press Enter.

To turn off autonum mode:

  1. On the command line, type:
    AUTONUM OFF
  2. Press Enter.

Examples

This example shows a practical application of AUTONUM command usage. You have been editing a data set with number mode on.
Note: If you are editing a data set or member with number mode off and then decide to turn number mode on, make sure that columns 1 through 6 of your data set are blank. Otherwise, the sequence numbers created by the NUMBER command can overlay any of your data in columns 1 through 6. Use either the COLUMN SHIFT or DATA SHIFT line command to indent the data.

You now want to end the edit session. However, since you had to insert and delete many lines, your line numbering is no longer uniform. Therefore, you decide to use autonum mode so that the next time you edit this data set the line numbers will be correct.

  1. First, check the edit profile to see whether autonum mode is already on by entering the PROFILE 3 command to display the first 3 lines of the edit profile.
    PROFILE 3
  2. You can see from the edit profile that autonum mode is off:
     =PROF> ....PLI (VARIABLE - 72)....RECOVERY ON....NUMBER OFF....................
     =PROF> ....CAPS OFF....HEX OFF....NULLS OFF....TABS OFF........................
     =PROF> ....AUTOSAVE ON....AUTONUM OFF....AUTOLIST OFF....STATS ON..............
  3. Enter the AUTONUM ON command to turn on autonum mode:
    AUTONUM ON
    The edit profile changes accordingly:
     =PROF> ....PLI (VARIABLE - 72)....RECOVERY ON....NUMBER OFF....................
     =PROF> ....CAPS OFF....HEX OFF....NULLS OFF....TABS OFF........................
     =PROF> ....AUTOSAVE ON....AUTONUM ON....AUTOLIST ON....STATS ON................
  4. After editing the data set, save your changes by entering the END command. The changes will be saved because, as you can see in the preceding partial edit profile, autosave mode is on.
    END
    ISPF saves the data set that you were editing, along with any changes. The next time you edit the data set, the line numbers will have the proper increments.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014