EDT

#### Search Results

Search

# EDT

This command is mainly intended to input Natural code lines into the source area, when running in a Batch environment without an input terminal. If the Natural session executes Online, we recommend that you use the `EDIT` command instead of the `EDT` command.

`EDT` [object-name [library-id]]

This command invokes the Natural line editor and causes edit mode to be entered. Edit mode may be used to edit an existing Natural object (program, copycode, subroutine, subprogram, helproutine). Once edit mode has been entered, you may position to any line and make changes, using the subcommands and PF keys listed below.

Use `.E` to terminate `EDT` mode.

This document covers the following topics:

- EDT Syntax Explanation

- EDT Subcommands

- EDT Function Keys

## EDT Syntax Explanation

`object-name` | As object-name, you enter the name of the object to be edited (maximum 8 characters). If object-name is entered, Natural will load the object into the source work area and set the object name for a subsequent `SAVE`, `CATALOG`, or `STOW` command. If you enter the `EDT` command without an object name and there is no object in the source work area, you will be prompted with line 0010 to enter an object. If you do not specify an object name and there is an object in the source work area, the first lines of that object will be displayed.
`library-id` | If the object to be edited is contained in a library other than the one to which you are currently logged on, you have to specify the ID of the library in which the object is contained. The setting for library-id must not begin with "SYS" (except `SYSTEM`). Entering a library ID is not permitted if Natural Security is active.

## EDT Subcommands

The following subcommands may be used during line editing:

Command | Function
--- | ---
`.B` | Position to bottom.
`.Cnnnn(m)` | Copy the line identified by nnnn. m indicates the number of lines to be copied.
`.C'text'(m)` | Copies the line that starts with text. m indicates the number of lines to be copied.
`.D` | Delete line.
`.D(n)` | Delete n lines.
`.E` | Exit from line editor.
`.I` | Insert line.
`.I(program)` | Insert program.
`.Mnnnn` | Move the line identified by n.
`.M'text'(m)` | Move the line that starts with text. m indicates the number of lines to be moved.
`.R` | Renumber.
`.S'text'` | Scan for text.
`.T` | Position to top.
`.nnnn` | Position to line nnnn.
`.+n` | Position n lines forwards.
`.-n` | Position n lines backwards.

## EDT Function Keys

To use PF keys during line editing, you must define the PF keys using the `KEY` profile parameter. You cannot assign EDT subcommands to a PF or PA key.

### On this page

- EDT Syntax Explanation
- EDT Subcommands
- EDT Function Keys