Editors - General Information

This section gives an overview of which Natural objects are edited with which Natural editor. In addition, it contains information on split-screen mode and the editor profile.

You invoke a Natural editor with the system command EDIT as described in the System Commands documentation and in Creating and Editing an Object in the Using Natural documentation. For the names to be used when editing or saving an object, see Object Naming Conventions in the Using Natural documentation.

Which editor is invoked depends on the type of object you want to edit:

  • Programs, subprograms, subroutines, helproutines, classes, copycode, text objects and functions are created and edited in the program editor.

  • Global data areas, local data areas and parameter data areas are created and edited in the data area editor.

  • Maps and help maps are created and edited in the map editor.

  • Predict descriptions are edited in the Predict description editor (see the Predict documentation).

An online help system is provided with each editor.

Tutorials which introduce you to the main features of the editors are provided in First Steps and in the Map Editor Tutorial.

In addition to the Natural editors, the Software AG Editor is used by several Natural utilities and other Software AG products. You can also use the Software AG Editor as an alternative to the Natural program editor.

This section covers the following topics:


Split-Screen Mode

You can use all three Natural editors in split-screen mode: you can use one half of the screen for editing an object and at the same time have another Natural object displayed in the other half. Split-screen mode can be used to display a view (DDM; Data Definition Module), a data area, a Predict program description or a Natural program in the lower half of the screen. In addition, you can include items shown in the display section of the screen into the editing section that is, into the object you are currently editing.

Example:

The following figure shows the program editor in split-screen mode with the source code of a program in the editing section (upper half) and a local data area in the display section (lower half):

>                                       > +  Program     SAGDEMO  Lib SAGTEST  
  
   Top    ....+....1....+....2....+....3....+....4....+....5....+....6....+....7.
     0010 DEFINE DATA LOCAL USING L-INVOIC                                        
     0020             LOCAL USING L-INV-LN                                        
     0030 END-DEFINE                                                              
     0040 *                                                                       
     0050 READ INVOICE-VIEW BY INVOICE-NO FROM 1                                  
     0060 *                                                                       
     0070   FIND INVOICE-LINE-VIEW WITH INVOICE-NO = INVOICE-NO (0050)            
     0080     DELETE                                                              
     0090   END-FINE                                                              
     0100 *                                                                       
          ....+....1....+....2....+....3....+....4....+....5....+.. S 16   L 1    
   Split All       Local       L-INVOIC  Library SAGTEST                          
     0010 V 1 INVOICE-VIEW                          INVOICE                       
     0020   2 CUST-NO                         N   8                               
     0030   2 INVOICE-NO                      N   8                               
     0040   2 DATE                            A   8                               
     0050   2 AMOUNT                          N 9.2                               
     0000                                                                         
     0000                                                                         
     0000                                                                         
     0000

Split-Screen Commands

The following commands can be used to display and position an object in split-screen mode when using the program editor or the data area editor. For instructions on displaying objects in split-screen mode with the map editor, see Selecting Data Definitions in the Map Editor documentation.

All commands begin with an S or with SPLIT to indicate split screen mode. The SPLIT command is a cursor-sensitive command as described in the section Program Editor.

In the following table, an underlined text portion represents an acceptable command abbreviation.

Command Function
SPLIT ++ Position to bottom of object.
SPLIT B
SPLIT -- Position to top of object.
SPLIT T
SPLIT + Position one page forwards.
SPLIT +P
SPLIT - Position one page backwards.
SPLIT -P
SPLIT +nnn Position nnn lines forwards.

This function only applies to the program editor.

SPLIT -nnn Position nnn lines backwards.

This function only applies to the program editor.

SPLIT .

or

SPLIT END

Terminate split-screen mode.
SPLIT 7 function-name [library] Display function.

function-name is the name of the function as used in the DEFINE FUNCTION statement (not the object name of the function).

This function only applies to the program editor.

SPLIT CLASS class-name [library] Display class.

class-name is the name of the class as used in the DEFINE CLASS statement (not the object name of the class).

This function only applies to the program editor.

SPLIT DATA name [library] Display data area (global, local, parameter).

In the data area editor, you can use asterisk (*) notation for name to display a list of the specified object range.

SPLIT DESCRIPTION program-name [library] Display the Predict description from the Predict Data Dictionary for the specified program-name.
SPLIT FUNCTION subroutine-name [library] Display subroutine.

subroutine-name is the name of the subroutine as used in the DEFINE SUBROUTINE statement (not the object name of the subroutine).

This function only applies to the program editor.

SPLIT PROGRAM name [library] Display program, subprogram, subroutine, helproutine, copycode, text, map, class, Natural command processor, recording, adapter, dialog, function or resource.

In the data area editor, you can use asterisk (*) notation for name to display a list of the specified object range.

SPLIT SCAN [scan-value] Scan source code.

scan-value is the character string to be found in the current source code.

Each line containing the scan-value is marked with a greater than (>) sign. To further scan for the same scan-value, enter S SC only.

SPLIT VIEW name [SHORT] Display view (DDM, as defined in Predict or SYSDDM).

If SHORT is specified, the DDM is listed in short form (that is, only the Adabas short names and corresponding Natural field names are displayed) without any field header or field edit mask information.

In the data area editor, you can use asterisk (*) notation for name to display a list of the specified object range.

SPLIT Display previous object.

If SPLIT is entered without any parameter, the source of the object previously displayed in the split-screen area is displayed again. This applies for the duration of the current editor session.

This function only applies to the program editor.

name is the name of the object as contained in the Natural library and/or the Natural system file.

A library can be specified with the program editor only. Under Natural Security, a library cannot be specified.

Editor Profile

The Natural program editor and data area editor provide an editor profile, which determines the settings to be in effect during the current program editor or data area session. Editor profile settings are, for example, the standard assignment of PF and PA keys. You can define your own editor profile settings according to your preferences.

This section covers the following topics:

Invoking the Editor Profile

Start of instruction setTo invoke your current editor profile

  • In the command line of the program editor or data area editor, enter the following:

    PROFILE 

    An Editor Profile screen similar to the example below appears:

    11:06:16                 ***** NATURAL EDITORS *****                 2010-11-22
                                 - Editor Profile -                                
                                                                                   
    Profile Name .. SAG_____                                                       
                                                                                   
    PF and PA Keys                                                                 
      PF1 ... HELP___________   PF2 ... _______________   PF3 ... EXIT___________  
      PF4 ... _______________   PF5 ... _______________   PF6 ... _______________  
      PF7 ... -______________   PF8 ... +______________   PF9 ... _______________  
      PF10 .. SC=____________   PF11 .. _______________   PF12 .. CANCEL_________  
      PF13 .. _______________   PF14 .. _______________   PF15 .. MENU___________  
      PF16 .. _______________   PF17 .. _______________   PF18 .. SCAN___________  
      PF19 .. --_____________   PF20 .. ++_____________   PF21 .. _______________  
      PF22 .. _______________   PF23 .. _______________   PF24 .. _______________  
      PA1 ... _______________   PA2 ... SCAN___________   PA3 ... _______________  
                                                                                   
    Automatic Functions                                                            
      Auto Renumber .. Y   Auto Save Numbers .. 0__   Source Save into .. EDITWORK 
                                                                                   
    Additional Options .. N                                                        
    Command ===>                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
          Help        Exit  AddOp Save  Reset                         Del   Canc

    The screen displays your own editor profile if an individual profile exists for your user ID as described for the field Profile Name. If such a profile does not exist, the default profile SYSTEM is displayed instead. The SYSTEM profile is read from the user exit routine USR0070P (see the Operations documentation).

Start of instruction setTo invoke a specific editor profile

  • In the command line of the program editor or data area editor, enter the following:

    PROFILE profile-name

    where profile-name denotes a valid user ID or SYSTEM.

    When you are in an editor session and enter the PROFILE command together with your own user ID as profile name, your profile is always invoked directly from the database; any modifications made during the current editor session, but not yet saved in the database, will not apply. Therefore, to invoke your current editor profile, enter the PROFILE command only.

Caution:
Any changes to the current editor profile are lost when you enter the LOGON system command or open another editor prior to saving the changes to the database.

Editor Profile Screen

This section describes the items contained on the Editor Profile screen.

Item Explanation
Profile Name The name of the editor profile. Your own editor profile is displayed. If such a profile does not exist, you can modify the default profile to suit your own requirements. To do so, overwrite the profile name SYSTEM with your user ID and save the renamed profile to the database.

If you overwrite the name of your profile with any other valid profile name (that is, any other valid user ID) and press ENTER, the profile of the corresponding user is invoked. Only one profile can be established per user ID, and any modifications made to another user's profile are only valid for the current editor session; they cannot be saved to the database.

You can, however, overwrite the profile name of another user's profile with your own user ID and then save the renamed profile in the database.

PF and PA Keys The commands assigned to the PF and PA keys are displayed. Any Natural editor or system command can be assigned. Combinations of commands (separated by a comma) are also possible.
Auto Renumber Y indicates that the source code in the program editor is to be renumbered automatically if any of the following occurs:
  • A CATALOG, CHECK, RUN, SAVE or STOW command is issued.

  • A .I line command is issued and no line number is available for the line to be inserted.

Note:
See also Renumbering of Source-Code Line Number References in the Programming Guide.

Auto Save Numbers If a numeric value is entered, a copy of the current source is saved automatically into the source object specified in the Source Save into field after the specified number of modifications have taken place. Modification means each time that the source has been changed as a result of information entered on the screen.

Auto Save Numbers applies to the map editor, too.

Source Save into The name of the source object into which a copy of the source is to be saved automatically in the current library. The default name EDITWORK can be modified. The specified source object is overwritten each time the number of changes specified in the Auto Save Numbers field has been exceeded.
Additional Options Y opens a list of additional options described in the following section.

Additional Options

The Additional Options window provides the following:

A plus (+) sign in front of an option indicates that some values have already been set in the corresponding window or with an appropriate editor command.

Enter a Y to select the required option.

All options are explained in the following section.

Editor Defaults

Option Explanation
Escape Character for Line Command The escape character which must precede each line command; the default escape character is a period (.).
Empty Line Suppression
This option applies when inserting lines into the source of an object (except text objects) by using the line command .I as described in Program Editor and Data Area Editor. Possible option settings:
 
Y Any lines left blank are removed from the source as soon as you press ENTER. This is the default setting.
   
N   Any lines left blank are not removed from the source when you press ENTER.
Empty Line Suppression for Text
This option applies when inserting lines into the source of a text object by using the line command .I as described in Program Editor. Possible option settings:
 
Y Any lines left blank are removed from the source as soon as you press ENTER.
 
N Any lines left blank are not removed from the source when you press ENTER. This is the default setting.
Source Size Information
Y The actual size of the object being edited and the remaining space available is displayed in the bottom information line of the editor screen. In addition, in the program editor, the programming mode (reporting or structured) is displayed in the top information line of the editor screen.
   
N   No such information is displayed.
Source Status Message
Y Program editor:
A transaction message is displayed in the top information line each time the source is modified, checked, saved, cataloged or stowed. In addition, an asterisk (*) is displayed in the editor command line if the source contains unsaved modifications. For details, see Modification Indicator in the Program Editor documentation.

Data area editor:
An asterisk (*) is displayed in the top information line if the source contains unsaved modifications. For details, see Modification Indicator in the Data Area Editor documentation.

   
N   No transaction message and/or asterisk (*) is displayed.
Absolute Mode for SCAN/CHANGE
This option applies when entering the editor command SCAN or CHANGE.
   
Y Corresponds to the editor command SET ABS ON.
   
N   Corresponds to the editor command SET ABS OFF.
 
See also Editor Commands in the sections Program Editor and Data Area Editor.
Range Mode for SCAN/CHANGE
This option applies when entering the editor command SCAN or CHANGE.
   
Y Corresponds to the editor command SET RANGE ON
   
N   Corresponds to the editor command SET RANGE OFF.
 
See also Editor Commands in the section Program Editor.
Direction Indicator Indicates the direction (+ or -) in which several editor commands are to work (see also Editor Command Line in the sections Program Editor and Data Area Editor).
Numeric Input as Line Number
Determines whether numeric input in the first four positions of a source line changes the line number when you press ENTER. Input is then not accepted as text.
 
Y Numeric input is accepted as a source line number.

Corresponds to the editor command SET SEQ OFF.

   
N   Numeric input is accepted as text.

Corresponds to the editor command SET SEQ ON.

 
See also Editor Commands in the section Program Editor.

General Defaults

Option Explanation
Editing in Lower Case
Y   Lower-case characters in the source code are not automatically converted to upper case.
   
N Lower-case characters in the source code are automatically converted to upper case. Automatic conversion is in effect by default.
   

Caution:
Do not use the terminal commands %L or %U within the editor.

Dynamic Conversion of Lower Case
This option is relevant only if the above option is set to Y.
   
Y All lower-case characters in the source code are automatically converted to upper case except
  • text strings that are enclosed in apostrophes;

  • text strings that are enclosed in quotation marks;

  • comments.

These remain as you enter them (see also the section Program Editor).
   
N   Any source code remains as you enter it.
Position of Message Line Indicates the position of the message line; possible values are TOP, BOT, nn and -nn.
Cursor Position in Command Line
Y   Indicates that the cursor is positioned in the edit command line after the source has been modified and you pressed ENTER.
N The cursor remains in the source area line after the source has been modified and you pressed ENTER.
Stay on Current Screen
Determines whether the current screen stays when you press ENTER.
   
Y   Corresponds to the editor command SET STAY ON.
   
N Corresponds to the editor command SET STAY OFF.
 
See Editor Commands in the sections Program Editor and Data Area Editor.
Prompt Window for Exit Function
Y   When you enter the EXIT command in the editor command line, a confirmation window is displayed (see also Exit Function in the sections Program Editor and Data Area Editor).
ISPF Editor as Program Editor
Y Natural ISPF (if installed) is invoked instead of the Natural program editor.
Leave Editor with Unlock
Y   Unlocks source code when leaving the editor.
   
N Leaves the editor (default setting).
   
C Unlocks source code and clears the source work area when leaving the editor.
 
For more information on locking, see the section Locking of Source Objects.

Color Definitions

In this window, you can specify the colors in which the various elements of the edit-work and split-screen area of your program or data area editor are to be displayed.

For a list of valid colors and color codes, enter a question mark (?) in any input field or press PF1.

Item Description
Command Line Editor command line above the edit-work area.
Label Indicator Leftmost column of the editor screen; used, for example, to label a source code line on which a certain command has been performed (for example, the .X and .Y line commands).
Line Numbers Column of the source code line numbers (program editor only).
Editor Lines Lines of source code currently in the editing area and/or split-screen area.
Scan and Error Line All lines marked with an S (or a greater than (>) sign in split-screen mode) as a result of a scan operation, any line where an error was detected (marked with an E and applicable in the editing area of the program editor only), and the error message line itself.
Information Text All fields in the information or command line with general information such as the type of object (for example, Program) currently in the editing area.
Information Value All fields in the information or command line with user-specific information such as the name of the object currently in the editing area.
Information Line Top and bottom information lines on the editor screen.

Direct Commands

The following direct commands and corresponding PF keys are provided on the Editor Profile screen. A direct command is entered in the command line of the screen.

Command Description
RESET This command (or PF6) resets all profile parameters to the settings displayed when the Editor Profile screen was last opened or when the editor profile was last saved to the database. RESET only applies to the parameter settings of the current editor profile; the editor profile saved in the database is not affected by the command.
SAVE This command (or PF5) saves all current editor profile settings both for the current editor session and in the database. SAVE does not terminate the profile maintenance function.
DELETE This command (or PF11) deletes the editor profile from the database. Before the profile is deleted, however, a confirmation window pops up, in which you can either type the name of the profile and press ENTER to confirm the deletion of the profile. You can only delete your own editor profile.
EXIT This command (or PF3) terminates the current profile maintenance function, regardless of the Prompt Window for Exit Function setting in the General Defaults window. If any unsaved profile changes exist, you are prompted to save these changes to the database. See also Exit Profile Maintenance.
CANCEL This command (or PF12) cancels the current profile maintenance function and returns to the screen from which it was invoked. Any modifications made to the profile have no effect on the current editor session.

Exit Profile Maintenance

After modifying the parameter settings of the current editor profile, you can close a profile maintenance window or leave the Editor Profile screen by using one of the following methods:

  • Press ENTER.

    The current maintenance window closes. If no window is open, you return to the command prompt of the program editor or data area editor respectively.

    Any modifications are saved for the current editor profile as described for Exit without Saving below.

  • Or:
    Press PF3 (Exit) or enter EXIT in the command line of the Editor Profile screen (if no maintenance window is open).

    If no modifications were made to the current editor profile, the current maintenance window closes. If no window is open, you return to the command prompt of the program editor or data area editor respectively.

    If you have modified the current editor profile, the EXIT Function window opens. You can then select one of the following options by either positioning the cursor on the required option or entering any character next to the option:

    Function Explanation
    Save and Exit Returns you to the screen from where the current profile maintenance function was invoked and saves any modifications made to the current editor profile. Modifications are saved both for the current editor session and in the database.

    If you are working with another user's editor profile, however, modifications made to that profile cannot be saved to the database. They are valid for the current editor session only; a corresponding message is returned.

    Exit without Saving Returns you to the screen from where the current profile maintenance function was invoked. Any modifications made to the current editor profile are only valid for the current editor session; they are not saved to the database.

    Exit without Saving corresponds to pressing ENTER.

    Resume Function Closes the prompt window and returns you to the current profile maintenance function.