Version 4.2.6 for Mainframes (Update)
 —  System Commands  —

EDIT

This command is used to invoke a Natural editor for the purpose of editing the source form of a Natural programming object.

Three different forms of command syntax exist. These are documented in the following sections.

Related command: READ.

See also Object Naming Conventions in the Using Natural documentation.


Syntax 1

EDIT [object-type] [object-name [library-id]]

object-type

The following object types can be edited:

CLASS

4
COPYCODE
GLOBAL
HELPROUTINE
LOCAL
MAP
PARAMETER
PROGRAM

SUBPROGRAM

N
SUBROUTINE
TEXT

Which editor is invoked depends on the type of object to be edited:

Note:
The text object "description" is available on mainframes only. A description is a program description as stored and maintained in the Predict Data Dictionary; an object of this type can only be edited if Predict is installed.

The object types are described in the Programming Guide. The editors are described in the Editors documentation.

If you specify the name of the object you wish to edit, you need not specify its object type.

object-name

With the EDIT command, you specify the name of the object you wish to edit. The maximum length of the object name is 8 characters.

Natural will then load the object into the edit work area of the appropriate editor and set the object name for a subsequent SAVE, CATALOG, STOW command.

If you do not specify an object-name and there is no object in the source work area, the empty program editor screen will be invoked where you can create a program. If the source work area is not empty, the object will be loaded in the appropriate editor.

Note:
For EDIT DESCRIPTION, the object-name must be the name as defined as a Natural member in the Predict program definition.

library-id

If the object you wish to edit is not contained in the library you are currently logged on to, you must specify the library-id of the library in which the object to be edited is contained.

Note:
The setting for library-id must not begin with "SYS" (except SYSTEM).

If Natural Security is active, a library-id must not be specified, which means that you can only edit objects which are in your current library.

Top of page

Syntax 2

EDIT

*

*

object-type object-name

If you do not remember the name of the object you wish to edit, you can use this form of the EDIT command to display a list of objects, and then select from the list the desired object.

EDIT * displays a list of all objects in your current library.
EDIT object-type * displays a list of all objects of that type in your current library.

To select an object from a certain range of objects, you can use asterisk notation and wildcard notation for the object-name in the same manner as described for the system command LIST.

Top of page

Syntax 3

EDIT FUNCTION subroutine-name

The EDIT FUNCTION command may be used to edit a subroutine using the subroutine name (not the object name) with maximally 32 characters.

Example:

DEFINE SUBROUTINE CHECK-PARAMETERS
  ...
END-SUBROUTINE
END

Assuming that the above subroutine has been saved under the object name CHCKSUB, you may edit subroutine CHECK-PARAMETERS either by issuing the command:

EDIT S CHKSUB

or by

EDIT F CHECK-PARAMETERS

Top of page