Natural Editores
Natural Editores
Editors
October 2009
This document applies to Natural Version 4.2.6 for Mainframes and to all subsequent releases.
Specifications contained herein are subject to change and these changes will be reported in subsequent release notes or new editions.
The name Software AG, webMethods and all Software AG product names are either trademarks or registered trademarks of Software AG
and/or Software AG USA, Inc. Other company and product names mentioned herein may be trademarks of their respective owners.
Table of Contents
1 Editors ............................................................................................................................. 1
2 Locking of Source Objects ............................................................................................... 3
Source Editing ............................................................................................................ 4
Saving Objects ............................................................................................................ 5
Unlocking Objects ...................................................................................................... 5
Moving, Deleting, Renaming and Replacing Objects ................................................ 6
3 Editors - General Information ......................................................................................... 7
Split-Screen Mode ...................................................................................................... 8
Editor Profile ............................................................................................................ 11
4 Program Editor .............................................................................................................. 21
Invoking the Program Editor ................................................................................... 22
Editor Command Line .............................................................................................. 23
Top Information Line ............................................................................................... 24
Editing Area ............................................................................................................. 24
Bottom Information Line .......................................................................................... 25
Editor Commands .................................................................................................... 26
Editor Commands for Positioning ........................................................................... 32
Line Commands ....................................................................................................... 33
Special PF-Key Functions ......................................................................................... 35
Cursor-Sensitive Commands ................................................................................... 38
Saving and Cataloging Sources ................................................................................ 40
Exit Function ............................................................................................................ 40
5 Data Area Editor ............................................................................................................ 43
Invoking the Data Area Editor ................................................................................. 44
Top Information Line ............................................................................................... 46
Editor Command Line .............................................................................................. 46
Bottom Information Line .......................................................................................... 47
Using the Editing Area ............................................................................................. 48
Columns in the Editing Area ................................................................................... 49
Extended Field Definition Editing ........................................................................... 53
Line Commands ....................................................................................................... 57
Editor Commands .................................................................................................... 62
Editor Commands for Positioning ........................................................................... 67
Storing and Cataloging a Data Area ........................................................................ 68
User Exit for the Data Area Editor ........................................................................... 69
Exit Function ............................................................................................................ 69
6 Map Editor ..................................................................................................................... 71
7 Components of the Map Editor ..................................................................................... 73
8 Summary of Map Creation ............................................................................................ 75
Step 1 - Defining a Map Profile ................................................................................ 76
Step 2 - Defining a Map ............................................................................................ 76
Step 3 - Defining Map Fields .................................................................................... 76
Step 4 - Saving a Map Definition ............................................................................. 77
iii
Editors
iv Editors
Editors
Editors v
Editors
vi Editors
Editors
LC ........................................................................................................................... 351
LEFT ....................................................................................................................... 352
LIMIT ...................................................................................................................... 353
LOCATE ................................................................................................................. 353
LOG ........................................................................................................................ 354
MASK ..................................................................................................................... 354
MWINDOW ........................................................................................................... 355
NULLS .................................................................................................................... 355
ORDER ................................................................................................................... 355
POWER ................................................................................................................... 356
PROFILE ................................................................................................................. 356
PROTECT ............................................................................................................... 357
RCHANGE ............................................................................................................. 357
RECOVERY ............................................................................................................ 357
RENUMBER ........................................................................................................... 358
RESET ..................................................................................................................... 358
RFIND ..................................................................................................................... 358
RIGHT .................................................................................................................... 359
SORT ....................................................................................................................... 359
TABS ....................................................................................................................... 360
TOP ......................................................................................................................... 361
UC ........................................................................................................................... 361
UNDO ..................................................................................................................... 361
UNREN ................................................................................................................... 362
UP ........................................................................................................................... 362
WINDOW ............................................................................................................... 362
XSWAP ................................................................................................................... 363
Common Command Options ................................................................................. 363
Index ............................................................................................................................... 367
Editors vii
viii
1 Editors
For a tutorial on using the editors, see the First Steps documentation.
For information on Unicode and code page support for Natural editors, see Development Environment
in the Unicode and Code Page Support documentation.
Locking of Source Objects Describes the locking and unlocking of Natural source objects.
Editors - General Contains an overview of which Natural objects are edited with which
Information Natural editor. In addition, it contains information on split-screen mode
and the editor profile.
Program Editor Describes the program editor which is used to create and modify Natural
programs, subprograms, subroutines, classes, copycodes, helproutines
and text objects.
Data Area Editor Describes the data area editor which is used to create and modify local,
global and parameter data areas.
Map Editor Describes the map editor which is used to create and modify maps
(screen layouts).
Map Editor Tutorial Contains a series of tutorial sessions that introduce you to the use of
the Natural map editor.
SYSDDM Utility Describes the SYSDDM utility which is used to create, maintain and
delete Natural data definition modules (DDMs).
Software AG Editor Describes the Software AG Editor which is used to edit objects in Natural
and other Software AG products.
1
2
2 Locking of Source Objects
3
Locking of Source Objects
Natural provides locking mechanisms that prevent concurrent updating of Natural source objects.
These mechanisms allow the locking of source objects that are edited in a local mainframe envir-
onment and/or in a SPoD (Natural Single Point of Development) environment connected to a
mainframe server.
You can activate or deactivate different object locking mechanisms by using the profile parameter
SLOCK (see also the Parameter Reference):
In a SPoD environment, SLOCK=SPOD provides compatibility with Natural Version 4.1 (and below)
and SPoD Version 2.1 (and below).
■ Checking for Latest Modification
When setting SLOCK=POST, the source object which is being edited can be read into the source
work area and modified by multiple users. However, only the user who saves a modification
first can update the source object. This is done by comparing the time stamp of the source object
stored in the database with the time stamp of the source object when it is read into the source
work area. All other users receive appropriate error messages when trying to save the source.
This is not compatible with the SPoD locking concept of previous Natural versions.
■ Locking Deactivated
SLOCK=OFF deactivates all locking mechanisms.
The principles of object locking with profile parameter SLOCK=PRE set in a local environment are
described in the following sections.
Source Editing
The sources of the following types of Natural object are locked while they are being edited with
the appropriate Natural editor:
■ Program
■ Subprogram
■ Subroutine
4 Editors
Locking of Source Objects
■ Copycode
■ Helproutine
■ Text
■ Map
■ Local data area
■ Global data area
■ Parameter data area
■ DDM (data definition module)
When you invoke a Natural editor, the source contained in the source work area will be locked.
If the source object you want to edit has already been locked by another user (as indicated by an
appropriate message), the source can be displayed in the editor but without an object name at the
top of the screen. If you modify the source and want to keep the modifications, you have to save
the source as a new source object with a new name.
Note: Reading in a source into the source work area by using the READ command does not
lock the source object. A source object is only locked when you invoke the Natural editor.
Saving Objects
You cannot save (SAVE and STOW commands) a source that is being locked by another user.
Unlocking Objects
A locked source object contained in the source work area is unlocked when you do any of the
following:
You can use the UNLOCK system command (see the System Commands documentation) to view locked
source objects or unlock them if required.
Editors 5
Locking of Source Objects
Object locking is also considered when using the system command DELETE or RENAME, the Object
Handler or the utilities SYSMAIN, SYSTRANS or NATLOAD/NATUNLD.
When you move, delete, rename or replace a source object, the locking state of the object is checked:
Restrictions
The utilities SYSRPC, SYSPARM and SYSERR do not support object locking.
6 Editors
3 Editors - General Information
7
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 wish to edit:
■ Programs, subprograms, subroutines, helproutines, classes, copycode and text objects 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).
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 (for further information, see Installing the Software AG Editor in the
Installation documentation and the section Software AG Editor). If you wish to use the Software
AG Editor as an alternative to the Natural program editor, Natural ISPF must be installed.
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.
8 Editors
Editors - General Information
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):
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.
Editors 9
Editors - General Information
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 (only valid for program editor).
SPLIT -nnn Position nnn lines backwards (only valid for program editor).
SPLIT . Terminate split-screen mode.
or
SPLIT END
SPLIT DATA name [library] Display data area (global, local, parameter).
SPLIT DESCRIPTION pgm-name Display program description (if available) from the Predict Data
[library] Dictionary (valid for program and data area editor only).
SPLIT FUNCTION name [library] Display the subroutine name, where name is the name of the
subroutine as used in the DEFINE SUBROUTINE statement (not the
name of the object containing the subroutine). This command is
only available in 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.
SPLIT SCAN [value] Scan for a value. Each line containing the value is marked with a
greater than (>) sign. To further scan for the same 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, with DATA, PROGRAM and VIEW, an asterisk (*) can be used for name to display
a list of all available objects. If the asterisk (*) is preceded by one or more characters, only those
objects whose names begin with these characters are displayed.
A library can be specified with the program editor only. Under Natural Security, a library cannot
be specified.
10 Editors
Editors - General Information
Editor Profile
The Natural program editor and data area editor provide an editor profile, which determines the
settings to be in effect during the edit session, such as the standard assignment of PF and PA keys.
You can define your own editor profile settings according to your preferences.
■ In the command line of the program editor or data area editor, enter the following:
PROFILE
PF and PA Keys
Editors 11
Editors - General Information
Automatic Functions
Auto Renumber .. Y Auto Save Numbers .. 10_ 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 Flip 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).
■ In the command line of the program editor or data area editor, enter the following:
PROFILE profile-name
When you are in an edit 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 session, but not yet saved on the database, will not
apply. Therefore, to invoke your current session profile, enter the PROFILE command only.
Caution: Profile modifications made during the current session are lost when you enter the
system command LOGON.
12 Editors
Editors - General Information
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 on 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 session; they cannot be saved on
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 on 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:
Note: See also Renumbering of Source-Code Line Number References in the Programming
Guide.
Auto Save If a numeric value is entered, a copy of the current source is saved automatically into
Numbers 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.
Editors 13
Editors - General Information
Additional Options
If you mark Additional Options on the Editor Profile screen with a Y or press PF4, a window will
be displayed from which you can select the following options:
■ Editor Defaults
■ General Defaults
■ Color Definitions
A plus (+) sign in front of an option indicates that some values have already been set in the corres-
ponding window or via an appropriate editor command.
For each option selected, a corresponding window will be displayed. The individual items of each
window are explained below.
Editor Defaults
Option Explanation
Escape Character for Line The escape character which must precede each line command; the default escape
Command 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:
14 Editors
Editors - General Information
Option Explanation
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.
Absolute Mode for Y Corresponds to the editor command SET ABS ON.
SCAN/CHANGE
See Editor Commands in the sections Program Editor and Data Area Editor.
Range Mode for Y Corresponds to the editor command SET RANGE ON.
SCAN/CHANGE
Editors 15
Editors - General Information
General Defaults
Option Explanation
Editing in Lower Case Y Lower-case characters in the source code are not
automatically converted to upper case.
Dynamic Conversion of This option is relevant only if the above option is set to Y.
Lower Case
See Editor Commands in the sections Program Editor and Data Area Editor.
Prompt Window for Exit Y When you enter the EXIT command in the editor command line, a
Function confirmation window is displayed (see also Exit Function in the sections
Program Editor and Data Area Editor).
ISPF Editor as Program Y Natural ISPF (if installed) is invoked instead of the Natural program
Editor editor.
Leave Editor with Unlock Y Unlocks source code when leaving the editor.
16 Editors
Editors - General Information
Option Explanation
For more information on locking, see the section Locking of Source Objects.
Color Definitions
If you mark Color Definitions with a Y in the ADDITIONAL OPTIONS window, a window
similar to the example below appears:
+----------------------COLOUR DEFINITIONS-----------------------+
! !
! Edit Work Area Split Screen Area !
! Command Line ........ NE !
! Label Indicator ..... NE Label Indicator .... NE !
! Line Numbers ........ NE Line Numbers ....... NE !
! Editor Lines ........ NE Editor Lines ....... NE !
! Scan and Error Line.. NE Scan Line .......... NE !
! Information Text .... NE Information Text ... NE !
! Information Value ... NE Information Value .. NE !
! Information Line .... NE !
+---------------------------------------------------------------+
In this window you can specify the colors in which the various parts of the edit-work and split-
screen area of your program or data area editor are to be displayed.
To get a list of the colors available, you enter the question mark (?) help character in any of the
input fields or press PF1 (Help).
Apart from the Command Line and Information Line and the corresponding Information Text
and Information Value, the following individual parts can be assigned a specific color:
Item Description
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 edit-work and/or split-screen area.
Editors 17
Editors - General Information
Item Description
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 edit-work area of program editor only) and the error message line itself.
Direct Commands
The following direct commands can be used instead of the corresponding PF keys. Direct commands
have to be entered in the command line at the bottom of the editor profile screen.
Command Description
CANCEL This command (or PF12) cancels the current function and returns you to the screen from which
it was invoked. Any modifications made to the profile have no effect for the current session.
DELETE This command (or PF11) deletes the current 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, or press ENTER only to exit the function.
EXIT This command (or PF3) invokes the exit function prompt window, regardless of whether the
corresponding editor default parameter (see General Defaults) is set or not.
FLIP This command (or PF6 and PF18) is used to switch between the two PF-key lines.
REFRESH This command (or PF13) displays the profile parameters currently valid for the session, which
means that any modifications made so far, but not yet saved, are overwritten.
SAVE This command (or PF5) saves all currently valid profile parameters both for the current session
and on the database. However, it does not leave the current function.
After modifying the parameter settings of the current editor profile, you can close a profile main-
tenance window or leave the Editor Profile screen by using one of the following methods:
■ Press ENTER.
The maintenance window currently open is closed. 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).
18 Editors
Editors - General Information
The EXIT Function window opens where you can select one of the following three options. Select
one of them by either positioning the cursor or entering any character.
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 session and on the database.
If you are working with another user's editor profile, however, modifications made
to that profile cannot be saved on the database. They are valid for the current
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 session; they are not saved on the database.
Editors 19
20
4 Program Editor
21
Program Editor
The Natural program editor is used to create and modify the source code of a Natural object of
the type program, subprogram, subroutine, helproutine, copycode, text or class.
Related Topic:
For information on Unicode and code page support for Natural editors, see Editors in the Unicode
and Code Page Support documentation.
■ Use the system command EDIT as described in the System Commands documentation.
When the program editor is invoked, an editor screen similar to the example below appears:
The editor screen contains the following items (from top to bottom): the editor command
line, the top information line, the editing area and the bottom information line. These items
are explained in the following sections.
Note: If Natural ISPF is installed and the editor profile option ISPF Editor as Program Ed-
itor is set to Y, instead of the program editor, either the Natural ISPF main menu (if the EDIT
command is entered without an object name) or the Natural ISPF editor screen with the
specified object is invoked.
22 Editors
Program Editor
The editor command line is indicated by the leftmost greater than sign (>) in the top line of the
editor screen. In the command line, you can enter one of the following:
For example: The system command CHECK can be used for checking the syntax of source code
and SAVE for saving source code (see also Saving and Cataloging Sources).
For other system commands related to maintaining and using object sources, see Editing and
Storing Programming Objects in the System Commands documentation.
■ One or more editor commands.
■ The name of a Natural program to be executed.
Additionally, the top line can contain the following items (from left to right):
Direction Indicator: The direction indicator can be set to control the direction of the editor commands
ADD and SCAN, and of the line commands .C, .I and .M. The plus sign (+) indicates
+ or - after and the minus sign (-) indicates before. The exact interpretation is described with
the relevant command description. See also the editor profile option Direction
Indicator described in Editor Profile.
Object Type The type of object currently in the source work area. If no object type or object name
is specified when the program editor is invoked, object type Program is displayed
by default.
The object type can be changed by using the editor command SET TYPE.
Object Name The name of the object currently in the source work area. No name is displayed if the
source work area is empty or if the current source code has not yet been saved as a
source object with the SAVE, CATALOG or STOW command.
Modification An asterisk (*) indicates whether the source code currently in the source work area
Indicator: contains unsaved modifications. The asterisk (*) also appears for new source code
that has not yet been saved as a source object.
*
The asterisk (*) is only visible if the editor profile option Source Status Message is
set to Y (see Editor Profile).
The asterisk (*) disappears when you execute a successful SAVE or STOW command
on the source.
Editors 23
Program Editor
The top information line of the editor screen is a scale line. It can contain the following:
■ A message indicating object modification. This information is only displayed if the editor profile
option Source Status Message is set to Y (see Editor Profile).
■ The programming mode (structured or reporting) currently in effect. When a Natural object is
read into the source work area, the mode is set to the one which was in effect when the object
was saved with the SAVE or STOW command. This information is only displayed if the editor
profile option Source Size Information is set to Y (see Editor Profile).
For information on the differences between structured and reporting mode, see Purpose of Pro-
gramming Modes in the Programming Guide.
Editing Area
The editing area of the editor screen contains the numbered lines where you add or modify source
code.
The editing area is either empty or contains source code that was last read into the source work
area with the command EDIT or READ as shown in the example of a program in Invoking the Program
Editor.
When you read in the source of an existing object, the entire source code is loaded into the source
work area and is available for editing. However, depending on the size of the source, the editing
area may not show all of the lines that belong to the source. In this case, you have to scroll down
the source (see Editor Commands for Positioning) to go to the line you want to view or modify.
In addition, if you use split-screen mode, the editing area displays fewer lines of source code. See
also Split-Screen Mode.
24 Editors
Program Editor
■ You can enter multiple commands in the command line of the editor: you can enter more than
one editor command, but only the last command entered in the editor command line can be a
system command. For example:
SC 'MOVE',-2,RENUMBER
Note: Natural treats the editor command N like a system command. N corresponds to the
system command RENUMBER.
■ If you have changed the source code by typing in a modification or by using an editor command,
a system command cannot be entered until you press ENTER.
You can activate or deactivate dynamic conversion to upper case, by setting the appropriate editor
profile options Editing in Lower Case and Dynamic Conversion of Lower Case to Y (Yes). All
source code you enter in the editing area is then converted to upper case, with the following ex-
ceptions:
Caution: If the character string slash-asterisk (/*) denotes an executable part of a statement,
it must be specified without a blank character in front of the string (/*). The string will
otherwise be considered a comment.
The bottom information line of the editor screen is a scale line. It can contain the following:
The size (number of characters) of the current source. As source lines are stored in variable
length in the source work area, trailing blanks within a source line are not counted; leading and
embedded blanks are counted. This information is only displayed if the editor profile option
Source Size Information is set to Y (see Editor Profile).
■ Char. Free
The number of characters still available in the source work area. This information is only dis-
played if the editor profile option Source Size Information is set to Y (see Editor Profile).
Editors 25
Program Editor
■ S
The number of the source line currently displayed as the top line.
Editor Commands
Editor commands are entered in the command line of the program editor. The command parameters
must be separated either by the input delimiter character as defined with the Natural session
parameter ID (the default delimiter character is comma (,)) or by a blank. When multiple commands
are entered, these must also be separated by the delimiter character or by blanks.
The editor commands available are described in the following table and in the section Editor
Commands for Positioning. For explanations of the syntax symbols used in the editor commands,
refer to System Command Syntax in the System Commands documentation. An underlined portion
of a command denotes a valid abbreviation.
The value for n can be in the range from 1 to 9. If n is not (or not
correctly) specified, 9 lines (4 in split-screen mode) are added by
default.
With the next ENTER, lines that are still left blank are removed.
CANCEL Leaves the editor. Any modifications made since the last time the
SAVE command was entered are not saved.
or
(a period)
CATALOG [object-name] Executes the system command CATALOG which checks and catalogs
the current source code.
You must supply an object name with the command if you catalog
new source code or if you want to copy the current source code.
See also Saving and Cataloging Sources.
26 Editors
Program Editor
DY
DX-Y Deletes the block of lines delimited by the X and Y markers.
Editors 27
Program Editor
If you only enter N, the lines are numbered in increments of 10; if you
enter N (nnnn), the lines are renumbered in increments of nnnn.
If the value specified for n is too big, lines are numbered in increments
of 5.
You must supply an object name if you save new source code or if
you want to copy the current source code.
See also Saving and Cataloging Sources.
SCAN ['scan-value'] Scans the source code for a character string (scan-value).
28 Editors
Program Editor
Note: The equal sign (=) used with the SCAN command is the default
input assign character. If another character has been specified as input
assign character (see session parameter IA as described in the
Parameter Reference), that other character must be used instead.
SET ABS [ON|OFF] ON The SCAN and CHANGE commands operate in
absolute mode, which means that the
scan-value and the replace-value need not
be delimited by blanks or special characters.
OFF The SCAN and CHANGE commands do not
operate in absolute mode, which means that the
scan-value and the replace-value must be
delimited by blanks or special characters.
Editors 29
Program Editor
30 Editors
Program Editor
You must supply an object name if you STOW new source code or if
you want to copy the current source code. Otherwise, an appropriate
message appears.
See also Saving and Cataloging Sources.
Editors 31
Program Editor
Editor commands for positioning are entered in the command line of the program editor. The
following commands are available for positioning:
Command Function
ENTER Position forwards one page.
or
+P
or
+
-P Position backwards one page.
or
-
+H Position forwards half a page.
-H Position backwards half a page.
T Position to top of source.
or
--
B Position to bottom of source.
or
++
+nnnn Position forwards nnnn lines (maximum 4 digits).
-nnnn Position backwards nnnn lines (maximum 4 digits).
32 Editors
Program Editor
Command Function
nnnn Position to line number nnnn.
X Position to the line marked with an X.
Y Position to the line marked with a Y.
POINT Positions to the line in which the line command .N was entered.
Line Commands
Line commands are entered in the first position of a source line. The line commands provided by
the program editor are listed below. The notation (nn) or (nnnn) indicates a repetition factor. The
default repetition value is 1 (with the exception of the .I command; see below). For explanations
of the syntax symbols used in this section, refer to System Command Syntax in the System Commands
documentation.
Note: You are recommended to enter a blank at the end of each line command. This prevents
the editor from attempting to interpret any information existing on the line as part of the
line command.
If nn is not (or not correctly) specified, 9 lines (4 lines in split-screen mode) are
inserted by default. Lines that are left blank are then removed from the source,
depending on the setting of the editor profile options Empty Line Suppression and
Empty Line Suppression for Text described in Editor Profile.
Editors 33
Program Editor
Depending on the direction indicator, the object is inserted before or after the line
in which you enter the command.
If you wish to include only part of the object, you specify as ssss the first line to be
included (for example, 20 means the inclusion will start from the 20th line), and as
nnnn the number of lines to be included.
If you enter multiple commands, this command is always executed after all other
line and/or editor commands have been executed.
If the object is a map, an INPUT USING MAP statement (see INPUT Syntax 2 - Using
Predefined Map Layout in the Statements documentation) with all defined variables
is automatically included in the current line.
If the object is a data area, the entire data area is included, except comment lines.
Only local and parameter data areas that were saved and cataloged with the STOW
command can be included into the source work area; global data areas cannot be
included.
If the object is an adapter, a PROCESS PAGE USING (see Syntax 2 - PROCESS PAGE
USING in the Statements documentation) with all defined variables is automatically
included in the current line.
.J Joins the current line with the next line.
If the resulting line exceeds the length of the editor screen line, the line is marked
with an L and must be split in two with the .S command (see below) before it can
be modified.
.L Undoes all modifications that have been made to the line since the last time ENTER
was pressed.
.MX Moves the X-marked or the Y-marked line. See also the line commands .X and .Y
as well as Notes for Line Commands.
or
.MY
.MX-Y Moves the block of lines delimited by the X and Y markers (see also Notes for Line
Commands).
.N Marks (invisibly) a line to be positioned at the beginning of the source work area
by the editor command POINT.
The mark is automatically deleted when an error with a line command or editor
command occurs, or when the RESET command is executed.
.P Positions the line marked with this command to the top of the screen.
.S Splits the line at the position marked with the cursor.
.X Marks a line with an X (see also Notes for Line Commands).
34 Editors
Program Editor
■ If both the commands .X and .Y are applied to one line, it is treated as being marked with an X
and with a Y; the line marker actually shown to reflect this status is a Z.
■ If the direction indicator is set to + (plus sign), the copied, inserted or moved lines are placed
after the line in which the corresponding command was entered; if the direction indicator is set
to - (minus sign), the copied, inserted or moved lines are placed before the line in which the
command was entered.
Function Explanation
*CURSOR A line split function can be combined with the command .I, .CX, .CX-Y, .MX or .MX-Y. This is
accomplished by assigning the value *CURSOR to a PF key in the editor profile (see PF and PA
Keys in Editor Profile). If this PF key is then pressed instead of ENTER after a line command has
been entered, the line in which the command was entered is first split at the cursor position and
then the line command is executed. See also Example of *CURSOR on PF Key.
*X If a PF key is assigned the value *X or *Y in the editor profile (see PF and PA Keys in Editor
Profile), the cursor position is marked X or Y whenever this PF key is used. These position markers
or are then used to determine which portion of a line is to be included in the command operation.
*Y See also Example of *X and *Y on PF Keys.
The following are instructions for using a PF key to which the value *CURSOR is assigned.
1. In the PF and PA Keys section of the Editor Profile screen, enter *CURSOR next to PF6.
2. Open the program editor, type in the following text, and press ENTER:
Editors 35
Program Editor
0080
0090
0100
....
0280
....+....1....+....2....+....3....+....4....+....5....+... S 3 L 1
Line 0030 is split before the cursor position, line 0020 is copied to the line after the line in which
you entered the .CX command, and the second half of the split line is moved to the last line.
The following are instructions for using PF keys to which the values *X and *Y are assigned.
1. In the PF and PA Keys section of the Editor Profile screen, enter *X next to PF4 and *Y next to
PF5.
36 Editors
Program Editor
2. Open the program editor, type in the following text, and press ENTER:
3. In line 0010, place the cursor on the letter P and press PF4.
The positions of the characters (P and blank) are marked as indicated by the X and Y respectively,
which appear in the top and bottom information lines and next to the source lines that contain
the marked characters.
5. In line 0040, enter the line command .MX-Y and press ENTER.
Editors 37
Program Editor
The block of text starting with P in line 0010 and ending with N in line 0030 is moved to the line
below the line in which you entered the command. The moved block of text and the remaining
text in line 0010 and 0030 are left-justified.
Cursor-Sensitive Commands
Cursor-sensitive commands are commands where, instead of entering a name in the command
line, you can mark the name with the cursor anywhere on the editor screen (except in the command
line). You can place the cursor on any word that is not in the command line. It does not matter
where on the word the cursor is placed.
■ SCAN Commands
■ SPLIT Command
38 Editors
Program Editor
SCAN Commands
If the SCAN command is used without any parameter but with the cursor positioned outside the
editor command line, this results in a scan operation for the string on which the cursor is placed.
(If the cursor is placed on a blank character, however, the SCAN/REPLACE window is invoked.)
In split-screen mode, the cursor can be placed on a string in the split-screen area, too.
When using the SPLIT SCAN command, the same applies as for the SCAN command, but the scan
operation is performed in the split-screen area only (see also the section Split-Screen Commands).
Note: To benefit from cursor sensitiveness as much as possible, the SCAN or SPLIT SCAN
command should be assigned to a PF key (see PF and PA Keys in Editor Profile).
SPLIT Command
Instead of the commands SPLIT PROGRAM, SPLIT DATA, SPLIT FUNCTION and SPLIT VIEW, which
you can use to display a Natural object (including a DDM) in the split-screen area of the editor
(see also the section Split-Screen Commands), you only have to enter the command SPLIT and
place the cursor on the name of the required object. The object must be contained in the current
library.
Note: To benefit from cursor sensitiveness as much as possible, the SPLIT command should
be assigned to a PF key (see PF and PA Keys in Editor Profile).
The system commands EDIT and LIST are cursor-sensitive, too. Instead of specifying an object
name, the cursor can be positioned to a text string of the object currently in the editing area that
corresponds to the required object name.
With the EDIT command, the corresponding object is loaded into the editor. If necessary, even a
different editor is invoked.
With the LIST command, the corresponding object is listed, even if a view has been referenced.
For more information on EDIT and LIST see the System Commands documentation.
Editors 39
Program Editor
You can save the source code currently in the source work area as a source object and also as a
cataloged object, which are stored in a Natural library in a Natural system file.
■ Use the system command SAVE, CATALOG or STOW as described in Saving and Cataloging Objects
in the Using Natural documentation.
Note: When you leave the program editor with the EXIT editor command, the current
source code is saved automatically if the appropriate editor profile option is set accord-
ingly as described in Exit Function.
■ Use the editor options Source Save into and Auto Save Numbers as described in Editor Profile.
A copy of the source edited last with any of the Natural editors is then automatically saved
as a source object in the current Natural environment.
Exit Function
The effect of the EXIT editor command depends on the setting of the editor profile option Prompt
Window for Exit Function:
■ If set to N, the EXIT command leaves the editor and saves all modifications made to the current
source; no prompt window is displayed.
■ If set to Y, the EXIT command invokes the EXIT Function window whenever you execute the
command on a source that contains unsaved modifications (see also Modification Indicator).
If no modifications were made to the source, the window does not appear and the editor closes
without saving the source.
40 Editors
Program Editor
Option Explanation
Save and Exit Leaves the editor and saves all modifications made to the current source code.
Exit without Saving Leaves the editor without saving any modifications made to the current source code
since it was last saved.
Resume Function Neither leaves the editor nor saves any modifications; the prompt window is closed
and the current function is resumed.
Editors 41
42
5 Data Area Editor
43
Data Area Editor
The data area editor is used to create and modify a data area. A data area is a Natural object of
the type global data area (GDA), local data area (LDA) or parameter data area (PDA). For inform-
ation on using a data area, see Data Areas in the Programming Guide.
A data area contains data element definitions, such as user-defined variables, constants and
database fields referenced with a data view in a data definition module (DDM), which can be used
by one or more Natural objects. You can also create copycode from a data area. Note that data
views from a DDM cannot be defined in PDAs.
Related Topic:
For information on Unicode and code page support for Natural editors, see Editors in the Unicode
and Code Page Support documentation.
You invoke the data area editor with the system command EDIT described in the System Commands
documentation.
■ Issue the EDIT command specifying the type of data area (GLOBAL, LOCAL or PARAMETER) you
want to create.
For example:
EDIT LOCAL
An editor screen with an empty editing area appears for a local data area (indicated in the
top left corner of the screen) similar to the example shown in the following instructions.
■ Issue the command EDIT specifying the name of a data area that has been stored as a source
object in your current Natural environment.
For example:
EDIT LDA1
44 Editors
Data Area Editor
An editor screen similar to the example below appears which contains the source of the local
data area LDA1:
1 PERSON
2 SEX A 6
2 AGE N 3
1 NAME A 24
2 FIRST-NAME A 10
2 MIDDLE-INIT A 2
2 LAST-NAME A 10
C 1 DOLLAR A 5 CONST<'$US'>
V 1 FINANCE-VIEW FINANCE
2 PERSONNEL-NUMBER N 8.0
3 CREDIT-CARD A 18
(EM=XXX.XXX.XXX.XXX.XXX.XXX)
3 CREDIT-LIMIT N 4.0
3 CURRENT-BALANCE N 4.0
The editor screen contains the following items (from top to bottom): the top information line,
the editor command line, the editing area and the bottom information line. These items are
explained in the following sections.
Editors 45
Data Area Editor
The top information line of the editor screen can contain the following items (from left to right):
Data Area Type Indicates the type of data area currently in the source work area: Local, Global
or Parameter.
The type can be changed by using the editor command SET TYPE.
Data Area Name The name of the data area currently in the source work area. No name is displayed
if the source work area is empty or if the current source code has not yet been saved
as a source object with the SAVE, CATALOG or STOW command.
Modification Indicator: An asterisk (*) indicates whether the source code currently in the source work area
contains unsaved modifications. The asterisk (*) also appears for new source code
* that has not yet been saved as a source object.
The asterisk (*) is only visible if the editor profile option Source Status Message is
set to Y (see Editor Profile).
The asterisk (*) disappears when you execute a successful SAVE or STOW command
on the source.
The command line is indicated by the editor's Command prompt. In the command line, you can
enter one of the following:
For example: The system command CHECK can be used for checking the syntax of source code
and SAVE for saving source code (see also Storing and Cataloging a Data Area).
For other system commands related to maintaining and using object sources, see Editing and
Storing Programming Objects in the System Commands documentation.
■ The name of a Natural program to be executed.
■ One or more editor commands.
46 Editors
Data Area Editor
Direction Indicator
The direction indicator entered next to the > (greater than) sign in the command line determines
the operation direction of particular editor and line commands:
■ +
(plus sign)
The command executes from the top line displayed on the screen (or from the line in which a
line command is entered) towards the end of the source. This is the default setting.
■ -
(minus sign)
The command executes from the top line displayed on the screen (or from the line in which a
line command is entered) towards the beginning of the source.
More detailed information on the direction indicator can be found in the descriptions of the editor
and line commands affected by the operation direction.
See also the editor profile option Direction Indicator described in Editor Profile.
The bottom information line of the editor screen can contain the following:
The size (number of characters) of the current source. This information is only displayed if the
editor profile option Source Size Information is set to Y (see Editor Profile).
■ Free
The number of characters still available in the source work area. This information is only dis-
played if the editor profile option Source Size Information is set to Y (see Editor Profile).
■ S
The number of the source line currently displayed as the top line.
Editors 47
Data Area Editor
The editing area is either empty or contains source code that was last read into the source work
area with the command EDIT or READ as shown in the example in Invoking the Data Area Editor.
When you read in the source of an existing object, the entire source code is loaded into the source
work area and is available for editing. However, depending on the size of the source, the editing
area may not show all of the lines that belong to the source. In this case, you have to scroll down
in the source to go to the line you want to view or modify.
In addition, if you use split-screen mode, the editing area displays fewer lines of source code. See
also Split-Screen Mode.
■ Use the editor commands described for the program editor in Editor Commands for Position-
ing.
All positioning commands described for the program editor can be used with the data area
editor as well.
■ Type in or modify all variable or field definitions in the columns of the relevant source line.
You can specify whether the characters you type are automatically converted to upper case
by using the editor profile options Editing in Lower Case and Dynamic Conversion of Lower
Case (see Editor Profile).
Or:
A line command, for example, is used to insert a line, copy variable or field definitions from
another Natural object, or invoke the extended field definition editing function.
Or:
An editor command, for example, is used to delete a block of lines or specify prefixes for
names.
48 Editors
Data Area Editor
The editing area of the editor screen is organized in columns where all attribute definitions that
belong to a variable or field are maintained in one line.
+ Indicates that more than one of the entries listed below exist for
the variable or field.
S Indicates that both an initial value and an edit mask have been
defined by using the .E line command.
Editors 49
Data Area Editor
* A comment field.
L The level number of the variable or field (1 - 99). Variables which are not within a
hierarchical structure and view definitions must be assigned level 1. Level numbers cannot
be used with data block definitions.
50 Editors
Data Area Editor
For valid names, see Naming Conventions for User-Defined Variables in the Using Natural
documentation.
Instead of specifying a variable name, the filler option nX can be used. With the filler option,
n filler bytes can be denoted within the field or variable being redefined, where n can be
up to 10 digits (smaller than 1 GB). The definition of trailing filler bytes is optional.
F The Natural data format of the variable or field.
For valid formats, see Format and Length of User-Defined Variables and Special Formats in the
Programming Guide.
For a counter field (C* variable), you can specify the Natural data format/length I2 or I4
(the default setting is N3 for no format/length).
Length The length of the variable or field.
For valid lengths, see Format and Length of User-Defined Variables in the Programming Guide.
No length is permitted for the Natural data formats C, D, T and L. You can define dynamic
variables by specifying DYNAMIC in the Length field.
For a counter field (C* variable), you can specify the Natural data format/length I2 or I4
(the default setting is N3 for no format/length).
Miscellaneous This input field can be used to enter the definitions described in Using the Miscellaneous
Column.
The definitions that can be entered in the fields of the Miscellaneous column are described in this
section.
As the Miscellaneous field may be too short to make all required specifications, the .E line com-
mand is provided for extended field definition editing.
A definition can be of up to 32 characters, whereby only 26 characters are displayed on the screen.
You can scroll in the field by using the editor command M +/-. You can display all of the 32 char-
acters or enter additional characters in an extra window, which opens when you enter a question
mark (?) in the first position of the Miscellaneous field.
Array
Enter the upper and lower bounds of an array. For detailed information on defining arrays,
see Arrays in the Programming Guide.
Editors 51
Data Area Editor
Examples:
Initial Value
Not applicable to PDAs.
Enter an initial value according to the common Natural syntax definitions in a DEFINE DATA
statement. For detailed information on defining initial values, see Initial-Value Definition and
Initial/Constant Values for an Array in the Statements documentation.
Examples:
INIT<3>
INIT<'ABC'>
INIT<H'F1F2'> /* binary variable (B2)
CONST<12>
INIT ALL<'ABC'>
Enter an edit mask or a header definition and/or the print mode according to the syntax rules
that apply to the corresponding session parameter EM, HD or PM described in the Parameter Ref-
erence documentation.
Examples:
(EM=999.99)
(HD='TEXT' EM=XXX.XXX.XX PM=N)
Comment
A commentary text which must be preceded by a slash and an asterisk ( /*).
Name of a DDM
For a view definition, you must enter the name of the DDM from which the view is derived.
You can modify the name of the DDM if all fields of the view are also contained in the DDM
with the modified name.
Name of a Parent Block
For a block definition, you must enter the name of the corresponding parent block.
52 Editors
Data Area Editor
The extended field definition editing function can be used to define the following:
1 In the T column, next to the variable or field for which you want to define extended attributes,
enter the following line command:
.E
An Extended Field Definition Editing menu similar to the example screen for a user-defined
variable in an LDA is shown below:
The functions provided on the Extended Field Definition Editing menu depend on the type
of the data area, the type of variable and the contents of the Miscellaneous field. For example,
if a variable has already been initialized in the Miscellaneous field, the functions Single Value
Initialization and Free Mode Initialization are not available.
Editors 53
Data Area Editor
Note: If .E is executed for a DDM field, the Define Edit Mask / Header screen (see the
following step) is invoked immediately, because only edit masks and headers can be
defined for DDM fields. It is not possible to define initial values for DDM fields.
2 Select the function required by entering the code that corresponds to the function required.
For explanations of the functions available, see Functions in the Extended Field Definition
Editing Menu.
Depending on the function selected, either another menu or an extended field editing area
similar to the example of a Define Edit Mask / Header screen below appears:
#USER-VARIABLE-1(A10)
----------------------------------------------------------------------
(EM= )
----------------------------------------------------------------------
#USER-VARIABLE-1(A10)
-------------------------------------------------------------------
(HD=' ')
-------------------------------------------------------------------
Note: A definition is not checked for syntax errors during editing. You can check a
definition with the CHECK command after you terminated extended field definition
editing.
4 When you are finished and return to the Extended Field Definition Editing menu, the
Definition column reflects the changes as shown in the following example:
54 Editors
Data Area Editor
If any initial values, edit masks, headers or array index definitions have been defined, the
corresponding status message in the Definition column changes from no to yes. If in a PDA
any parameter type has been defined, an abbreviation of the parameter type (for example,
Val for call-by-value) is displayed in the Definition column.
Any definitions made within the Initial Values and Edit Mask / Header subfunctions are imme-
diately incorporated into the data area currently displayed in the data area editor but are not dis-
played in the Miscellaneous column of the editing area. A corresponding entry is only displayed
in the I column (label indicator).
The functions available in the Extended Field Definition Editing menu and the commands
available in an extended field editing area are described in the following section.
All functions that can be available in the Extended Field Definition Editing menu are described
in the following table.
For an attribute control variable, only the functions codes S, F, P, A and D are allowed.
For a field that redefines another field, only the function codes E, A and D are allowed.
Function Function
Code
S Defines an initial value for the specified variable or field in single-value mode. You only enter the
required variable or field value; any further specifications necessary (including apostrophes for
alphanumeric variables or fields, and value prefixes such as H for hexadecimal) are generated
automatically. For example, from an initial value of F1F2 for a binary variable (B2), the data editor
will generate INIT <H'F1F2'>.
If the variable or field is an array, an initial value can (but does not necessarily have to) be defined
for each occurrence.
With arrays, asterisk notation (*) can be entered in the command line to repeat the value in the
last line of the previous page until the end of the current page.
Editors 55
Data Area Editor
Function Function
Code
For attribute control variables, a screen is displayed where you can select attributes and colors as
initial values. For details on attributes and colors, see the session parameters AD and CD in the
Parameter Reference documentation.
To define a constant value instead of an initial value, enter Y in the field Define as CONSTANT
(Y/N).
F Defines an initial value for the specified field in free mode. A free-mode editor is provided where
you can enter your initial value definitions according to the common Natural syntax definitions
in a DEFINE DATA statement.
For detailed information on defining initial values, see Initial-Value Definition Initial/Constant Values
for an Array in the Statements documentation.
If both an edit mask and a header are specified, together they must not exceed 57 characters in
length. However, if only an edit mask is specified, it can be up to 63 characters long; if only a
header has been specified, it can be up to 58 characters long.
If .E is entered for a DDM field, this function is invoked immediately, as only edit masks and
headers can be defined for DDM fields. It is not possible to define initial values for DDM fields.
P This function only applies to PDAs.
It can be used to determine the way in which the value of a field specified as a parameter in a
CALLNAT statement is passed from a program to an invoked object (for example, a subprogram).
You can enter one of the following codes in the upper input field:
D Call-by-reference (default).
V Call-by-value.
R Call-by-value-result.
For detailed information, see the corresponding options BY VALUE and BY VALUE RESULT
described for the DEFINE DATA statement in Parameter Data Definition, and operand2 described
for the CALLNAT statement in the Statements documentation.
Additionally, you can specify whether a parameter must be passed by entering one of the following
values in the lower input field:
N A parameter must be passed (default).
Y An optional parameter that can be passed.
56 Editors
Data Area Editor
Function Function
Code
For detailed information, see the corresponding option OPTIONAL described for the DEFINE DATA
statement in Parameter Data Definition, and operand2 described for the CALLNAT statement in the
Statements documentation.
A Defines array bounds for the specified field. A free-mode editor is provided where you can enter
your bound definitions in accordance with the common Natural syntax definitions. While you are
editing, however, the specified values will not be checked (unless you enter the CHECK command).
D Deletes all definitions made with the S, F, E, P and A function codes. An additional screen is
provided, where you can specify the definitions to be deleted.
By default, all definitions are marked with Y. If you do not want to delete a definition, remove the
Y behind the definition or replace the Y by N.
The commands that can be entered in the command line of an extended field editing area are de-
scribed in the following table:
Command Function
EDIT Returns to the editing area of the editor screen.
. Returns to the previous screen to continue processing.
-- Returns to the beginning of the initial value specification(s).
+ Scrolls down one page. If the last page has been reached or if there is only one page available,
returns to the editing area of the editor screen.
* Copies the initial value of the last occurrence of the previous page to all empty fields of the current
page. It is only available for arrays in single-value mode.
Line Commands
You enter a line command in the T column of a source line. You are recommended to enter a blank
at the end of each line command. This prevents the editor from attempting to interpret any inform-
ation existing on the line as part of the line command.
The default escape character which must precede each line command is a period (.). You can
change the default character by using the editor profile option Escape Character for Line Command
(see Editor Profile).
The line commands provided by the program editor are described in the following section. The
notation (n), (nnn) or (nnnn) indicates a repetition factor. The default repetition value is 1 (with
the exception of the .I line command). For explanations of the syntax symbols used in this section,
refer to System Command Syntax in the System Commands documentation.
Editors 57
Data Area Editor
Command Function
.C[(nnnn)] Copies the line in which the command was entered.
or See also the line commands .X and .Y and Notes for Line Commands.
.CY[(nnnn)]
.CX-Y[(nnnn)] Copies the block of lines delimited by the X and Y markers.
See also the line commands .X and .Y and Notes for Line Commands.
.D Deletes one or more lines beginning with the line in which you enter the
command towards the end of the source (regardless of any direction indicator
setting).
When entered for an individual field, only that field definition is deleted.
For more information, see the section Extended Field Definition Editing.
.F(file-name) This command includes a Predict file (applicable to the file types Conceptual,
Standard, Sequential and Other).
.I[(n)] This command adds n empty lines, where n can be in the range from 1 to 9. If
n is not (or not correctly) specified, 10 lines (5 lines in split-screen mode) are
added by default.
Lines that are left blank are eliminated from the source, depending on the
setting of the editor profile option Empty Line Suppression described in Editor
Profile.
Data area
58 Editors
Data Area Editor
Command Function
Program
Subprogram
Subroutine
Helproutine
Map
■ All local variables and parameters contained in the specified object (including
those incorporated from LDAs and/or PDAs).
■ All local variables contained in the specified object (including those
incorporated from LDAs).
■ Only those local variables defined within the specified object.
■ All parameters contained in the specified object (including those incorporated
from PDAs).
■ Only those parameters defined within the specified object.
If the specified object has been cataloged with the Natural Optimizer Compiler,
initial values and constants cannot be incorporated.
If the object you want to insert has features the data area editor does not
support, an appropriate message appears and the relevant line is marked as a
comment line.
The ssss entry can be used to indicate at which line the insertion is to begin.
For example, when setting ssss to 20, the insertion begins with the 20th line
of the data area. The nnnn entry can be used to indicate the number of lines to
be inserted.
Editors 59
Data Area Editor
Command Function
If ssss and/or nnnn is specified for an object other than a data area (see the
.I(obj) command), the specified value(s) are ignored.
or See also the line commands .X and .Y and Notes for Line Commands.
.MY
.MX-Y Moves the block of lines delimited by the X and Y markers.
See also the line commands .X and .Y, and Notes for Line Commands.
.N Marks (invisibly) a line to be positioned at the beginning of the source work
area by the editor command POINT described in Editor Commands for Positioning.
The mark is automatically deleted when an error with a line command or editor
command occurs, or when the RESET command is executed.
.P Positions the line marked with this command to the top of the screen.
.R Redefines a variable or field as a single variable or a group of variables.
With the filler option (nX), n filler bytes can be denoted within the variable or
field being redefined. The definition of trailing filler bytes is optional.
Specify the DDM (ddm-name) from which you want to define a view. The fields
of this DDM are then displayed in the editing area. Mark the fields to be
incorporated into the view by entering any character in the I column next to
the field(s) required. When you press ENTER, these fields are copied as a view
definition into the current data area with the name of the view (default is the
name of the DDM) assigned at level 1.
In split-screen mode, the DDM currently in the split screen is displayed in the
editing area when you enter .V without ddm-name.
If NOFL is specified, the selected fields are included without format and length
specification.
60 Editors
Data Area Editor
Command Function
(C* variable) for the group or field is automatically generated and placed before
the group or field. The index for such a periodic group or multiple-value field
is defined with the number of occurrences defined in Predict. If the number
of occurrences has not been defined in Predict, the value 191 is used.
To obtain fields and groups from the split-screen area, the line number of the
field or group from the split-screen area must be specified in the first column,
without a period (.). Fields and groups from the split-screen area can be
included as fields of a view (if number is entered inside a view) or as
user-defined variables.
If the selected field has the same name as the field for which the command was
entered, it is substituted instead of inserted.
Multiple lines can be obtained from the split screen by using the nnn notation
where nnn is the number of lines to be included.
The m notation can be used to specify a level number to be assigned to the field
or group to be inserted. The level number in the data area can be modified.
■ The commands .I(obj), .R and .* are available in full-screen mode only, not in split-screen
mode.
Editors 61
Data Area Editor
■ If both the commands .X and .Y are applied to one line, it is treated as being marked with an X
and with a Y; the line marker actually shown to reflect this status is a Z.
■ If the direction indicator is set to + (plus sign), the copied, inserted or moved lines are placed
after the line in which the corresponding command was entered; if the direction indicator is set
to - (minus sign), the copied, inserted or moved lines are placed before the line in which the
command was entered.
Editor Commands
The editor commands that can be entered in the command line of the data area editor are described
in the following section. For explanations of the syntax symbols used in this section, refer to System
Command Syntax in the System Commands documentation.
Command Function
ADD[(n)] Adds n blank lines. If the direction indicator is set to + (plus sign),
the lines are added after the last line of the object being edited; if the
direction indicator is set to - (minus sign), the lines are added before
the first line of the object.
The value for n can be in the range from 1 to 9. If n is not (or not
correctly) specified, 9 lines (4 in split-screen mode) are added by
default.
With the next ENTER, lines that are still left blank are eliminated.
CANCEL Leaves the editor. Any modifications made since the last time the
SAVE command was entered are not saved.
or
(a period)
CATALOG [object-name] Executes the system command CATALOG which checks and catalogs
the current data area definition.
You must supply an object name with the command if you catalog a
new data area definition or if you want to copy the current data area.
See also Storing and Cataloging a Data Area.
CHANGE Scans the data area for a character string (scan-value) and replaces
['scan-value'replace-value'] each such scan-value found with the character string entered as
replace-value. Any special character which is not valid within a
Natural variable name can be used as the delimiter character.
62 Editors
Data Area Editor
Command Function
For information on how the scan operation is performed, see the SCAN
command.
CHECK Executes the system command CHECK which checks the syntax of the
current data area definition. If an error is found, the erroneous line
is marked with an E and an appropriate error message appears in the
message line. If no errors are found, a message appears indicating
successful completion of the check.
Array definition
Initial value
Edit mask, header and/or print mode
Name of a DDM or parent block
Comment
CLEAR Executes the system command CLEAR which clears the source work
area. Changes to the data area currently contained in the source work
area are lost if they were not previously saved.
DX Deletes the X-marked or the Y-marked line.
DY
DX-Y Deletes the block of lines delimited by the X and Y markers.
Editors 63
Data Area Editor
Command Function
M +|- Scrolls the Miscellaneous column.
You must supply an object name if you save a new data area definition
or if you want to copy the current data area.
See also Storing and Cataloging a Data Area.
SCAN scan-value Scans the data area for a character string (scan-value) in the Name
(default) and/or the Miscellaneous column of the editor screen,
depending on whether the SET SCAN command was executed earlier.
The first line which contains the scan-value is positioned to the top
line or the bottom line, depending on the current setting of the
direction indicator.
Note: The SCAN command performs an exact search for the specified
scan-value. This should be taken into account when searching for
DBCS (Double Byte Character Set) characters.
64 Editors
Data Area Editor
Command Function
Note: The equal sign (=) used with the SCAN command is the default
input assign character. If another character has been specified as input
assign character (see session parameter IA described in the Parameter
Reference documentation), that other character must be used instead.
SET ABS [ON|OFF] Determines whether the SCAN command operates in absolute or
non-absolute mode.
If is set to V41, data area sources are stored in extended source format.
Editors 65
Data Area Editor
Command Function
You must supply an object name if you STOW a new data area
definition or if you want to copy the current data area. Otherwise, an
appropriate message appears.
See also Storing and Cataloging a Data Area.
66 Editors
Data Area Editor
The editor commands that can be used for navigating through the current data area are described
in the following section. You enter an editor command in the command line of the data area editor.
Command Function
ENTER Positions forwards one page.
or
+P
or
+
-P Positions backwards one page.
or
-
+H Positions forwards half a page.
-H Positions backwards half a page.
T Positions to top of source.
or
--
B Positions to bottom of source.
or
++
+nnnn Positions forwards nnnn lines (maximum 4 digits).
-nnnn Positions backwards nnnn lines (maximum 4 digits).
X Positions to the line marked with an X.
Y Positions to the line marked with a Y.
POINT Positions to the line in which the line command .N was entered.
Editors 67
Data Area Editor
Before a data area can be used in a Natural program (or another object), it must be saved and
cataloged as a source object and/or a cataloged object that is stored in a Natural library in the
current system file.
■ Use the system command SAVE, CATALOG or STOW as described in Saving and Cataloging Objects
in the Using Natural documentation.
Note: When you leave the data area editor with the EXIT editor command, the current source
code is saved automatically if the appropriate editor profile option is set accordingly as
described in Exit Function.
■ Use the editor options Source Save into and Auto Save Numbers as described in Editor Profile.
A copy of the source edited last with any of the Natural editors is then automatically saved
as a source object in the current Natural environment.
The data area editor uses an internal source format to store the sources of data areas in the FUSER
system file. New features and definitions that are available from Natural Version 4.1 onwards re-
quire that the data area source is stored in the FUSER system file using an extended source format.
Data areas that are stored using the extended source format cannot be used or edited with Natural
Version 3.1 where a different source format was used. The data area editor of Natural Version 4.1
and above supports the Natural Version 3.1 format and the extended source format. The editor
can read both formats and converts the Natural Version 3.1 format to the extended source format.
As long as no Natural Version 4.1 (and above) features or definitions are used, data areas are
stored in the Natural Version 3.1 format by default. This format guarantees compatibility between
data area sources stored in a Natural Version 3.1 and a Natural Version 4.1 (and above) environ-
ment.
The source format to be used as a default for storing data areas can be specified with the user exit
routine GDA-EX01 (see User Exit for the Data Area Editor) or, during an editor session, with the
following editor command: SET SAVEFORMAT V31 or SET SAVEFORMAT V41.
68 Editors
Data Area Editor
The data area editor provides a user exit routine for specifying default settings. The source of the
user exit routine is provided in the library SYSEXT and named GDA-ES01. To activate this exit,
CATALOG or STOW the source object as GDA-EX01 and copy GDA-EX01 to the library SYSLIB. For
a detailed description, see the source object of GDA-ES01 in the library SYSEXT.
Exit Function
The effect of the EXIT editor command depends on the setting of the editor profile option Prompt
Window for Exit Function:
■ If set to N, the EXIT command leaves the editor and saves all modifications made to the current
source; no prompt window is displayed.
■ If set to Y, the EXIT command invokes the EXIT Function window whenever you execute the
command on a source that contains unsaved modifications (see also Modification Indicator).
If no modifications were made to the source, the window does not appear and the editor closes
without saving the source.
Option Explanation
Save and Exit Leaves the editor and saves all modifications made to the current source code.
Exit without Saving Leaves the editor without saving any modifications made to the current source code
since it was last saved.
Resume Function Neither leaves the editor nor saves any modifications; the prompt window is closed
and the current function is resumed.
Editors 69
70
6 Map Editor
The Natural map editor is used to create a Natural object of type map. A map is a screen layout
that can be referenced in a Natural object such as a program by using either an INPUT USING MAP
statement (for input maps) or a WRITE USING MAP statement (for output maps).
A map contains text fields and data fields. Text fields are literal strings and data fields are variables.
Data fields can be either user-defined variables or Natural system variables.
Once a map has been created, it can be stored as a source object and a cataloged object in a library
in a Natural system file.
Note: When using Natural Studio in a Windows environment, the map editor supports
fields with Unicode format and Unicode strings. However, when reading the source of a
Unicode map into the editing area of a map editor in a local mainframe or UNIX environ-
ment, all Unicode strings will be removed from the source.
Initializing a Map
Editing a Map
71
Map Editor
Processing Rules
Related Topics:
72 Editors
7 Components of the Map Editor
The following figure provides an overview of the various components of the map editor and also
shows the possible ways to get from one component to another. The characters along the arrowed
connection lines denote the function codes or commands that can be used to invoke a screen or
execute a command.
73
Components of the Map Editor
74 Editors
8 Summary of Map Creation
75
Summary of Map Creation
You define a map profile (that is, the field delimiters, format settings, context settings and filler
characters to be used) by selecting the required settings from a menu.
You define a map before or after you make the corresponding data definitions in the Natural ob-
ject(s) that reference the map, such as a program or data area. The two methods of defining a map
are described below:
■ First define a prototype map, next make the corresponding data definitions in the object that
references the map, then integrate the map into the application.
Fields can be defined directly in the map editing area. Each field is assigned a default name.
Subsequently, when the corresponding data definitions have been made in the respective object,
these data definitions can be assigned to the map fields (post assignment).
■ Define a map by using existing data definitions.
If data definitions already exist in an object that references the map, the map fields can be created
by using the data definitions contained in this object. In this case, all characteristics of the data
definitions are copied into the map.
Map fields can be created by either typing the field definitions directly in the map editing area or
by selecting data definitions from another Natural object as explained in Selecting Data Definitions.
Full-screen mode displays the map editing area where you actually design the map and enter
the field definitions.
In split-screen mode (this is the default setting), the upper half of the editing screen can be used
to display data definitions of other Natural objects. The lower half of the screen displays the
map editing area.
■ Screen positioning commands.
■ Line commands, which are used to define tables and manipulate lines.
76 Editors
Summary of Map Creation
■ Field commands, which are used to define arrays and manipulate fields.
■ Editor facilities, which are used to edit processing (validation) rules.
Once a map has been defined as described in the previous steps, it can be saved as a source object
and/or cataloged object in the current library and Natural system file. Once saved as a source object,
the map can be read and modified during a subsequent map editor session. Once saved as a
cataloged object, the map can be invoked from a Natural program.
Note: The map editor uses the Auto Save Numbers function of the program and data area
editors described in Editors - General Information.
Editors 77
78
9 Invoking and Leaving the Map Editor
79
Invoking and Leaving the Map Editor
There are different commands you can use to invoke the editor for creating a new map or editing
an existing one.
EDIT MAP
Or:
E M
(command abbreviation)
If there is already a map in the source area, the map definition of this map is displayed in the
map editing area (see also Editing a Map). You can clear the source area by entering the system
command CLEAR before you invoke the map editor.
If the source area is empty, an Edit Map menu similar to the example below appears:
Code Function
---- ---------------------------------
D Field and Variable Definitions
E Edit Map
O Outline Editor
X Migration of Maps created with KAPRI
I Initialize new Map
H Initialize a new Help Map
M Maintenance of Profiles & Devices
S Save Map
T Test Map
W Stow Map
? Help
. Exit
Command ===>
80 Editors
Invoking and Leaving the Map Editor
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Exit Test Edit
Note: The menu options Outline Editor and Migration of Maps created with KAPRI
only appear if Natural for MBCS is installed.
The Edit Map menu is the main menu of the map editor. The fields contained in the menu
are described below:
Field Explanation
User The Natural user ID of the current user.
Library The Natural library ID currently in effect.
Code The code of the function to be executed (see Functions in the Edit Map Menu).
Name The source object which contains the map or help map.
For multi-lingual maps, one digit of the source object name should be reserved for the language
code. For example:
where & is replaced with the content of the system variable *LANGUAGE at execution time.
Profile The session profile currently in effect.
The profile name is set to the current library ID. If this profile ID is not available, it is set to
the current user ID. If this profile ID is not available, the profile name is set to SYSPROF.
EDIT map-name
E map-name
If a map with the specified name exists as a source object in the current library and has not
been locked by another user, the map definition of this map is displayed in the editing area
of the map editor (see also Editing a Map).
Editors 81
Invoking and Leaving the Map Editor
Locking of a map avoids concurrent source updates and depends on the current setting of
the profile parameter SLOCK (see also SLOCK - Source Locking in the Parameter Reference docu-
mentation).
Or:
If the map you want to edit is still contained in the source area from an earlier editor session,
you can also use the following command:
E M
■ In the Edit Map menu, press PF3 or enter a period (.) in the Code field.
Or:
Note: The map editor uses the current setting of the editor profile option Leave Editor with
Unlock which determines whether to unlock source code when leaving the map editor.
This option is described in General Defaults in Editor Profile in the section General Information.
82 Editors
10 Functions in the Edit Map Menu
83
Functions in the Edit Map Menu
This function can be used to view or edit all map fields, parameters and local variables used by
the map.
The Field and Variable Definitions function is equivalent to the line command ..E, which can
be entered in the map editing area (see also Line Commands in Editing a Map).
The Field and Variable Definitions function invokes the Field and Variable Definitions - Sum-
mary screen, which displays the following information for each map field:
Column Explanation
Name Field name.
Mod Field mode (type of field):
S System variable.
U User-defined field.
84 Editors
Functions in the Edit Map Menu
The following line commands and PF keys are available on the Field and Variable Definitions -
Summary screen:
The following commands are available in the PARAMETER DEFINITIONS or LOCAL DATA
DEFINITIONS window:
Command Explanation
A Defines an array.
D Deletes a variable.
Note: Command D does not delete a parameter if this parameter is still applied to any map field
as an attribute control variable, start value or help parameter.
- - Goes to the top of the window.
. Exits the window.
Edit Map
Invokes the map editing screen to modify an existing map or help map definition.
The map editor starts an editing session in split-screen mode. If the map being edited is a help
map definition, full-screen mode is in effect.
Editors 85
Functions in the Edit Map Menu
Outline Editor
Invokes the outline editor of Natural for MBCS, which is the primary tool for creating boxes for
map fields.
The boxes created with the outline editor are generated as BX parameters into the map source and
can be edited with the extended field editing function (see the relevant section) of the map editor.
See also Delimiter Character D and Using the Outline Editor in the Natural for MBCS documentation.
Invokes a migration function that converts maps created with Natural Version 3.1 and KAPRI (a
product by Beacon IT) into maps that are suitable for compilation and execution with Natural for
MBCS.
See also Migration of Maps Created with KAPRI in the Natural for MBCS documentation.
This function can be executed only if no object with the same name is stored in the Natural system
file. See also Initializing a Map.
This function should be used to create a help map, since it offers you the most flexibility when
entering and editing text (leading blanks must be entered). It also provides additional checks to
ensure that a valid help map is created.
The function can be executed only if no source object and no cataloged object with the same name
is present in the Natural system file.
A help map is stored as a map and can be referenced with the parameter HE in the map definition.
86 Editors
Functions in the Edit Map Menu
When initializing or editing a help map, you can specify in the map settings where the help map
is to appear on the screen at execution time.
This function allows you to add, modify or delete session, map and device profiles.
A session profile is used to assign default map settings to be used when a map or a help map is
initialized.
A map profile defines the map settings to be in effect during map definition and execution.
A device profile defines the standard characteristics and settings for a device. This profile can be
used to ensure compatibility between the map definition and the device to be used.
Save Map
The map definition is saved as a source object in the current Natural library in the current system
file.
Test Map
The current map definition is tested to ensure that it can be executed successfully. This includes
testing of all processing rules (including Predict rules) and help facilities.
When testing a map, any additionally created numeric map parameters are initialized with the
value 1.
Editors 87
Functions in the Edit Map Menu
Stow Map
The map definition is saved as a source object and cataloged object in the current Natural library
and system file.
Help
This function invokes the help facility of the map editor with information on all functions provided
by the map editor.
Or:
In the Command line of the Edit Map menu, enter a question mark (?).
A help screen appears for the selected topic or another menu is invoked with further help
topics that help narrow down your search.
In addition to the help facility, the map editor provides individual information on any input field
available on any map editor screen.
■ Place the cursor in the field for which you require help and press PF1.
Or:
In the field for which to invoke help, enter a question mark (?).
Depending on the field selected, a screen with appropriate help information appears or a
window from which you can select a valid input value.
88 Editors
11 Initializing a Map
■ Delimiters ...................................................................................................................................... 90
■ Format .......................................................................................................................................... 93
■ Context ......................................................................................................................................... 95
■ Filler Characters .............................................................................................................................. 97
89
Initializing a Map
This section describes how to define the settings (profile) for a new map or help map.
When you select the function Initialize New Map or Initialize a New Help Map, the first screen
to be invoked is the Define Map Settings screen shown in the example below:
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Exit Let
Delimiter class D (see Delimiters) only appears if Natural for MBCS is installed.
The sections contained in the Define Map Settings screen are described in the following section.
Delimiters
The Delimiters section of the Define Map Settings screen displays the default delimiters that
apply to the current map.
A delimiter is used to assign characteristics to a field. Field characteristics are the class (for example,
input/output field), attribute (for example, typeface) and color settings of a field.
Note: Attributes, colors and print modes require corresponding hardware features, and
will be ignored at runtime if these features are not available. See also the session parameters
AD, CD and PM described in the Parameter Reference documentation.
90 Editors
Initializing a Map
Each class, attribute and color setting is denoted by a one- or two-letter code. For example, the
letter code A identifies an input field, the letter I identifies intensified. Class, attribute and color
can be combined in a delimiter character. A delimiter character, for example, specifies a field as
an input field (letter code A) and intensified (letter code I). In the example screen above, the delimiter
character for this combination (letter codes A and I) is the right parenthesis ( ) ).
A delimiter character is a non-alphabetical character that is prefixed to the field in the map editing
area. (See also Defining Map Fields for examples of delimiter usage.) To display or modify the
class, attribute and color settings assigned to a field by a delimiter character, use the extended
field editing function described in the relevant section. Any non-alphabetical character can be
defined as a delimiter character - except the control character for terminal commands, the control
character for map commands and the decimal notation character.
Letter codes and delimiter characters can be entered in the columns Cls (Class), Att (Attribute),
CD (Color Definition) and Del (Delimiter) or in the editing section provided by the extended field
editing function.
■ In the Delimiters section, in the columns Cls, Att, CD and/or Del, overwrite a value with the
value required, or, in a blank column, enter a value.
■ Before you initialize a map, on the Edit Map screen, in the Profiles field, replace the default
map profile SYSPROF by the name of the profile you created earlier with the function Mainten-
ance of Profiles & Devices (see Functions in the Edit Map Menu).
The profile SYSPROF can only be modified by the Natural system administrator.
The table below lists and explains all valid letter codes for class, attribute and color that can be
entered in the columns Cls (Class), Att (Attribute) and CD (Color Definition) or in the extended
field editing section.
Editors 91
Initializing a Map
Delimiter Class D
Delimiter class D must be defined in the map settings to create boxes for map fields by using the
outline editor and the map editor. Delimiter class D allows the definition of boxes for text fields
and blank areas (characters) contained in a map.
For maps created with KAPRI (a product by Beacon IT), delimiter class D is automatically added
to the map setting when initially reading in the map definitions into the source area of the map
editor. Delimiter class D is then entered with the attributes D (Default) and I (Intensified), and two
of the following delimiter characters, which depends on the delimiter characters already used:
$&/()=?@*+'#><|!"^;,:._-§. Delimiter class D is also added automatically when you create a
map definition with the Initialize Map or the Initialize a new Help Map function by using the
default SYSPROF map profile supplied with the current Natural version.
A text field for which you want to create a box must start with the delimiter character you assigned
to delimiter class D. A field prefixed with this delimiter character is then considered an extended
text field, which can be edited with the extended field editing function of the map editor as de-
scribed in the relevant section.
An extended text field that has been defined as a native DBCS (Double Byte Character Set) field
is represented by a series of Ks in the map editing area. See also the PM field described in Fields
in the Extended Text Field Editing Area.
Blank characters for which you define a box are considered a blank text field. When using the
features of the outline editor, a blank text field is automatically added to the map with the delimiter
character that represents class D. In the map editing area, depending on the field length, the delimiter
character is followed by one or more periods (.), where each period represents a blank character.
A blank field with a length greater than zero (0) is considered an extended text field, which can
be edited (or created) with the extended field editing function of the map editor as described in
the relevant section.
92 Editors
Initializing a Map
Format
Field Explanation
Page Size The number of map lines to be edited (1 - 250); if Standard Keys (see below) is set to Y, the
number of lines is restricted to 3 - 250.
For a map which is output with a WRITE statement, you specify the number of lines of the
logical page output with the WRITE statement, not the map size. Thus, the map can be
output several times on one page.
Line Size The number of map columns to be edited (5 - 249).
Column Shift Column shift (0 or 1) to be applied to the map. This feature can be used to address all 80
columns on an 80-column screen (Column Shift = 1, Line Size = 80). Positional commands
(PF10, PF11) must be used to edit all map positions.
Layout The name of a map source definition which contains a predefined layout.
dynamic Y Specifies the layout to be dynamic. The dynamically used layout does not become a
fixed part of the map at compilation time, but is executed at runtime. Thus, subsequent
modifications of a layout map become effective for all maps using that layout map.
If the layout map includes user-defined variables, you have to define these parameters
in the map using the layout map. Input fields and modifiable fields in the layout map
are not open at runtime. Parameters can be added by pressing PF9 within the Field
and Variable Definitions function.
N Specifies the layout to be static. The static layout is copied into the source area when
a map is initialized. Filler characters are not transferred.
Zero Print Y Displays a field value of all zeros as one zero only.
This value is copied into the field definition when a new field is created and can be
modified for individual fields using the extended field editing function (see the relevant
section).
Case Default UC Indicates that all input entered for fields at map execution time
is to be converted to upper case, that is, the session parameter
AD=T is used as a field default. See also AD - Attribute Definition
in the Parameter Reference documentation.
Editors 93
Initializing a Map
Field Explanation
N Moves the cursor automatically to the next field in the map at execution time when
the current field is completely filled.
Decimal Char The character to be used as the decimal notation character. This character can only be
changed with the GLOBALS command.
Standard Keys Y Leaves the last two lines of the map blank so that function-key specifications can be
entered at execution time.
Justification The type of field justification to be used for numeric and alphanumeric fields taken from
the data definitions in another Natural object:
L Left justified
R Right justified
This value is copied into the field definition when a new field is created.
Print Mode The default print mode for variables:
94 Editors
Initializing a Map
Field Explanation
This value is copied into the field definition when a new field is created.
Control Var The name of an attribute control variable, the content of which determines the attribute
characteristics of fields and texts that have the attribute definition AD=Y or Y. The attribute
control variable referenced in the map must be defined in the program using that map.
Removing an attribute control variable from the format map settings implies that the
attribute control variable is removed from the map, too, unless it is associated with any
other map field.
Context
Field Explanation
Device Check If a device name is entered in this field, the map settings are checked for compatibility
with the device profile of the specified device. If a setting is not compatible, a warning
message is issued (see also Maintenance of Profiles & Devices in the section Functions
in the Edit Map Menu).
WRITE Statement Marking this field with a non-blank value produces a WRITE statement at the end of
the map definition process. The resulting map can then be invoked from a Natural
program using a WRITE USING MAP statement. Blank lines at the end of the map are
automatically deleted so that the map can be output several times on one page.
INPUT Statement Marking this field with a non-blank value causes the result of the map definition process
to be an INPUT statement. The resulting map can then be invoked from a Natural
program using an INPUT USING MAP statement.
Help The name of a helproutine or help map which is invoked at execution time when the
help function is invoked for this map (global help for map). The syntax that applies to
entering values in the Help field corresponds to the syntax of the HE session parameter
described in HE Parameter Syntax (Parameter Reference documentation).
as field default Y Specifies that the helproutine or help map entered in the
Help field is to apply as default to each individual field
on the map, which means that the name of each field is
passed individually to the helproutine.
Editors 95
Initializing a Map
Field Explanation
This field only appears if you define the map settings for a help map created with the
Initialize a new Help Map function. This field replaces the Help and as field default
fields on the Define Map Settings for HELPMAP screen.
Automatic Rule The rank (priority) assigned to Predict automatic rules when they are linked to the map
Rank during field definition. Default is 1.
Profile Name The name of the profile which was active at map initialization time.
The name of the profile active at the time the map is created is stored within the map.
When the map is edited later and another profile is active, a warning is produced but
editing is allowed.
96 Editors
Initializing a Map
Filler Characters
Filler characters can be assigned to indicate whether information for a field is mandatory and
whether the field must be completely filled:
Filler characters can also be defined for individual fields using the extended field editing function
(see the relevant section). For definition of field types, see also the session parameter AD described
in the Parameter Reference documentation.
Editors 97
98
12 Editing a Map
99
Editing a Map
Screen Modes
The map editor begins an editing session always in split-screen mode. In split-screen mode, the
upper half of the map editor screen contains data definitions of other Natural objects (as described
in Selecting Data Definitions) and/or the current delimiter settings, and the lower half of the screen
contains the editing area as shown in the example below:
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
You can leave the map editing area by pressing PF3 or by entering a period (.) in the Ob input fields
in the upper section of the screen.
100 Editors
Editing a Map
The PF keys and commands listed below can be used to invoke an editor function or navigate in
the map editing area; you enter the commands at the beginning of a map line:
Switches between the editing area of the map editor and the outline editor.
Editors 101
Editing a Map
Line Commands
..line-command
where the two periods (..) represent two occurrences of the control character in effect for the map
definition.
We recommend that you enter a blank at the end of each line command. This prevents the editor
from attempting to interpret any information existing on the line as part of the line command.
Command Explanation
..A Array table definition (see the section Array and Table Definitions).
..An Array table definition with n occurrences.
This command can be used to create a table with n occurrences vertically for all fields specified
in the current line.
..C Centers a single line (that is, the line in which the command was entered).
Two ..C commands entered on the same screen center the first line and adjust the rest of the
selected lines.
..Cn Centers the line and moves the n-1 lines below it accordingly.
..C* Centers the line and moves all lines below it accordingly.
..D Deletes a single line (that is, the line in which the command was entered).
Two ..D commands entered on the same screen delete the block of lines delimited by these
commands.
..Dn Deletes the line and the n-1 lines below it.
..D* Deletes the line and all lines below it.
If the delete operation affects array elements, the array is deleted in total.
..E Invokes the Field and Variable Definitions - Summary screen of the Field and Variable
Definitions function (see Functions in the Edit Map Menu) for all fields contained in the line.
Two ..E commands entered on the same screen display all fields within the range of lines
delimited by these commands for possible extended field editing.
..En Invokes the Field and Variable Definitions - Summary screen of the Field and Variable
Definitions function (see Functions in the Edit Map Menu) for the line and the n-1 lines below it.
102 Editors
Editing a Map
Command Explanation
..E* Invokes the Field and Variable Definitions - Summary screen of the Field and Variable
Definitions function (see Functions in the Edit Map Menu) for the line and all lines below it.
The ..E commands display a screen with the name and Natural data format/length of the
requested fields. The field names shown can be modified. The Cmd column can be used to select
the required function: extended field editing, array definition and processing rule editing.
..Fc Fills the blank spaces of a line with the character c.
..I Inserts a single line.
The last blank line on the screen is deleted in order to allow for the line insertion.
..In Inserts n lines below the line in which the command was entered.
..I* Inserts as many lines as possible below the command line.
..J Joins the line in which the command was entered with the line below it.
Two ..J commands entered on the same screen joins the range of lines delimited by the
commands.
..Jn Joins the line in which the command was entered with the n-1 lines below it.
..J* Joins the line with all lines below it.
If a join operation results in a line being too long, the lower line is split at the rightmost possible
position and the left part is then joined with the previous line. The right part of the split line is
then shifted to the left to align it with the line in which the command was entered.
..L Invokes the Modify INCDIR Statements of Map screen which can be used to list and update
the INCDIR statements generated for map fields that were copied from DDMs (data definition
modules). For detailed instructions, see Checking and Correcting References to DDMs.
..M Moves the line in which the command was entered below the cursor line.
If two ..M commands are entered on the same screen, the block of lines delimited by the
commands is moved below the line marked with the cursor.
..Mn Moves the line and the n-1 lines below it below the line marked with the cursor.
..M* Moves the line in which the command is entered and all lines below it to the line below the line
marked with the cursor.
This command is only practical if the line marked with the cursor is above the line in which the
command is entered.
..P Invokes PF-key processing rule editing.
PF-key processing rules are special processing rules to define activities assigned to program
sensitive PF keys.
..Pn Invokes PF-key processing rule editing for rank level n.
..P* Lists all processing rules defined for the PF keys in this map.
..Q Terminates map editing and returns to the Edit Map menu.
Editors 103
Editing a Map
Command Explanation
..R Repeats once all literal strings on the line in which the command was entered. The cursor position
is used to indicate the target line.
If two ..R commands are entered on the same screen, the literal strings within the block of lines
delimited by the commands are repeated.
..Rn Repeats all literal strings on this and the n-1 following lines. If the cursor is located below the
command line, the same text is repeated n times.
..S Splits the line at the cursor position.
If two ..S commands are entered on the same screen, the block of lines delimited by the
commands are split.
..Sn Splits the line where the command is entered and the n-1 lines below it at the cursor position.
..X Only applies if Natural for MBCS is installed.
Switches between the editing area of the map editor and the outline editor. As an alternative to
this line command, you can use PF13.
Field Commands
.field-command
where the period (.) represents the control character in effect for the map definition. Each command
must begin in the first position of a text or data field.
A field command can be applied to a range of fields or constants. A range can be specified in any
of the following ways:
■ Two or more of the same field commands can be used on the same screen. The column range
(horizontal range) and the line range (vertical range) are determined by the positions of the
commands. (The Map Editor Tutorial provides examples which illustrate this.)
■ A repetition factor n can be used. It can be enclosed within parentheses. The command is applied
to the designated field and also to the fields in the n-1 lines below it. A repetition factor * (asterisk)
causes repetition until the bottom of the map is reached.
We recommend that you enter a blank at the end of each field command. This prevents the editor
from attempting to interpret part of the field as part of the field command.
104 Editors
Editing a Map
Command Explanation
.A Defines an array. This command can be applied to a single field only and not to a range of fields.
The array definition (see Array and Table Definitions) is specified on the screen provided. The
resulting array is positioned with its left upper corner at the position where this command was
entered.
To center a range of fields, enter .C in the first and last field to be centered, or enter .C in the
first field and position the cursor to the last field to be centered.
In the event that an adjoining field or fields are not present, the column boundaries in effect for
the map definition are used instead.
.D Deletes a field or a range of fields.
To delete a range of fields, enter .D in the first and last field to be deleted. The field range to be
deleted may extend beyond a single line. If an array element is deleted, the entire array is deleted.
.E Invokes the extended field editing function (see the relevant section) for the field at which the
cursor is currently positioned. This command can be applied only to a single field and not to a
range of fields.
Extended field editing can also be invoked by positioning the cursor to the selected field and
pressing PF5.
.J Joins fields located on consecutive lines.
The left boundary of the join operation corresponds to where the .J command is entered and
the right one corresponds to the cursor position.
.M Moves a field or a range of fields.
To move a single field, enter .M in the field to be moved and place the cursor at the target position.
To move a range of fields, enter .M in the first and last field to be moved and place the cursor at
the target position.
.P[n] Edits processing rules (see the relevant section) for a field.
Supply a parameter n with the .P command to indicate the priority (rank) of the processing rule
to be edited. If necessary, the value specified for n can be enclosed in parentheses (()).
Editors 105
Editing a Map
Command Explanation
.R Repeats (copies) a field or a range of fields.
To copy a single field, enter .R in the field to be copied and place the cursor at the target position.
To copy a range of fields, enter .R in the first and last field to be copied and place the cursor at
the target position.
Repetition is always done downwards and from left to right. Fields generated by this command
are assigned a dummy name. A valid name for each such field must be defined by using the post
assignment function or the extended field editing function (see the relevant section).
Enter .S in the field at which splitting is to begin and place the cursor at the target position. The
line is divided at the position where the .S command was entered. The right portion is then
moved to the cursor position.
.T Truncates (deletes) a field or a range of fields from a line.
Enter .T in the field at which truncation is to begin. If this command is used to truncate (delete)
an array element, the entire array is deleted.
106 Editors
13 Defining Map Fields
107
Defining Map Fields
Map fields are defined directly in the map editing area by entering a delimiter character followed
by the number of positions to be allocated for the field. The following characters can be used:
Character Meaning
9 Numeric position
0 Numeric right justified
. Decimal notation (numeric field only)
S Sign position (numeric field only)
HH Hexadecimal (binary) (must be entered in groups of two)
X Alphanumeric position
A repetition factor can also be specified in the form (n), for example, X(5) is equivalent to XXXXX.
The following are examples of field definitions (the delimiter character can be changed as required):
Fields entered as shown above are assigned a dummy field name by the map editor. Each field
must be assigned a name prior to map execution by using either the extended field editing or
post assignment function (see the relevant sections). Other field formats can be specified using
the extended field editing function.
A map field can be defined by selecting a data definition from another Natural object. Data
definitions are either field definitions in a DDM or variable definitions. For a list of objects that
can be used to select data definitions, see Object Types and Codes.
Programs, subroutines, subprograms and helproutines can only be used if they contain a DEFINE
DATA statement.
108 Editors
Defining Map Fields
Restrictions of Selection:
Input and modifiable (input/output) fields can only be specified once in the map editing area.
Or:
Leave the first input field (denoted by an underscore) of the upper left Ob input fields blank
and enter a question mark (?) in the second input field or press PF1 (Help). If required, delete
any remaining characters in this line.
When you press ENTER, the Select an Object screen appears with a list of all objects contained
in the current library. You can press ENTER to scroll down the list. In the Select field, enter the
number that corresponds to the object you want to select.
3 Press ENTER.
The data definitions in the DEFINE DATA section of the Natural program (in the following ex-
ample, program TEST) are displayed in the upper left section of the map editing screen.
To scroll in the list of data definitions, in the Ob input fields, overwrite the existing entries
(in the following example, P TEST) with any of the following positioning commands and
leave the remaining characters:
Editors 109
Defining Map Fields
Command Explanation
+ Scrolls down one page in the list.
++ Scrolls to the end of the list.
- Scrolls up one page in the list.
-- Scrolls to the beginning of the list.
+n Scrolls down n lines.
-n Scrolls up n lines.
4 To display the data definitions of another object, in the Ob input fields in the upper right
screen section, enter a valid object code (see Object Types and Codes) followed by an object
name and delete any remaining characters in this line.
For example:
Ob P TEST Ob L LDA01
1 #NAME-START A20 A #NAME-START A20
2 #NAME-END A20 B #NAME-END A20
3 #MARK A1 C #PERS-ID A8
. EMPLOYEES-VIEW *V1 D #MAKE A20
4 PERSONNEL-ID A8 E #MODEL A20
5 NAME A20 .
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
Or:
■ In the map editing area, in any position of a blank line, enter a delimiter character followed
by the sequential number or letter displayed next to the data definition required. For ex-
ample:
(3
110 Editors
Defining Map Fields
Selects the data definition assigned to the number 3 (in the example above, #MARK).
:C
Selects the data definition assigned to the letter C (in the example above, #PERS-ID).
■ Press ENTER.
The characteristics of the data definitions (name, format, length or array definitions) are
copied into the map.
You can display or modify the copied values by using the map editor's field editing functions
described in the sections Extended Field Editing and Array and Table Definitions.
For each map field copied from a DDM, an INCDIR statement is automatically generated into the
map source. The INCDIR statement contains the name of the DDM file and field referenced by the
map field. You can check whether an INCDIR statement contains an invalid DDM reference by
switching on the CHKRULE option of the COMPOPT system command. Natural then issues an appro-
priate error message when you catalog the map definition. For detailed information, see CHKRULE
- Validate INCDIR Statements in Maps in the System Commands documentation.
From the map editing area, you can list all INCDIR statements and change the name of a DDM if
required.
1 In any line of the editing area, enter the following line command:
..L
A Modify INCDIR Statements of Map screen similar to the example below appears with a
list of all INCDIR statements generated into the source of the current map definition:
Editors 111
Defining Map Fields
AUTOMOBILES NUMBER-OF-CYLINDERS
EMPLOYEES MIDDLE-I
AUTOMOBILES HORSEPOWER
EMPLOYEES NAME
AUTOMOBILES PISTON-DISPLACEMENT
EMPLOYEES MIDDLE-NAME
AUTOMOBILES WEIGHT
EMPLOYEES MAR-STAT
AUTOMOBILES COLOR
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Exit GenC -- - + ++
The list contains the names of all DDM files and DDM fields from which you copied a map
field.
2 If required, change the DDM name for a INCDIR statement by replacing the name(s) in the
DDM Name column.
Or:
Press PF5 to open the Generic Change window. In the New DDM Name field, enter the name
of the new DDM to be used by all INCDIR statements that reference this DDM.
The DDM name(s) in the corresponding INCDIR statement(s) are updated when you save the
map definition by using either the Save Map or Stow Map function.
Listed below are the object types and the corresponding object-type codes that can be used to select
data definitions:
112 Editors
Defining Map Fields
Natural system variables can also be specified in a map definition. For information about system
variables, see System Variables and System Functions in the Programming Guide and the detailed
variable descriptions in the System Variables documentation.
A system variable must be preceded by an output delimiter as indicated in the following examples:
(*TIME
(*DATE
(*APPLIC-ID
Editors 113
114
14 Extended Field Editing
115
Extended Field Editing
The extended field editing function is used to define additional attributes for fields.
In the line that contains the field(s) for which you want to define additional attributes, enter
the following line command:
..E
For additional options, see also Line Commands in the section Editing a Map.
Or:
In the field for which you want to define additional attributes, enter the following field com-
mand:
.E
Or:
Execute function D (Field and Variable Definitions) for the map that contains the required
field(s).
On the Field and Variable Definitions - Summary screen that appears, next to the field for
which you want to define additional attributes, enter the following line command:
.E
For a data field, an extended field editing area similar to the example below is displayed in
the upper section of the map editor screen:
116 Editors
Extended Field Editing
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
.EXXXXX
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
HELP Mset Exit <--- ---> -- - + < > Let
Note: The BX field only appears if Natural for MBCS is installed and if the terminal or
terminal emulation supports box viewing.
If Natural for MBCS is installed, for a text field created with delimiter class D, an extended
text field editing area similar to the example below appears:
-------------------------------------------------------------------------------
AD= I_________ CD= __ PM= __ BX= ____ Hex Editing .. N
Value Field1________________________________________________________________
______________________________________________________________________
______________________________________________________________________
______________________________________________________________________
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
.Eield1
Editors 117
Extended Field Editing
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
HELP Mset Exit <--- ---> -- - + < > Let
It is possible to invoke the extended field editing function for the next or previous field in the
map editing area by pressing PF4 or PF5 respectively.
■ Press PF3.
Or:
Choose ENTER.
The fields contained in the extended field editing area of the editor screen are described in the
following table:
Field Explanation
Fld The field or array name. If the name is longer than the available space, enter the command .E at the
Arr beginning of the line to open additional space.
The name entered in the Fld or Arr field depends on the method used when creating the field:
■ If the field was copied from a variable in another Natural object, the variable name used in this
object is entered.
■ If the field was copied from a DDM field, the name of the DDM followed by the field name used
in the DDM is entered; for example, EMPLOYEES.PERSONNEL-ID where EMPLOYEES denotes the
name of the DDM and PERSONNEL-ID the name of the field defined in this DDM.
■ If the field was specified as a Natural system variable, the name of the specified variable is entered.
■ If the field is neither of the above, it is assigned a dummy name. You must assign a name to a field
prior to map execution.
The name of a field can be changed. However, a prefix cannot be used for a field which did not have
a prefix assigned previously. To obtain a prefixed field name, select the field from a data definition
in another Natural object.
118 Editors
Extended Field Editing
Field Explanation
Note: Duplicate field names are only allowed for fields defined as output-only fields.
To define a reference to a dynamic alphanumeric variable, specify (D) or DYNAMIC behind the entry.
The AL parameter will automatically be set either to the specified value or the maximum length
available on the screen.
AL The length to be used when displaying the field. For dynamic variables and long variables the length
is automatically set, but can be modified.
or
FL These fields correspond to the session parameters AL, FL and NL respectively.
For detailed information on using this field and valid input values, see AL - Alphanumeric Length for
or Output, FL - Floating Point Mantissa Length, and NL - Numeric Length for Output in the Parameter
NL Reference documentation.
Rls The number of processing rules currently defined for the field.
ZP Zero printing.
You can only enter a value in ZP if the field is numeric or a time system variable.
This field corresponds to the session parameter ZP. For detailed information on using this field and
valid input values, see ZP - Zero Printing in the Parameter Reference documentation.
SG Sign position.
You can only enter a value in SG if the field is numeric or a time system variable.
This field corresponds to the session parameter SG. For detailed information on using this field and
valid input values, see SG - Sign Position in the Parameter Reference documentation.
PM Print mode.
This field corresponds to the session parameter PM. For detailed information on using this field and
valid input values, see PM - Print Mode in the Parameter Reference documentation.
DF Date format (only applies to date fields).
This field corresponds to the session parameter DF. For detailed information on using this field and
valid input values, see DF - Date Format in the Parameter Reference documentation.
DY Dynamic string attributes.
The dynamic string parameter is used to define certain characters contained in the text string of an
alphanumeric variable to control the attribute setting.
This field corresponds to the session parameter DY. For detailed information on using this field and
valid input values, see DY - Dynamic Attributes in the Parameter Reference documentation.
HE The HE option is used to assign a helproutine or a help map to the map field. A helproutine or help
map is then invoked at execution time when a help request is made for the map field. For detailed
Editors 119
Extended Field Editing
Field Explanation
information, see the description of the HE session parameter in HE Helproutine in the Parameter Reference
documentation.
In the HE field, you can enter the name of a helproutine or help map and the parameters to be passed
to this helproutine or help map. If you require additional input space, use the field command .E or
enter a plus sign (+) in the field to invoke an extra window with additional input lines.
The syntax that applies to specifying names and parameters in the HE field corresponds to the syntax
of the HE session parameter described in HE Parameter Syntax (Parameter Reference documentation).
In addition to the syntax explanations provided there, the following applies when using the map
editor:
operand1:
■ If a variable name is specified which corresponds to the name of a map field, this field must be in
the Natural data format/length A8.
■ If a variable name is specified for which no map field yet exists, a map parameter with that name
is automatically defined in the Natural data format/length A8.
operand2:
■ If a variable name is specified for which no map field yet exists, a map parameter with that name
is automatically defined in the Natural data format/length N7.
Removing a parameter from the HE field implies that the parameter is also removed from the map,
unless the parameter is a map field or is associated with any other map field as a help parameter or
Starting from value (see Array Definition).
AD Field attributes.
This field corresponds to the session parameter AD. For detailed information on using this field and
valid input values, see AD - Attribute Definition in the Parameter Reference documentation.
For source optimization reasons, the default values D, H, F and W are accepted but not retained (see
also the session parameter AD).
CD Color attributes.
This field corresponds to the session parameter CD. For detailed information on using this field and
valid input values, see CD - Color Definition in the Parameter Reference documentation.
BX Box definitions specified with the BX parameter.
For detailed information on using this field and valid input values, see BX - Box Definition in the
Parameter Reference documentation.
BX parameter settings are usually made automatically with the features of the outline editor.
This field only appears if Natural for MBCS is installed and if the terminal or terminal emulation
supports viewing boxes. Otherwise, the BX settings will be ignored at execution time.
120 Editors
Extended Field Editing
Field Explanation
CV Attribute control variable for dynamic field attributes.
This field corresponds to the session parameter CV. For detailed information on using this field and
valid input values, see CV - Attribute Control Variable in the Parameter Reference documentation.
Caution: Removing an attribute control variable from a field implies that the attribute control variable
is removed from the map, too, unless it is associated with any other map field.
EM Edit mask to be used for the field.
This field corresponds to the session parameter EM. For detailed information on using this field and
valid input values, see EM - Edit Mask in the Parameter Reference documentation.
In the map editing area, a field that uses an edit mask is denoted by an M.
If the mask exceeds the available space, enter the command .E at the beginning of the line to open
additional space.
SB The name of an array in which the values for a selection box are provided. The indicator V will be
displayed to show that a selection box is available.
The format of the source field applies. You can change it in the Parameter Definitions window.
Mod Mode indicates how the field was created:
Data The field was created by selecting a field from a DEFINE DATA definition.
Undef The field was created directly on the screen and has a dummy name.
User The name of the field was created using the extended field editing function
(see the relevant section).
View The field was created by selecting a field from a view (file).
Editors 121
Extended Field Editing
The fields contained in the extended text field editing area of the editor screen are described in
the following table:
Field Explanation
AD Field attributes.
This field corresponds to the session parameter AD. For detailed information on using this field
and valid input values, see AD - Attribute Definition in the Parameter Reference documentation.
This field corresponds to the session parameter CD. For detailed information on using this field
and valid input values, see CD - Color Definition in the Parameter Reference documentation.
PM Print Mode.
This field corresponds to the session parameter PM. For detailed information on using this field
and valid input values, see PM - Print Mode in the Parameter Reference documentation.
If you enter D in this field (PM=D) to define an extended text field as a native DBCS field, the
characters of the extended text field are represented by one or more pairs of the letter K in the
map editing area. See also Value.
BX Box definition specified with the BX parameter.
For detailed information on using this field and valid input values, see BX - Box Definition in
the Parameter Reference documentation.
BX parameter specifications are usually made automatically with the features of the outline
editor.
Hex If you enter Y (Yes), the Text Field Hex Editing window appears in which you can modify the
Editing hexadecimal equivalent of the non-blank or blank value entered in the Value field.
You can create a blank text field with the map editor by replacing the hexadecimal values of
an existing text field by 00. For example, for a text field with value TEST (see Value below),
you would replace its equivalent hexadecimal string A385A2A3 by 00000000.
The default setting of the Hex Editing field is N (No).
Value The alphanumeric character string of an extended text field or a blank value for an extended
blank text field, which is represented by a number of periods (.) in the map editing area. This
field can also contain a double-byte character if D is entered in the PM field. If the terminal
emulation supports DBCS, Value shows the decoded graphic of such a character.
122 Editors
Extended Field Editing
Field Explanation
You can change the current value by replacing either the character string in the Value field or
the equivalent hexadecimal values entered in the Text Field Hex Editing window.
Editors 123
124
15 Post Assignment of Fields
A field which has been previously defined in the screen layout of a map may be assigned the field
name and field attributes of a DDM field definition or a DEFINE DATA definition.
Note: Duplicate field names are only allowed for fields defined as output-only fields.
A map field which has been created from a DDM can be redefined by using the appropriate DDM
field definition from this DDM or a DEFINE DATA definition.
Post assignment can be done by entering the number (or letter) assigned to a DDM field definition
as described in Selecting Data Definitions.
Post assignment can only be done if the format of the layout agrees with the field definition. N and
P are considered to be identical numeric.
Post assignment cannot be used for view arrays (in a DDM field definition or a DEFINE DATA
definition) if one or more dimensions of that array are smaller than the dimensions of the array
in the layout.
If a length conflict occurs, an AL/FL/NL attribute is generated to map the field definition to the
layout definition with truncation or expansion. Data is truncated when AL/FL/NL is specified.
125
126
16 Array and Table Definitions
127
Array and Table Definitions
The array definition function is used to define the occurrences and layout of an array (X-arrays
are not supported).
Array definition is initiated by the field command .A or by issuing the line command ..E and then
marking the required field with the function code A.
The table definition function is used to define the occurrences and layout of more than one array
at the same time. The arrays must begin in the same map line.
Array Definition
The upper portion of the following screen is displayed for the purpose of array definition:
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
.AXXXXX
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit -- - + < > Let
128 Editors
Array and Table Definitions
Field Explanation
Top Dim Indicates the top dimension of the array; that is, the highest occurrence (from left to right)
in the first, second and third dimension.
If a field defined in a program is used to define the map array, the upper bounds of that
field (user-defined variable or database field), as defined in the program, are used; these
cannot be overwritten on the array definition screen.
If you select a map array from a data definition in another Natural object, the dimensions
of the map array must not exceed the dimensions shown in this field.
If you do not select a map array from a data definition, the dimensions of the map array
must not exceed the dimensions as defined in the Natural program.
Dimensions An array can have up to three dimensions. The order in which the dimensions of the array
are mapped to the map layout is determined by the values entered to the left of the Index
operands.
Occurrences The number of occurrences to be defined for a dimension.
Starting from The starting index value for a dimension. A numeric value can be used, or a variable name
can be used to indicate that the actual value is supplied in the Natural program which
invokes the map definition.
If the variable is not defined otherwise as a field in the map, it is assumed to be of Natural
data format/length N7. If so, it can be edited using PF9 in the Field and Parameter Definition
screen.
Note: Removing a Starting from value from an array implies that the variable is removed
from the map, too, unless it is a map field or it is associated with any other map field as a
Starting from value or help parameter. To edit Starting from values, press PF9 in the Field
and Variable Definitions - Summary screen.
Spacing The number of blank lines (for vertical dimensions) or blank columns (for horizontal
dimensions) to be inserted between each dimension occurrence.
Editors 129
Array and Table Definitions
Example 1:
Example 2:
Example 3:
A two-dimensional array. The first dimension consists of 10 vertical occurrences with 1 blank line
between neighboring occurrences. The second dimension consists of 5 horizontal occurrences with
2 blank columns between neighboring occurrences.
130 Editors
Array and Table Definitions
Example 4:
Example 5:
A three-dimensional array. The first dimension consists of 3 vertical occurrences with 1 blank line
between neighboring occurrences. The second dimension consists of 5 horizontal occurrences with
2 blank columns between neighboring occurrences. The third dimension consists of 2 occurrences,
expanded vertically within each occurrence of the first dimension.
Example 6:
An example of using Starting from. The first dimension consists of 10 vertical occurrences starting
from index I. I is defined in the map editor with Natural data format/length N7 by default. The
second dimension consists of 5 horizontal occurrences starting from the index 3.
Editors 131
Array and Table Definitions
Example 7:
An example of making a two-dimensional display from a one-dimensional array. The array consists
of 40 elements. It is displayed in two columns with 20 lines each. This is achieved by specifying 0
as the horizontal index.
Table Definition
A table of one or more arrays which all begin in the same map line is defined with the ..A line
command. When you enter the ..A line command, the following screen is invoked:
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit -- - + Let
132 Editors
Array and Table Definitions
Note: When applying the ..A command to arrays which were not defined by an ..A com-
mand but by an .A command, may result in a modification or even a destruction of these
arrays.
Field Explanation
Main Index The number of vertical occurrences, the starting position and the number of lines to be
skipped between dimension occurrences.
Second Index The direction (horizontal or vertical), the starting position and the number of
lines/columns to be skipped between dimension occurrences.
The second dimension only applies if one of the arrays has more than one dimension.
In this case the second dimension can be displayed either horizontally (in which case
there must be enough space in the line for all selected occurrences) or vertically (in
which case there must be enough lines on the map to display main dimension times
second dimension occurrences, including line spacing).
Third Index The direction (horizontal or vertical), the starting position and the number of
lines/columns to be skipped between dimension occurrences.
The third dimension only applies if one of the arrays has more than two dimensions.
In this case the third dimension can be displayed either horizontally (in which case
there must be enough space in the line for all selected occurrences) or vertically (in
which case there must be enough lines on the map to display main dimension times
second dimension times third dimension occurrences, including line spacing).
Name of Variable All names of field arrays contained in the table are displayed.
Col Pos The column position in which the field is located. This is displayed for informational
purposes only.
Dimension Size The upper bounds Ind1, Ind2 and Ind3 of an array.
The dimensions of the array defined in the map must not exceed the dimensions of the
corresponding array defined in the Natural object that invokes the map.
Order The order in which the dimensions are to be defined: M, S and T correspond to Main,
Second and Third.
2. Occ. The number of occurrences to be defined for the second index.
3. Occ. The number of occurrences to be defined for the third index.
Editors 133
Array and Table Definitions
This is an example of defining map fields that correspond to the following program definition:
DEFINE DATA
1 ARRAY1 (A3/1:10)
1 ARRAY2 (A5/1:10,1:2)
1 ARRAY3 (A7/1:10,1:2,1:3)
END-DEFINE
Table Definition:
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit -- - + Let
ARRAY1 is a one-dimensional array with ten occurrences. The first two occurrences are expanded
in the table.
ARRAY2 is a two-dimensional array. The first index consists of ten occurrences and the second index
consists of two occurrences. The first two occurrences of the first index and both occurrences of
the second index are expanded in the table.
ARRAY3 is a three-dimensional array. The first index consists of ten occurrences, the second index
consists of two occurrences and the third index consists of three occurrences. The first two occur-
rences of the first index, both occurrences of the second index and all three occurrences of the third
index are expanded in the table.
134 Editors
Array and Table Definitions
Table Layout:
The table is defined as a collection of arrays which share the following characteristics:
■ The number of occurrences of the main index must be the same for each array of the table. The
main index is always expanded vertically.
■ All elements of a specific index must be placed in the same line. Thus, spacing between the
elements of a specific index depends on the array with the largest dimension.
Editors 135
136
17 Processing Rules
137
Processing Rules
Inline processing rules are defined within a map source and do not have a name assigned. The
availability of Predict is not required for inline rules.
Predict free rules have a name assigned and are stored in Predict.
To edit a free rule, enter the rule during map creation and assign a name to it. Inline rules can be-
come Predict rules (and vice versa) by assigning/removing the rule name.
Predict automatic rules apply to database fields and are defined by the Predict administrator.
When a field is selected from the data definitions in another Natural object, all automatic rules for
that field are linked to the map definition. All automatic rules are concatenated and treated as a
single map rule.
The rank of the automatic rules is defined in the map settings (default is 1).
Automatic rules cannot be modified using the map editor. They can, however, be assigned a dif-
ferent rank either by using the command P=n or by just overwriting the old rank.
Note: If a field with linked Predict processing rules is renamed, the rules are lost and must
be linked again.
An ampersand (&) within the source code of a processing rule is dynamically replaced by the
fully-qualified name of the field for which the rule is defined. Array indexes are not affected by
the replacement; you must explicitly specify the index notation after the ampersand (&) as shown
in the following example.
Examples:
IF & = ' ' THEN REINPUT 'ENTER NAME' MARK *& /* For a scalar field
IF &(1) = ' ' THEN MOVE 'X' TO &(*) /* For an array field
The field name notation &.field-name within the source code of a processing rule allows you to
have DDM-specific rules that cross-check the integrity of values between database fields, without
having to explicitly qualify the fields with a view name. As field-name you specify the name of
the database field as defined in the DDM, and at compilation time, Natural dynamically qualifies
the field by replacing the ampersand (&) with the corresponding view name. This allows you to
use the same processing rule for specific fields, regardless of which view the fields are taken from.
138 Editors
Processing Rules
Function-key-related processing rules can be used to assign activities to program sensitive function
keys (PF keys) during map processing. For PF keys which already have a command assigned by
the program, this command is executed without any rule processing.
Example:
IF *PF-KEY = 'PF3'
ESCAPE ROUTINE
END-IF
When this rule is executed, map processing is terminated without further rule processing.
Processing-rule editing is invoked by the field command .P, or by issuing the line command ..E
and then placing the function code P next to the field for which processing rule editing is to be
performed. PF-key processing rule editing is invoked by the command ..P.
A parameter can be used (.Prr) to indicate the rank (priority) of the processing rule to be
defined/edited. A field can have up to 100 processing rules (rank 0 to 99). At map execution time,
the processing rules are executed in ascending order by rank and screen position of the field. PF-
key processing rules are always assumed to have the first screen position.
For optimum performance, the following assignments are recommended when assigning ranks
to processing rules:
Editors 139
Processing Rules
Note: When modifying or adding a processing rule, keep in mind that you must recatalog
the map(s) that reference this rule so that the changes become effective.
If you enter the field command .P* in a map field, you obtain a list of all processing rules defined
for the field.
If you enter the line command ..P* in any map line, you obtain a list of all processing rules defined
for the PF keys used in this map.
On each list, the Predict rules are identified by their names, the inline rules by their first three
source code lines. From each list you can select a rule for editing by entering its rank.
The screen for processing rule editing (with a processing rule example) is shown below:
140 Editors
Processing Rules
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test -- - + Full Sc= Let
During processing rule editing you can switch between split-screen and full-screen mode using
PF9 or SPLIT/SPLIT E command. The upper half of the split screen displays the definitions of all
map fields (except system variables). This display can be positioned by split-screen commands.
The source code used to define the processing rule is entered/edited in the same way as with the
Natural program editor.
Direct Commands
While working in the processing-rule editor, processing rules can be edited by entering one of the
following commands in the editor command line (>). In the table below, an underlined portion of
a keyword represents an acceptable abbreviation. For further explanations of the syntax characters
used in this table, refer to System Command Syntax in the System Commands documentation.
Command Explanation
ADD[(n)] Adds n blank lines to the source code.
See the more detailed description of the ADD command in Editor Commands
in the Program Editor documentation.
CHANGE Scans for the value entered as string1 and replaces each such value found
'string1'string2' with the value entered as string2.
CHECK Checks the rule.
CLEAR Clears the editing area (including the line markers X and Y).
DX Deletes the X-marked line; or the Y-marked line; or the block of lines delimited
by X and Y.
or
DY
or
DX-Y
EX Deletes source lines from the top of the source area to, but not including, the
X-marked line; or from the source line following the Y-marked line to the bottom
or of the source area; or all source lines in the source area excluding the block of
EY lines delimited by X and Y.
or
EX-Y
EXIT Terminates the rule editing function and returns to map editing.
.
P Positions forward to the next rule defined for the field.
P* Selects a rule from the selection menu.
Prr Selects the rule with rank rr.
Editors 141
Processing Rules
Command Explanation
P=rr Changes the rank of a processing rule to rank rr.
POINT Positions the line in which the line command .N was entered to the top of the
current screen.
RESET Deletes the current X and/or Y line markers and any marker previously set with
the line command .N.
SAVE name Saves a rule as copycode with the name name.
SCAN ['scan-value'] Scans for data in the source area. Entering SCAN without any parameter displays
the SCAN/REPLACE menu. Entering SCAN 'scan-value' results in a scan
for scan-value.
SCAN = [+|-] Scans for the next occurrence of the scan value. The direction of the scan
operation is determined by the setting of the direction indicator.
See the more detailed description of the SCAN commands in Editor Commands
in the section Program Editor.
SHIFT [-|+nn] Shifts each source line delimited by the X and Y markers to the left or right. nn
represents the number of characters the source line is to be shifted. Comment
lines are not shifted.
SHIFT -- Shifts each source line delimited by the X and Y markers to the leftmost position.
Comment lines are not shifted.
SHIFT ++ Shifts each source line delimited by the X and Y markers to the rightmost
position (maximum 99 positions). Comment lines are not shifted.
SPLIT [E] Switches between split-screen mode and full-screen mode. See also SPLIT in
Editor Commands for Positioning.
TEST Tests a map.
UNLINK Unlinks an inline or Predict free rule from the field.
Note: To select a rule from all Predict free rules, enter a question mark (?) in the rule name
field of the processing rule editing screen.
Editor commands for positioning are entered in the command line (>) of the rule editor. The
commands available are listed in the following table; an underlined portion of a keyword represents
an acceptable abbreviation.
142 Editors
Processing Rules
Command Explanation
+P Positions forwards one page.
+
-P Positions backwards one page.
-
+H Positions forwards half a page.
-H Positions backwards half a page.
TOP Positions to top of rule.
--
BOTTOM Positions to bottom of rule.
++
+nnnn Positions forwards nnnn lines (maximum 4 digits).
-nnnn Positions backwards nnnn lines (maximum 4 digits).
nnnn Positions to line nnnn.
X Positions to the line marked with X.
Y Positions to the line marked with Y.
SPLIT[-|--|+|++] Positions backwards (- or --) or forwards (+ or ++) in the split screen.
Line Commands
In addition to the editor commands, the following line commands can be used when editing a
processing rule:
Command Explanation
.C(nnnn) Copies the line in which the command was entered.
.CX(nnnn) Copies the X-marked or the Y-marked line. See also the commands .X and .Y in the
following section.
or
.CY(nnnn)
.CX-Y(nnnn) Copies the block of lines delimited by the X and Y markers.
If the direction indicator is a plus sign (+), the copied lines are placed after the line
in which the command was entered. If the direction indicator is a minus sign (-),
the copied lines are placed before the line in which the command was entered.
.D(nnnn) Deletes line or lines. The default is 1 line.
.I(n) Inserts n blank lines. With the next ENTER, lines that are left blank are eliminated
again.
Editors 143
Processing Rules
Command Explanation
.I(obj,ssss,nnnn) Inserts an object contained in the current library or in the steplib into the source.
The ssss entry can be used to indicate the line number at which the insert operation
is to begin.
The nnnn entry can be used to indicate the number of lines to be inserted.
For detailed information on the .I line commands, see Line Commands in the section
Editing a Map.
.J Joins the current line with the next line.
If the resulting line length is greater than the length of the editor screen line, the
line is marked with L and must then be separated again using the .S command (see
below), before it can be modified.
.L Ignores all modifications that have been made to the line since the last time ENTER
was pressed.
.MX Moves the X-marked or the Y-marked line. See also the commands .X and .Y below.
or
.MY
.MX-Y Moves the block of lines delimited by the X and Y markers.
If the direction indicator is set to a plus sign (+), the moved lines are placed after
the line in which the command was entered. If the direction indicator is set to a
minus sign (-), the moved lines are placed before the line in which the command
was entered.
.P Positions the line marked by this command to the top of the screen.
.S Splits the line at the position marked by the cursor.
.W Inserts n blank lines.
With the next ENTER, lines that are left blank are eliminated again.
.X Marks a line, or the beginning of a block of lines, to be processed.
.Y Marks a line, or the end of a block of lines, to be processed.
Note: If both the commands .X and .Y are applied to one line, it is treated as being
marked with X and with Y; the line marker actually shown to reflect this status is a
Z.
144 Editors
18 Map Editor Tutorial
This tutorial provides a general introduction to using the Natural map editor where explanations
are kept to a minimum. For a comprehensive description of all map editor functions, refer to the
section Map Editor.
The layout of the example screens (24x80) provided in the tutorial and the behavior of Natural
described here can differ from your results. For example, the command or message line may appear
in a different screen position, or the execution of a Natural command can be protected by security
control. The default settings in your environment depend on the system parameters set by your
Natural system administrator.
Important: It is important that you work through the exercises in the sequence indicated
below. Otherwise, you may not accomplish the results intended by the exercises.
Opening the Map Editor Invoking the map editor menu and initializing a map.
Creating, Positioning and Deleting Map Creating map fields and placing them in the required map
Fields position.
Testing and Saving a Map Testing and saving a map as an object module.
Naming Fields and Saving/Cataloging a Giving names to map fields and saving/cataloging a map
Map as object modules.
Defining Field Properties Using extended field editing to define field properties.
Creating and Testing a Help Map Creating and testing a help map for a map field.
Invoking a Map with INPUT USING Creating and executing a program that invokes a map
MAP with the INPUT USING MAP statement.
Creating a Map for WRITE and Copying Creating a map by copying fields from another Natural
Field Definitions object. Changing the map settings to use the WRITE
statement.
145
Map Editor Tutorial
Reusing the Layout of a Map Creating a map from another map layout.
Invoking a Map with WRITE USING Creating and executing a program that invokes a map
MAP with the WRITE USING MAP statement.
146 Editors
19 Opening the Map Editor
In this session, you will invoke the map editor, specify map settings and open the map editing
screen.
1 In the Natural Main Menu, select Development Functions and press ENTER.
Enter an S in the first position of the Mode input field and press ENTER.
Code Function
---- ---------------------------------
D Field and Variable Definitions
E Edit Map
I Initialize new Map
H Initialize a new Help Map
M Maintenance of Profiles & Devices
S Save Map
147
Opening the Map Editor
T Test Map
W Stow Map
? Help
. Exit
Command ===>
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Exit Test Edit
The Edit Map menu is the main menu of the map editor.
Tip: The map editor contains an extensive help system. Any time you require help,
enter a question mark (?) in the field for which you want to obtain further information.
This will invoke the online help for that field. If a field does not have an individual
help assigned, a help menu will be displayed, from which you can select the required
item of information.
5 Enter an I (for Initialize new Map) in the Code field and MAP001 in the Name field.
6 Press ENTER.
148 Editors
Opening the Map Editor
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Exit Let
7 Move the cursor to the Filler Characters section of the screen. Type in an underscore ( _ ) after
each of the four options as shown below:
Editors 149
Opening the Map Editor
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Exit Let
This will cause any blank positions within an input field on the map to be filled with the un-
derscore ( _ ). You can then see the exact position and length of a field which makes entering
input easier.
8 Ignore the other map settings and press ENTER twice.
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
The screen appears in split-screen mode: the top half displays the delimiter characters, which are
valid for the map to be created, and the bottom half is the editing area where you actually design
a map.
You can now proceed with Creating, Positioning and Deleting Map Fields.
150 Editors
20 Creating, Positioning and Deleting Map Fields
151
Creating, Positioning and Deleting Map Fields
1 In the first line of the editing area of MAP001, enter the line command ..F*, and, in the second
line, type in the text PERSONNEL INFORMATION as shown below:
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
2 Press ENTER.
152 Editors
Creating, Positioning and Deleting Map Fields
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
3 Press PF9.
The map editing screen changes to full-screen mode: the delimiter characters are hidden.
4 In the bottom line, enter the line command ..F*.
5 Press ENTER
Editors 153
Creating, Positioning and Deleting Map Fields
*******************************************************************************
PERSONNEL INFORMATION
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
1 In the first three positions of the text, enter the line command ..C as shown below:
*******************************************************************************
..CSONNEL INFORMATION
154 Editors
Creating, Positioning and Deleting Map Fields
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
2 Press ENTER.
*******************************************************************************
(*DATX PERSONNEL INFORMATION
(*TIMX
Editors 155
Creating, Positioning and Deleting Map Fields
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
*DATX and *TIMX are Natural system variables, which display the current date and time re-
spectively. The opening parenthesis (() is the delimiter character for intensified (highlighted)
output fields. The colon (:) is the delimiter character for intensified modifiable fields. The
number of Xs indicates the length of the field.
2 Press ENTER.
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
156 Editors
Creating, Positioning and Deleting Map Fields
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
Moving Fields
1 In the editing area, enter the field command .M and move the cursor to the position indicated
by [] as shown below. The [] sign is used to show the cursor position, you must not enter
this sign.
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
Editors 157
Creating, Positioning and Deleting Map Fields
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
2 Press ENTER.
The text field in which the command was entered is moved to the cursor position:
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
ENTER CITY::XXXXXXXXXXXXXXXXXXXX
PLEASE ENTER NAME::XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
PLEASE
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
158 Editors
Creating, Positioning and Deleting Map Fields
3 Enter the line command ..M as shown below and move the cursor to the position indicated
by [] as shown below:
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
4 Press ENTER.
Editors 159
Creating, Positioning and Deleting Map Fields
The line in which the command was entered is moved to the line after the one in which the
cursor is positioned:
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
160 Editors
Creating, Positioning and Deleting Map Fields
To join lines
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
2 Press ENTER.
Editors 161
Creating, Positioning and Deleting Map Fields
The line in which the command was entered and the line below it are joined:
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
1 Type in additional text in the same order and position as shown below:
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
162 Editors
Creating, Positioning and Deleting Map Fields
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
2 Press ENTER.
3 Enter the field command .M twice and move the cursor to the position indicated by [] as
shown below:
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
[]
Editors 163
Creating, Positioning and Deleting Map Fields
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
The block of fields to be moved is delimited by the .M commands and the widths of the fields
to which these commands apply. In this example, the block starts with the top left field THIS
and ends at the last field COMMANDS. The widest field COMMANDS (which extends into two or
three fields contained in the previous lines) determines which fields within the marked block
are moved.
4 Press ENTER.
The marked block of fields is moved to the cursor position with the top left field being placed
at the cursor:
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
OF TEXT IS
DEMONSTRATION
THIS PORTION
FOR FURTHER
OF THE MOVE
COMMANDS
164 Editors
Creating, Positioning and Deleting Map Fields
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
5 Enter the field command .M twice as shown below and move the cursor to the position indicated
by [] as shown below:
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
.M TEXT IS
.MMONSTRATION
THIS PORTION[]
FOR FURTHER
OF THE MOVE
COMMANDS
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
6 Press ENTER.
Editors 165
Creating, Positioning and Deleting Map Fields
The block of fields delimited by the commands is moved to the cursor position:
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
7 Enter the field command .M three times and move the cursor to the position indicated by []
as shown below:
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
[]
166 Editors
Creating, Positioning and Deleting Map Fields
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
8 Press ENTER.
The entire block of fields delimited by the commands is moved to the cursor position:
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
Editors 167
Creating, Positioning and Deleting Map Fields
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
9 Enter the line command ..M twice and move the cursor to the position indicated by [] as
shown below:
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
[]
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
10 Press ENTER.
168 Editors
Creating, Positioning and Deleting Map Fields
The block of lines delimited by the commands is inserted below the line in which the cursor
is positioned. (The old block of lines is deleted from its previous location.)
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
Editors 169
Creating, Positioning and Deleting Map Fields
To delete fields
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
2 Press ENTER.
170 Editors
Creating, Positioning and Deleting Map Fields
The field in which the command was entered and the fields in the rest of the line are deleted:
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
THIS PORTION
FOR FURTHER DEMONSTRATION
OF THE MOVE
COMMANDS
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
THIS PORTION
FOR .DRTHER DEMONSTRATION
Editors 171
Creating, Positioning and Deleting Map Fields
OF THE MOVE
COMMANDS
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
4 Press ENTER.
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
THIS PORTION
FOR DEMONSTRATION
OF THE MOVE
COMMANDS
172 Editors
Creating, Positioning and Deleting Map Fields
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
5 Enter the field command .M and move the cursor to the position indicated by [] as shown
below:
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
THIS PORTION
FOR [] .MMONSTRATION
OF THE MOVE
COMMANDS
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
6 Press ENTER.
Editors 173
Creating, Positioning and Deleting Map Fields
The field in which the command was entered is moved to the cursor position:
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
THIS PORTION
FOR DEMONSTRATION
OF THE MOVE
COMMANDS
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
174 Editors
Creating, Positioning and Deleting Map Fields
OF THE MOVE
..D COMMANDS
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
8 Press ENTER.
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
Editors 175
Creating, Positioning and Deleting Map Fields
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
To insert lines
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
*******************************************************************************
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
2 Press ENTER.
Four blank lines are inserted, and the bottom line with the asterisks is moved four lines down.
176 Editors
Creating, Positioning and Deleting Map Fields
Editors 177
178
21 Testing and Saving a Map
In this session, you will test the layout of a map, leave the map editing area, and save a map as a
source object.
The map is shown in the layout view in which it will appear on the screen when executing
the program that references the map:
*******************************************************************************
07-12-14 PERSONNEL INFORMATION
15:26:05
179
Testing and Saving a Map
*******************************************************************************
2 Press PF3.
The Field and Variable Definitions - Summary screen appears. This screen will be discussed
in a later session of this tutorial.
4 Press ENTER.
The Edit Map menu appears with the Name field set to MAP001.
5 In the Code field, enter an S and press ENTER.
The map is stored as a source object with the name MAP001 in the current Natural library in
the current system file.
180 Editors
22 Defining Processing Rules
In this session, you will define processing rules for a map field.
1 In the Code field of the Edit Map menu, enter an E and, in the Name field, enter MAP001.
The map editing screen appears in split-screen mode and map MAP001 is displayed in the
editing area.
2 Enter the field command .P as shown below:
181
Defining Processing Rules
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
3 Press ENTER.
The processing rule editor for the field in which the command was entered appears:
182 Editors
Defining Processing Rules
The ampersand (&) in the processing rule will be dynamically substituted by the name of the
field to which the processing rule is attached.
5 Press ENTER and then PF3.
The processing rule is executed and the text entered in the rule appears:
*******************************************************************************
07-12-14 PERSONNEL INFORMATION
16:04:15
Editors 183
Defining Processing Rules
*******************************************************************************
PLEASE TYPE IN A NAME
Note: The text PLEASE TYPE IN A NAME may not necessarily appear at the bottom of
the screen (as shown above) but on another line, depending on the position of the
message line as set by the Natural administrator.
8 In the first position of the input field next to PLEASE ENTER NAME:, enter any character and
press ENTER.
The processing rule for rank (priority) 0 of the field where the command was entered is dis-
played again.
10 Enter the command P=5 as shown below:
184 Editors
Defining Processing Rules
0080
0090
0100
0110
0120
0130
0140
0150
0160
0170
0180
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test -- - + Full Sc= Let
11 Press ENTER.
The processing rule which was previously assigned to rank 0 is now assigned to rank 5 (pro-
cessing rules are processed in ascending order of rank, starting with rank 0).
12 Enter the command P0 as shown below:
13 Press ENTER.
Editors 185
Defining Processing Rules
An empty processing rule editor screen is displayed, because there is no longer any processing
rule assigned to rank 0.
186 Editors
Defining Processing Rules
0180
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test -- - + Full Sc= Let
You can now proceed with Naming Fields and Saving/Cataloging a Map.
Editors 187
188
23 Naming Fields and Saving/Cataloging a Map
In this session, you will give names to the user-defined fields in a map and save and catalog a
map.
189
Naming Fields and Saving/Cataloging a Map
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit -- Parm Local Let
The fields contained in the map are listed in the order in which they appear on the map. The
two user-defined fields are assigned dummy names, which are preceded by a number sign
(#). These dummy names must be replaced to catalog the map.
2 Replace the dummy names as shown below:
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit -- Parm Local Let
The Edit Map menu appears with the Name field set to MAP001.
190 Editors
Naming Fields and Saving/Cataloging a Map
4 In the Code field, enter a W (for Stow Map) and press ENTER.
The Stow Map function executes the STOW command, which checks the syntax of MAP001
and stores the map definition as a source object and a cataloged object in the current Natural
library in the current system file.
Editors 191
192
24 Defining Field Properties
1 In the Code field of the Edit Map menu, enter an E and, in the Name field, enter MAP001 (if it
is not already entered).
The map editing screen appears and map MAP001 is displayed in the editing area.
2 Type in additional text as shown below:
193
Defining Field Properties
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
The question mark (?) shown in boldface is the delimiter character for intensified text fields.
3 Enter the field command .E as shown below:
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
4 Press ENTER.
194 Editors
Defining Field Properties
The extended field editing area for the field in which the command was entered appears:
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
HELP Mset Exit <--- ---> -- - + < > Let
5 In the Fmt field, replace the current value by A20, and, in the HE= field, enter 'HELP001'
(within apostrophes) as shown below:
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
*******************************************************************************
(XXXXXXXX PERSONNEL INFORMATION
(XXXXXXXX
Editors 195
Defining Field Properties
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
HELP Mset Exit <--- ---> -- - + < > Let
6 Press ENTER.
The extended field editing area disappears. HELP001 (which is yet to be created) is assigned
as the help routine/help map to the field and the field length is reduced to 20:
196 Editors
Defining Field Properties
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
You can now proceed with Creating and Testing a Help Map.
Editors 197
198
25 Creating and Testing a Help Map
In this session, you will create and test a help routine/help map for a map field.
1 In the Edit Map menu, enter an H in the Code field and HELP001 in the Name field.
2 Press ENTER.
199
Creating and Testing a Help Map
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Exit Let
....................................................
....................................................
....................................................
....................................................
....................................................
....................................................
....................................................
....................................................
....................................................
....................................................
....................................................
....................................................
....................................................
....................................................
....................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Split < > Let
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
200 Editors
Creating and Testing a Help Map
....................................................
Type in the name of an ....................................................
employee in the first ....................................................
field and press ENTER. ....................................................
You will then receive ....................................................
a list of all employees ....................................................
of that name. ....................................................
....................................................
For a list of employees ....................................................
of a certain name who ....................................................
live in a certain city, ....................................................
type in a name in the ....................................................
first field and a city ....................................................
in the second field ....................................................
and press ENTER. ....................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
...............................................................................
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Split < > Let
001 --010---+----+----+---030---+----+----+---050---+----+----+---070---+----
7 Press PF3.
The Edit Map menu appears with the Name field set to HELP001.
8 STOW help map HELP001 by using the appropriate menu function.
9 In the Code field, enter a T, and, in the Name field, enter MAP001.
10 Press ENTER.
Editors 201
Creating and Testing a Help Map
*******************************************************************************
07-12-14 PERSONNEL INFORMATION
16:58:37
The processing rule for the first field (#NAME) is tested and the following message is displayed:
PLEASE TYPE IN A NAME.
13 In the first position of the first field, enter any character and press ENTER.
You can now proceed with Invoking a Map with INPUT USING MAP.
202 Editors
26 Invoking a Map with INPUT USING MAP
In this session, you will create and execute the example program PROG001 to test the effect of the
INPUT USING MAP statement, which invokes map MAP001.
PROG001 is provided in the Natural system library SYSEXPG; ask your Natural system adminis-
trator for details.
1 If you have access to a copy of PROG001, in the Command line of the Edit Map menu, enter
the following:
EDIT PROG001
The program editor is invoked and the source code of PROG001 is displayed in the editing
area. Make sure that the program is identical to the one shown below.
Or:
If you do not have access to a copy of PROG001, in the Command line of the Edit Map menu,
enter the following:
EDIT PROGRAM
The program editor is invoked. If necessary, clear the editing area by entering the command
CLEAR at the program editor's command prompt (>). Then type in the following program:
203
Invoking a Map with INPUT USING MAP
PROG001:
2 If no program name is displayed in the top line of the editor, at the program editor's command
prompt, enter the command STOW PROG001.
Or:
If the program name PROG001 is displayed in the top line of the editor, at the program editor's
command prompt, enter the command STOW.
204 Editors
Invoking a Map with INPUT USING MAP
After the STOW completed successfully, the program is stored as a source object and a cataloged
object in the current Natural library in the current system file.
3 At the program editor's command prompt, enter the following:
RUN
Editors 205
Invoking a Map with INPUT USING MAP
6 Press ENTER.
MAP001 appears.
7 In the first input field of the map, enter the name JONES and, in the second input field, enter
the name DUNFERMLINE.
8 Press ENTER.
The following message is displayed: NO ONE BY THIS NAME LIVING IN THIS CITY.
9 In the first input field of the map, enter the name JONES and, in the second input field, enter
the name TULSA.
10 Press ENTER.
11 Press ENTER.
MAP001 appears.
12 In the first input field, enter a period (.) and press ENTER.
The editing area of the program editor appears with the source code of PROG001.
You can now proceed with Creating a Map for WRITE and Copying Field Definitions.
206 Editors
27 Creating a Map for WRITE and Copying Field Definitions
In this session, you will create a map by copying the field definitions from a DDM (data definition
module). In addition, you will change the map setting so that you can use the WRITE USING MAP
statement.
EDIT MAP
The WRITE Statement option is marked, which means that this map can only be invoked
from a program with a WRITE USING MAP statement.
5 Press ENTER twice.
V EMPLOYEES
7 Press ENTER.
207
Creating a Map for WRITE and Copying Field Definitions
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
208 Editors
Creating a Map for WRITE and Copying Field Definitions
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
This defines two fields for the map, whose definitions are to be copied from the DDM: the
sequential number 4 entered will copy the definition of the corresponding field NAME, and
number 2 will copy the definition of the corresponding field FIRST-NAME.
9 Press ENTER.
The field definitions in the DDM are copied into the map:
Editors 209
Creating a Map for WRITE and Copying Field Definitions
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
10 Use the field command .M to move the field positioned in the second line of the editing area
to the position shown below:
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
11 In the Ob input fields, replace the V by a plus sign (+) and press ENTER.
210 Editors
Creating a Map for WRITE and Copying Field Definitions
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
14 Press ENTER.
Editors 211
Creating a Map for WRITE and Copying Field Definitions
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
15 Press PF3.
212 Editors
28 Reusing the Layout of a Map
In this session, you will create a map by using the layout of another map.
1 From the Edit Map menu, execute the Initialize new Map function to create a map with the
name MAP003.
2 On the Define Map Settings for MAP screen, change Page Size to 60, mark WRITE Statement,
unmark INPUT Statement, and enter MAP002 next to Layout.
3 Press ENTER.
213
Reusing the Layout of a Map
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Exit Let
4 Press ENTER.
The map editing screen appears with the layout of map MAP002.
5 Delete CITY:(XXXXXXXXXXXXXXXXXXXX by using the field command .T.
6 Move the second of the remaining output fields to the position shown below by using the
field command .M.
214 Editors
Reusing the Layout of a Map
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
7 Insert the text FIRST NAME: into the line as shown below:
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Mset Exit Test Edit -- - + Full < > Let
8 Press PF3.
You can now proceed with Invoking a Map with WRITE USING MAP.
Editors 215
216
29 Invoking a Map with WRITE USING MAP
In this session, you will create and execute the example program PROG002 to test the effects of
the WRITE USING MAP statements, which invoke the maps MAP002 and MAP003.
To create PROG002
1 In the Command line of the Edit Map menu, enter the following:
EDIT PROG002
The program editor is invoked and the source code of PROG002 is displayed in the editing
area.
2 At the program editor's command prompt, enter the following:
SAVE PROG002
A copy of program PROG001 is saved as a source object under the name PROG002 in the
current Natural library in the current system file.
3 At the program editor's command prompt, enter the following:
READ PROG002
The source code of program PROG002 is displayed in the editing area of the program editor.
4 Replace the DISPLAY statements with the source code lines shown in boldface below:
217
Invoking a Map with WRITE USING MAP
PROG002:
5 When you have made all changes, at the program editor's prompt, enter the following:
STOW
218 Editors
Invoking a Map with WRITE USING MAP
The source of PROG002 is updated and a cataloged object is created and stored in the current
Natural library in the current system file.
To execute PROG002
PROG002
5 Press ENTER.
MAP001 appears.
6 Leave the name JONES and enter the city DERBY.
7 Press ENTER.
Editors 219
Invoking a Map with WRITE USING MAP
8 Press ENTER.
MAP001 appears.
9 In the first position of the NAME input field, enter a period (.).
220 Editors
30 SYSDDM Utility
The SYSDDM utility is used to create, maintain and delete Natural data definition modules (DDMs).
Principles of Operation
Listing DDMs
Creating DDMs
Cataloging a DDM
221
222
31 Principles of Operation
223
Principles of Operation
The SYSDDM utility is used to create a Natural DDM from a database file or from another DDM.
A Natural object (for example, a program or a data area) can only access a database file if a corres-
ponding DDM has been created for this file and saved as a cataloged object. For further details on
Natural DDMs, see Data Definition Modules - DDMs in the Programming Guide.
The following graphic illustrates the main features and basic principles of operation when pro-
cessing DDMs with the SYSDDM utility:
Storing DDMs
DDMs are stored in the Natural system file FDIC. The FDIC system file collects all DDMs available
in your Natural system environment. You can only store and access DDMs in the FDIC system
file.
DDMs are not restricted to files stored in an Adabas database. Some options described in the
SYSDDM Utility documentation only apply to Adabas and can be ignored if a different database
management system is used.
224 Editors
Principles of Operation
Restrictions of Use
The section below describes the restrictions that can apply to using SYSDDM utility functions
under:
■ Predict
■ Natural Security
Predict
To guarantee data integrity for DDMs defined in Predict, the Predict administrator can restrict
the use of SYSDDM utility functions for editing, copying, creating, deleting, renaming and cata-
loging, for which equivalent functions are provided by Predict.
In principle, we strongly recommend that you do not use any SYSDDM utility functions that can
alternatively be performed by Predict.
Natural Security
Access to DDMs can be restricted when Natural Security has been installed. Within the DDM se-
curity profile, there may be a definition of whether a DDM may be modified only by specific users
(DDM modifiers) or the owners of the security profile.
For further information, see Protecting DDMs On Mainframes in the Natural Security documentation.
Editors 225
226
32 Invoking and Terminating SYSDDM
This section provides instructions for invoking and terminating the utility SYSDDM.
SYSDDM
Or:
1. From the Natural main menu, choose Maintenance and Transfer Utilities to display the
Maintenance and Transfer Utilities menu.
2. From the Maintenance and Transfer Utilities menu, choose Maintain DDMs.
The menu of the SYSDDM utility appears as shown in the example below:
227
Invoking and Terminating SYSDDM
Command ===>
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Exit Canc
The fields and functions provided on the SYSDDM utility menu are explained in the section
Using SYSDDM Maintenance and Service Functions.
Or:
228 Editors
33 Using SYSDDM Maintenance and Service Functions
229
Using SYSDDM Maintenance and Service Functions
The functions provided in the SYSDDM utility menu are used to create, display, edit, rename or
delete a DDM.
This section describes the fields and functions available in the SYSDDM utility menu and provides
information on maintaining DDMs in different environments.
Help on Functions
This section provides instructions for obtaining information on the fields and functions provided
in the SYSDDM utility menu.
Or:
In the Command line, or in any input field, enter a question mark (?).
3 To exit the Help Main Menu, enter a period (.) or press PF3.
Performing a Function
This section provides instructions for performing a function from the SYSDDM utility menu.
To perform a function
230 Editors
Using SYSDDM Maintenance and Service Functions
■ From the section DDM Maintenance, List/Copy Services or Other Services choose the
one-digit code listed next to the function required and enter it in the Code field.
Description of Functions
This section describes the functions available on the SYSDDM utility menu and lists their corres-
ponding function codes:
For the naming conventions that apply when cataloging a DDM, refer to Object
Naming Conventions in the Using Natural documentation.
If the source area is empty, use the function Generate DDM from Adabas FDT
or Edit DDM to load a source into the source area.
For a DDM from VSAM (DDM Type set to V; see also DDM Type in DDM
Specification), SYSDDM prompts you for additional information.
For details, see Natural File Access in the Natural for VSAM documentation.
U Delete DDM Deletes one or more cataloged DDM from the FDIC system file.
The contents of the source area are not affected by the deletion.
When you delete a DDM with SYSDDM, the corresponding Natural Security
file profile is deleted too.
L List DDMs Displays a single DDM source (DDM editor not invoked) or a list of DDMs
stored in the specified FDIC system file similar to the Natural system command
LIST DDM described in the System Commands documentation. However, unlike
the system command LIST DDM, the List DDMs function additionally displays
all DDMs for which no read or update access right is defined in Natural Security
Editors 231
Using SYSDDM Maintenance and Service Functions
From the list of DDMs displayed on the LIST DDMs screen, you can select a
DDM for further processing by entering the line command that corresponds
to the action required in the Cmd column. For information on possible
commands, enter a question mark (?) in the Cmd column.
X List DDMs with Displays a list of DDMs stored in the specified FDIC system file. The list
Additional contains the following fields of information:
Information
232 Editors
Using SYSDDM Maintenance and Service Functions
From the list displayed on the screen List DDMs with Additional Information,
you can select a DDM for further processing by entering the line command
that corresponds to the action required in the Cmd column. For information
on possible commands, enter a question mark (?) in the Cmd column.
S Show Defined See Show Defined DBIDs and Used FNRs.
DBIDs and Used
FNRs
M Copy DDM to Copies one or more DDMs from one FDIC system file to another. This can be
Another FDIC required, for example, when a Natural application is transferred from test to
File production status.
This function invokes the Copy DDMs window of the Natural utility SYSMAIN
where you can specify source and target environment of the DDM(s) to be
copied; see also the section Processing DDMs in the SYSMAIN Utility
documentation.
G Generate DDM Generates a DDM from an Adabas field definition table (FDT) and places it in
from Adabas FDT the source area for further processing.
If 0 (zero) is entered as DBID, the default DBID specified with the UDB profile
parameter in the Natural parameter module (NATPARM) is used.
The generated DDM is placed in the source area for further processing.
B SQL Services Only available if Natural for DB2 (NDB) or Natural for SQL/DS (NSQ) is
(NDB/NSQ) installed.
SQL Services (NDB/NSQ) are used to generate DDMs from DB2 or SQL/DS
tables as described in SQL Services (Natural for DB2 documentation) and SQL
Services (Natural for SQL/DS documentation).
D DL/I Services Only available if Natural for DL/I is installed.
DL/I Services are used to maintain a Natural for DL/I environment. They
provide functions for inquiry into and modification of structures such as DL/I
Database Descriptions (DBDs), Program Specification Blocks (PSBs), Program
Communication Blocks (PCBs), DDMs and segment layouts.
Editors 233
Using SYSDDM Maintenance and Service Functions
This function shows you which database IDs (DBIDs) are defined, as well as all file numbers
(FNRs) of a given DBID for which DDMs have been defined.
When you invoke this function, a menu appears from which you can select the subordinate functions
described in the following section.
This function lists all DBIDs and appropriate database types specified with the Natural profile
parameter DB (see also DB - Database Types and Options in the Parameter Reference documentation).
The list does not contain the DBIDs of the default database type, which is shown at the top of the
screen.
This function lists for a given DBID all file numbers for which DDMs have been defined.
■ In the menu Show Defined DBIDs and Used FNRs, in the Code field, enter an F and, if re-
quired, modify the DBID entered by default.
Or:
On the screen Database IDs Defined in Natural, in the Command line, enter a DBID (valid
values are 1 - 65535) and press PF5.
234 Editors
Using SYSDDM Maintenance and Service Functions
DDM Specification
For each function provided in the SYSDDM utility menu, you can specify one or more parameters
that determine which DDM(s) are processed for which database. The section below describes the
fields where you enter these parameters.
Field Explanation
DDM Name The name of the DDM to be processed.
You can also specify a range of names: use asterisk (*) to process all DDMs or use asterisk
(*) notation to process particular DDMs.
For example: EMP* selects all DDMs with names that start with EMP.
Specifying ranges with the function Delete DDMs or Copy DDM to Another FDIC File
invokes the SYSMAIN utility where you can further process the DDMs; see also the section
Processing DDMs in the SYSMAIN Utility documentation.
FNR The file number (FNR) of the database file for which the DDM is (to be) defined.
The file number corresponds to the type of database. For example, if an Adabas file is
used, the Adabas file number must be entered.
If a DL/I segment type is used, the file number specified is used internally by Natural for
DL/I.
If 0 (zero) is specified, the database ID specified with the Natural profile parameter UDB
in the Natural parameter module NATPARM is used. See also UDB in the Parameter Reference
documentation.
Y Yes.
A DDM which is being copied or cataloged replaces an
existing DDM with the same name.
Editors 235
Using SYSDDM Maintenance and Service Functions
Field Explanation
N No.
Existing DDMs with the same name are not replaced.
This is the default setting.
This function corresponds to the REPLACE option of the command CATALOG described
in Editor and System Commands.
FDIC Type The database type of the system file.
Possible types are the same as for DDM Type (see below).
A Adabas
This is the default type.
V VSAM
2 DB2 or SQL
D DL/I
P PROCESS (Entire System Server)
C Command processor
S Super Natural
E Entire DB Engine
The type of DDM corresponds to the type of database referenced by the DDM.
Adabas The password required by Adabas if installed.
Password
DBID Type The database type of the database specified in the DBID field.
Possible types are the same as for DDM Type (see above).
Exception: for an Adabas database, the Adabas version (for example, 5, 6 or 7) is displayed.
236 Editors
34 Listing DDMs
This section provides instructions for displaying a list of all DDMs available in an FDIC system
file by using either the SYSDDM utility or the Natural system command LIST.
The LIST DDMs screen appears with a selection list of all DDMs contained in the specified
FDIC system file.
LIST DDM *
The LIST DDMs screen appears with a selection list of all DDMs contained in the current
FDIC system file.
For information on all options available with LIST, see the relevant section in the System Commands
documentation.
237
238
35 Creating DDMs
This section describes how to create a DDM by either copying DDMs or creating DDMs directly
from the field definitions in a database.
In the Code field, enter either function code E (Edit DDM) or G (Generate DDM from Adabas
FDT).
Leave the Name field empty.
In the DBID and FNR fields, enter the ID and file number of the database to be accessed by
the DDM you want to create (see also DDM Specification).
For function E: An empty Edit DDM screen appears where you can enter field definitions as
described in Using the DDM Editor Screen.
For function G: The DDM is generated automatically from the FDT (field definition table)
defined for the specified database and the Edit DDM screen appears with all relevant field
definitions.
2 Depending on the function used, on the Edit DDM screen either enter the field definitions
required (see Using the DDM Editor Screen) or modify the field definitions generated from
the FDT.
When you are finished editing the DDM, check the source and press PF3.
In the Name field, enter a valid DDM name (see also Object Naming Conventions in the Using
Natural documentation). For function G, the Name field is preset to the default name
239
Creating DDMs
FILE-file-number where file-number corresponds to the file number entered in the FNR
field.
In the Code field, enter function code C (Catalog DDM).
The DDM is saved as a cataloged object in the specified database ID and system file. See also
Cataloging a DDM.
1 For DB2, proceed as described in Generate DDM from an SQL Table in the Natural for DB2
documentation.
Or:
For SQL/DS, proceed as described in Generate DDM from an SQL Table in the Natural for SQL/DS
documentation.
2 Catalog the DDM as described in Cataloging a DDM.
240 Editors
Creating DDMs
2 Specify the source and target environments for the DDM(s) to be copied as described in Pro-
cessing DDMs in the SYSMAIN Utility documentation.
If you want to copy DDMs between different system files and/or hardware platforms, see also
Maintaining DDMs in Different Environments.
Editors 241
242
36 Invoking and Terminating the DDM Editor
243
Invoking and Terminating the DDM Editor
This section describes how to invoke and terminate the DDM editor by using the SYSDDM menu.
This section provides instructions for invoking the DDM editor from the SYSDDM menu for
modifying an existing DDM or creating a new one.
■ In the Code field of the SYSDDM menu, enter an E and, in the DDM Name field, enter the
name of a DDM.
If the specified DDM exists, the source code of the DDM is read into the source area and the
Edit DDM screen similar to the example below appears:
244 Editors
Invoking and Terminating the DDM Editor
To invoke the DDM editor for a new DDM, use one of the following methods
■ With Adabas, use the function Generate DDM from Adabas FDT described in Using SYSDDM
Maintenance and Service Functions.
With DB2, use the function Generate DDM from an SQL Table described in Using SYSDDM
Maintenance and Service Functions.
With DL/I, use the function Generate DDM from Segment Description described in DL/I
Services.
Or:
In the Code field of the SYSDDM menu, enter an E and leave the DDM Name field empty.
You can clear the source area by entering CLEAR in the Command line.
This section describes how to terminate an editor session and return to the SYSDDM utility menu.
■ After editing, checking and cataloging the DDM source (see Using the DDM Editor Screen
and Cataloging a DDM) contained in the source area, in the Command line of the Edit DDM
screen, enter a period (.) or press PF3.
Note: The DDM editor uses the editor profile option Leave Editor with Unlock to unlock
source code when leaving the DDM editor. This option is described in General Defaults in
Editor Profile in the section General Information.
Editors 245
246
37 Using the DDM Editor Screen
247
Using the DDM Editor Screen
The DDM editor screen (Edit DDM screen) is organized in a table where the field definitions data
is contained in rows and columns. All attributes that belong to a field defined for a DDM are
contained in one row (that is, source-code line), separated by tabs.
This section describes the columns contained on the DDM Editor screen and the commands
provided to create or modify a DDM field, navigate in the screen, or catalog a DDM source, for
example.
This section describes the fields contained in the header at the top of the Edit DDM screen.
ADA Adabas
VSAM VSAM
DB2 DB2
DL/I DL/I
PROCESS Entire System Server
CMD-PROC Command processor
SNAT Super Natural
ENTIREDB Entire DB Engine
DBID The database ID (DBID) as described for DBID in the section DDM Specification.
FNR The number of the file being referenced in the database as described for FNR in the
section DDM Specification.
DDM Name The name of the DDM currently contained in the work area of the DDM editor.
Def.Seq. The default sequence by which the file is read when it is accessed with a READ LOGICAL
statement in a Natural program. See also the READ statement described in the Statements
documentation.
The default sequence is specified with the two-character field short name. The system
validates the short name based on the selected file number. If the database is accessible,
the short name is checked against the corresponding field in the database file. If such
a field does not exist in the database, a selection list of valid short names is displayed.
If the database cannot be accessed, no selection list is generated.
248 Editors
Using the DDM Editor Screen
This section describes the field attributes that can be defined in the rows and columns of the Edit
DDM screen.
G Group.
A group is a number of fields defined under one common group name. This allows you
to reference several fields collectively by using the group name instead of the names of
Editors 249
Using the DDM Editor Screen
all the individual fields. Such fields cannot hold any data, but are only containers for
other fields.
Note: Groups defined in a DDM need not necessarily be defined as groups in the
Natural object(s) that reference this DDM.
M Multiple-value field.
This type of field can have more than one value within a record.
See also Multiple-Value Fields in the Programming Guide.
P Periodic group.
A group of fields that can have more than one value within a record.
See also Periodic Groups in the Programming Guide.
* Comment line.
L The level number assigned to the field.
Levels are used to indicate the structure and grouping of the field definitions. This is relevant
with view definitions, redefinitions and field groups (see the relevant sections in the Programming
Guide).
For DL/I segment types, the DB column displays the two-character code which is used in DL/I.
For fields of the type C (see the attribute T), this column contains the short name of the Adabas
descriptor used for file coupling.
Name The name of the field.
It can be 3 - 32 characters long for Adabas fields and SQL columns, and 1 -19 characters for DL/I
names.
The rules to create a name comply with the naming conventions for user-defined variables (see
the Using Natural documentation), except that the first character of the name must always be a
Latin capital letter (A - Z). In addition, the name must not start with L@, N@ or O@, where @ is the
character with hexadecimal value H'7C'. These prefixes identify indicator fields as explained in
the following section.
250 Editors
Using the DDM Editor Screen
For fields of the type C (see the attribute T), this column contains the short name of the Adabas
descriptor used for file coupling.
F The Natural data format of an elementary field, such as A (alphanumeric), P (packed numeric) or
L (logical).
For valid Natural data formats, refer to Format and Length of User-Defined Variables in the
Programming Guide.
Leng The standard length of an elementary field.
For numeric fields (Natural data format N), the length is specified as nn.m, where nn is the number
of digits before the decimal point an m is the number of digits after the decimal point.
In the Leng input field, you can specify either the field length as a numeric value or enter the
keyword DYNAMIC to specify that the field length is variable.
For fields of the type C (see the attribute T), this column contains the name of the DDM used for
file coupling.
S Not applicable to VSAM.
blank Indicates that standard Adabas suppression is used; that is, trailing blanks in
alphanumeric fields and leading zeros in numeric fields are suppressed.
F Indicates that the field is defined with the Adabas fixed storage option; that is,
no suppression is used and the field is stored without compression.
N Indicates that the field is defined with the Adabas null-value suppression option.
This means that null values for the field are not stored in the inverted list and
are not returned when the field is used in the WITH clause of a FIND statement,
or in a HISTOGRAM or READ LOGICAL statement.
Editors 251
Using the DDM Editor Screen
M Indicates that the field is defined with the SQL null-value option not null. The
Remark field (see Specifying Extended Field Attributes) for this field contains NN
NC (not null, not counted). Below this field, the corresponding null-indicator
field is listed.
D The Adabas descriptor type of an elementary field that is not an array.
A descriptor can be used as the basis of a database search performed with the READ or the FIND
statement. For example: a field from an Adabas database that has a D or an S in the D column
can be used in the BY clause of the READ statement. Once a record has been read from the database
using the READ statement, a DISPLAY statement can reference any field that has either a D or an
S in this column.
Descriptors types are:
blank No descriptor.
This field is not a descriptor.
D Elementary descriptor.
Value lists are created and maintained for this field by Adabas, so
that this field can be used as a search criterion in a FIND statement,
as a sort key in a FIND statement, or to control logical sequential
reading in a READ statement.
H Hyperdescriptor.
A hyperdescriptor is a user exit in Adabas. For Natural, it provides
the same functionality as a phonetic descriptor (see below).
N Non-descriptor.
A non-descriptor is not a descriptor, but can be used as a search field
for a non-descriptor search.
P Phonetic descriptor.
A phonetic descriptor allows the user to perform a phonetic search
on a field (for example, a person's name). A phonetic search results
in the return of all values which sound similar to the search value.
S Superdescriptor.
If a superdescriptor contains a multiple-value field or a field from a
periodic group (or part of such a field), the superdescriptor is marked
252 Editors
Using the DDM Editor Screen
For fields of the type C (see the attribute T), this column contains the name of the DDM used for
file coupling.
Remark A comment which applies to a field and/or the DDM.
Indicator Fields
An indicator field is used to retrieve the length of a variable length field or information about the
data significance (NULL value indicator) of a database field. An indicator field does not provide the
contents of a database field.
A database field name starting with L@, N@ or O@ (where @ is the character with hexadecimal value
H'7C') is interpreted as an indicator field. Therefore, a database field name must not start with
any of these character strings unless it represents an indicator field.
■ An L@xxxxx field is automatically added for every variable length field, where xxxxx is the name
of the related field.
This applies to long alpha (LA) and large object (LB) fields in an Adabas file, and VARCHAR
and LOB fields in a DB2 table.
Editors 253
Using the DDM Editor Screen
If the length indicator relates to an LA, LB or LOB field, the Natural data format/length must
be I4. For a VARCHAR field, the format/length must be I2.
■ An N@xxxxx field is automatically added for a field that may contain a NULL value, where xxxxx
is the name of the related field.
This applies to Adabas fields defined with the SQL Null Value Option and DB2 fields which
may have a NULL value by definition. The Natural data format/length of a NULL indicator field
must be I2.
■ An O@xxxxx is currently not assigned a particular retrieval function but is reserved for future
extension.
An O@xxxxx is automatically added for a locator field of a DB2 LOB field. The Natural data
format/length of a locator field must be I4.
This section provides information on the commands provided on the Edit DDM screen.
Line commands are used to copy, delete, insert or move single or multiple source-code lines. Ad-
ditionally, they are used for invoking the extended field editing function (see Specifying Extended
Field Attributes).
Editor or system commands, for example, are used to execute particular line commands, navigate
in the DDM source or execute a SYSDDM function directly from the Edit DDM screen.
■ Help on Commands
■ Line Commands
■ Editor and System Commands
Help on Commands
This section provides instructions for obtaining help information on the commands provided on
the Edit DDM screen.
Or:
In the Command line of the Edit DDM screen, enter a question mark (?).
254 Editors
Using the DDM Editor Screen
2 Press ENTER to scroll down the help text and to exit the Editor Help Info screen.
Line Commands
This section describes all line commands available on the Edit DDM screen and provides instruc-
tions for executing a line command.
1 On the Edit DDM screen, next to the source line(s) to which the command applies, position
the cursor in the column T and type in a line command by overriding any existing values in
the column T, L, DB or Name.
2 Press ENTER.
To append lines to the source code, use the editor command ADD.
.MX Moves the line marked with .X below the line in which the command was entered.
.MY Moves the line marked with .Y below the line in which the command was entered.
.MX-Y Moves a block of lines as described in To copy or move a block of lines.
.X Marks a single line or the first line of a block of lines to be copied or moved.
Editors 255
Using the DDM Editor Screen
1 In the first line of the block of lines to be copied or moved, enter the following line command:
.X
In the last line of the block of lines to be copied or moved, enter the following line command:
.Y
2 Press ENTER.
.CX-Y (nn)
or
.MX-Y
where C denotes copy and M denotes move. nn indicates the number of times the marked block
is to be copied (if nn is not specified, the block is copied once by default).
4 Press ENTER.
The marked block is copied (once or nn times) or moved below the line in which the command
was entered.
This section describes the editor commands and Natural system commands available on the Edit
DDM screen and lists equivalent PF keys (if relevant).
■ At the top of the Edit DDM screen, in the Command line, enter an editor or a system command.
Or:
256 Editors
Using the DDM Editor Screen
On the Edit DDM screen, press a PF key if assigned to an editor or system command.
For example, to catalog a DDM you can either enter the command CATALOG or press PF11.
For an explanation of the symbols used in the syntax diagrams in the following tables, refer to
System Command Syntax in the System Commands documentation. An underlined portion of a
command denotes a valid abbreviation. Note that the editor commands used to navigate in the
DDM source are described in a separate table under Editor Commands for Positioning.
Command Explanation
ADD Appends 10 blank lines to the source code.
(With the next ENTER, lines that are left blank are eliminated again.)
If the DDM source has already been cataloged, the REPLACE option must be used.
Should any inconsistency occur, the source line of the field definition that caused the error
is marked for correction as indicated by an E in the column I.
or
?
Editors 257
Using the DDM Editor Screen
Command Explanation
LENGTH
LENGTH
[from-field to-field]
or SIZE
SIZE
Calculates the maximum length for one record in bytes. If you specify from-field and
to-field, only the length from from-field to to-field is calculated.
LIST DDM
DDM
LIST [DDM-name]
or VIEW
LIST VIEW
Displays a single DDM source or a list of DDMs as specified with DDM-name as described
for the corresponding Natural system command LIST in the System Commands
documentation.
QUIT Terminates the DDM editor and displays the SYSDDM utility menu. The DDM source is
retained in the source area until another source is read into the source area (by any Natural
or editor) or until the Natural session is terminated.
.
The DDM editor uses the editor profile option Leave Editor with Unlock to unlock source
code when leaving the DDM editor. This option is described in General Defaults in Editor
Profile in the section General Information.
Reads a DDM source into the source area. Any DDM source currently contained in the
source area is overwritten.
RESET Removes all marks from lines marked with an X (see the line command .X), a Y (see the
line command .Y) or an E (error during CHECK) indicated in the column I.
SCAN SCAN [scan-value]
Scans for the search string specified with scan-value, for example:
If found, the line(s) that contain scan-value are marked with an S displayed in the
column I. (Press ENTER to remove the marks.)
258 Editors
Using the DDM Editor Screen
Command Explanation
UNCATALOG UNCATALOG [DDM-name]
Deletes one or more DDMs from the current FDIC system file if DDM-name is specified
(see also DDM Name in the section DDM Specification).
Deletes the DDM source currently contained in the source area if DDM-name is not specified.
This command corresponds to the Natural system command UNCATALOG described in the
System Commands documentation.
or or
+P ENTER
or
-P
+H PF5 Scrolls down half a page (10 lines).
-H PF4 Scrolls up half a page (10 lines).
X Positions in the line marked with the line command .X or .Y.
or
Y
B PF9 Scrolls down to the last page.
or
++
T PF6 Scrolls up to the first page.
or
--
+nn Scrolls down nn lines.
-nn Scrolls up nn lines.
Editors 259
Using the DDM Editor Screen
The extended field editing function can be used to specify default field attributes for headers and
edit masks, a field comment (remark) and a format option to be applied when the field is used in
another Natural object (for example, in a program). In addition, for a DDM generated from a
VSAM file you can display and edit VSAM-specific field attributes.
The header attribute specifies the default column header to be displayed above the field when it
is output, for example, with a DISPLAY statement. The header corresponds to the text specified
with the HD parameter within single quotation marks (HD='text') as described in the Parameter
Reference documentation. If no header is specified, the field name is used as column header.
The edit mask attribute specifies the default edit mask to be used when the field is output, for ex-
ample, with a DISPLAY statement. The edit mask must conform with Natural syntax rules and be
valid for the Natural data format and length of the field.
The format option can be used to define variable length fields: when set to LA, the field is defined
as Long Alpha (LA), when set to LB, the field is defined as Large Object (LOB). A Long Alpha field
can be of format A or U, a Large Object field can be of format A, U or B.
Related Topics:
This section provides instructions for invoking and terminating extended field attribute editing
for a single field or a range of consecutive fields.
Next to the field required, position the cursor in the column T column and type in the line
command .E over the values in the columns T and L.
260 Editors
Using the DDM Editor Screen
The Extended Field Editing screen for the field marked with the command is displayed as
shown in the example of a DDM from Adabas below:
I T L DB Name F Leng S D
- - - -- -------------- top ------------- - ---------- - -
1 AF LA-FIELD A 16381 F
----------------------------------------------------------
On the Extended Field Editing screen, as described earlier, you can specify a remark (com-
ment), a field header, an edit mask and a format option.
For extended field editing in DDMs from VSAM, see Extended Editing at Field Level in the
Natural for VSAM documentation).
2 For a range of fields:
1. Next to the first field to be selected, position the cursor in the column T and type in the
following line command over the values in the columns T and L:
.Enn
The Extended Field Editing screen appears for the first field selected.
2. Enter or modify the field attributes required and press ENTER or PF3.
The Extended Field Editing screen for the next field in sequence appears.
Any field modifications are saved and the Edit DDM screen appears.
Editors 261
262
38 Cataloging a DDM
You can save a DDM as a cataloged object in the specified Natural system file (see also Storing
DDMs).
For the naming conventions that apply to an object, refer to Object Naming Conventions in the Using
Natural documentation.
To catalog a DDM
■ In the SYSDDM utility menu, specify the DDM you want to catalog (see also DDM Specifica-
tion) and execute the Catalog DDM function (see also Description of Functions).
Or:
From the Edit DDM screen, execute the CATALOG command as described in Editor and System
Commands.
263
264
39 Maintaining DDMs in Different Environments
To transfer DDMs (for example, copy or move) between different FDIC system files, and to perform
a DDM operation (for example, delete or find) in a different environment, you can use the Natural
utility SYSMAIN (see the Utilities documentation).
To transfer DDMs between different hardware platforms (mainframes, UNIX, OpenVMS and
Windows), you can use the Object Handler (see the Utilities documentation).
265
266
40 Software AG Editor
Using Commands
Related Topics:
267
268
41 General Information on the Software AG Editor
The Software AG Editor is used to edit objects in Natural (including utilities such as SYSRPC and
SYSBPM) and the following other Software AG products:
■ Natural ISPF
■ Entire Operations
■ Entire Output Management
■ Predict
Each of these products uses a subset of the complete Software AG Editor functionality.
If you want to use the Software AG Editor as an alternative to the Natural program editor, you
need to have Natural ISPF installed and your editor profile set appropriately (see Editor Profile
in Editors - General Information for further information on editor profiles).
The Software AG Editor provides Natural ISPF-like functionality to display and/or edit objects
such as:
■ Natural objects of the type program, subprogram, subroutine, helproutine, copycode, text or
class
■ PDS members and sequential files
■ z/VSE members
■ PANVALET members
■ CA-LIBRARIAN members
■ Job SYSOUT (browse mode only)
■ Output in the user work pool
■ List of system objects (browse mode only)
■ Any text objects or tables
269
270
42 Invoking the Software AG Editor
The screen from which you enter the Software AG Editor depends on the application you are using
and the type of object you wish to edit or display.
For example, if you wish to edit a Natural object in Natural ISPF, you might enter the Software
AG Editor from the Natural object entry screen.
The ways of entering the Software AG Editor are described under the appropriate section headings
in the documentation for the application you are using.
The commands available to you depend on the application you are using.
Examples of defined objects using the Software AG Editor are given in the appropriate sections
of the documentation for the application you are using.
271
272
43 Using the Editor Screen
273
Using the Editor Screen
If you specify a new object name for editing, an editor screen similar to the following appears:
The layout of this screen can vary depending on the Software AG product you use.
The first line on the screen identifies the object to be edited according to the environment from
which the Software AG Editor is called. In the above example, JOB1JCL is the name of the new
object and NATLIB1 identifies the object library which is a Natural library.
The input areas contained on the editor screen are explained in the following section.
■ Command Line
It is used for entering an editor main command described in Summary of Main Commands.
274 Editors
Using the Editor Screen
■ Scroll Field
It is used for specifying default scrolling amounts described in Settings for Scroll Field.
■ Prefix Area
The leftmost six columns of the editor screen are referred to as the prefix area. The prefix area
can contain a series of apostrophes ('''''') or asterisks (******), a source-line number or text.
The prefix area is used for entering line commands described in Summary of Line Commands.
■ Editing Area
The editing area is to the right of the prefix area. It is used for entering data.
You can start your editing session by entering data into the Software AG Editor screen and using
editor main commands (Summary of Main Commands) and line commands (Summary of Line
Commands).
This section describes the commands and settings that can be used for scrolling the data contained
in the editing area of the editor screen.
■ PF Keys
■ Settings for Scroll Field
■ Main Commands for Scrolling
PF Keys
Commands for scrolling data are often assigned to the following PF keys:
Editors 275
Using the Editor Screen
In the scroll field (SCROLL===>), you can enter scroll settings. These settings are used to set the
scroll amount for the PF keys, above, and some are also used with the scrolling main commands
on the following page.
When scrolling down, the bottom line becomes the top line. When scrolling up, the top line
becomes the bottom line.
When scrolling right, the last column becomes the first column. When scrolling left, the first
column becomes the last column.
HALF Scrolls half a page in any direction.
LINE Scrolls up to beginning of line or down to end of line.
MAX Scrolls to top or bottom of data.
When scrolling up, if cursor is on first character of sentence, scroll to first character of previous
sentence.
WORD Scrolls up to first character of next word or down to first character of following word.
276 Editors
Using the Editor Screen
Apart from the LOCATE main command which scrolls data to a specified line, several main commands
are available for vertical and horizontal scrolling.
The following table shows all possible scrolling commands and their meaning:
or
++
TOP Scrolls to the beginning of the object being edited.
or
--
DOWN Scrolls forward by the amount specified in the scroll field.
DOWN n Scrolls forward by n lines.
+n Scrolls forward by n lines.
UP Scrolls backwards by the amount specified in the scroll field.
UP n Scrolls backwards by n lines.
-n Scrolls backwards by n lines.
LEFT Scrolls to the left by the amount specified in the scroll field.
LEFT n Scrolls to the left by n columns.
RIGHT Scrolls to the right by the amount specified in the scroll field.
RIGHT n Scrolls to the right by n columns.
FIX n Specifies the number of columns n, starting with column 1, to remain in display when
scrolling to the right.
Locating a Line
If you wish to display a specific line at the top of your editor screen (that is, make it the current
line), use the LOCATE main command with a parameter describing the line you wish to become the
current line.
Examples:
L 32
Editors 277
Using the Editor Screen
32
Same as above.
L .X
L 'ABC'
Makes the first line that starts with the string ABC the current line (useful when browsing sorted
data such as directory lists).
Note the following differences between the LOCATE and FIND commands:
■ If you issue the LOCATE command with a character string (L 'ABC'), the string is only found if
it starts in column 1. The FIND command searches the whole source work area;
■ With the LOCATE command, it is assumed that the data to be searched is sorted in ascending al-
phabetical order;
■ When a line is located with the LOCATE command, the cursor is placed in the prefix area; with
the FIND command, the cursor is placed on the found string and the line is not necessarily made
the current line.
You can exclude specific lines from the display by using the EXCLUDE main command. For example,
the command:
excludes all lines with the string ABC within the block labeled .X and .Y from display. An unqual-
ified EXCLUDE command excludes the current line. Each excluded line or block of lines is replaced
by a line of dashes and a message informing you how many lines are excluded.
To recall excluded lines to display, use the INCLUDE main command. For example, the command:
IN C'Abc' ALL
includes all excluded lines containing the string Abc exactly as entered here. An unqualified INCLUDE
command recalls the first line in the excluded block.
The EXCLUDE and INCLUDE main commands can be issued with the same string and search operands
as described for the FIND command, except that the ALL search direction operand means exclude
or include all lines with the given string.
278 Editors
Using the Editor Screen
Lines can also be excluded or recalled to display by using any of the line commands listed below.
You can issue the main command XSWAP to exchange excluded lines with displayed lines.
You can display the positions of your boundaries (set with a BNDS main command) and tabs (set
by a TABS main command), as well as the editing area column positions on any line by using the
appropriate line command as listed below:
For detailed instructions and examples of setting boundaries and tabs, see the relevant sections
in Creating and Modifying Data.
Editors 279
280
44 Using Commands
281
Using Commands
The Software AG Editor provides two types of command for controlling your editing session:
■ Main Commands
Main commands refer to the entire data currently contained in the source work area of the editor.
The main commands available to you depend on the application you are using.
The command format in the examples provided in the Software AG Editor documenation show
the abbreviated form of each main command. These examples are by no means exclusive. For
a complete summary of command syntax, see the section Summary of Main Commands.
■ Line Commands
Line commands refer to the source line on which they are entered or to a block of data delineated
by line commands.
For a complete summary of line commands, see the section Summary of Line Commands.
■ Data updates
■ Line commands
■ Main commands
Executing a Command
Depending on the configuration of your installation, main commands and line commands can be
entered in lower case. In the command descriptions provided in the Software AG Editor document-
ation, all commands appear in upper case to distinguish them as commands.
■ In the command line (COMMAND===>), enter a main command and press ENTER.
You can enter several commands in the same input operation if you separate them with a
semicolon (;).
■ In the leftmost column of the prefix area, next to the required source line, type a line command
over the characters contained in these columns, and press ENTER.
When you press ENTER, apostrophes ('''''') or asterisks (******) are replaced by line numbers
on used lines. Unused lines are automatically deleted.
282 Editors
Using Commands
Or:
In the first column of the editing area, enter a line command preceded by the escape character
and press ENTER. The default escape character is the period (.).
Or:
Editors 283
284
45 Creating and Modifying Data
285
Creating and Modifying Data
This section describes the functions that are available for all object types using main commands
and/or line commands.
This section describes the line commands and main commands available to insert and delete lines.
The following line commands are available to insert and delete lines on your editor screen.
If you enter no new data in an inserted line and press ENTER, the editor leaves insert mode
and the blank line is deleted. If you have defined a mask line and the MASK setting is ON, the
mask line is inserted when you issue this command.
In Inserts n lines after this one. You can type data in the new lines. When you press ENTER,
unused lines are deleted but one blank line remains with the cursor in it (editor stays in
insert mode).
TE Switches the editor to text enter mode. This means that beginning with this line the editor
screen is blank (without line numbers) and you can enter data.
When you press ENTER, any remaining blank lines are deleted, the line numbers are
re-displayed and the text is reformatted within the set margins and with the specified
justification.
286 Editors
Creating and Modifying Data
POWER Command
You can also use the POWER main command to switch to text enter mode.
When you issue the POWER main command, you are presented with a blank editor screen (without
line numbers) and you can enter data. When you press ENTER, any remaining blank lines are deleted,
the line numbers are redisplayed and the text is reformatted within the set margins and with the
specified justification.
DELETE Command
Line deletion can also be performed with the DELETE main command.
deletes all lines containing the string Abc exactly as entered here between columns 10 to 30 within
the block delineated by the labels .X and .Y.
You can specify all operands described for the FIND command above, except that the ALL direction
operand specifies deletion of all lines with the given string. An unqualified DELETE command deletes
the current line.
With the following line commands, you can copy, move or repeat lines or blocks of data.
Editors 287
Creating and Modifying Data
The moved or copied line(s) are merged with these lines, that is, blank characters in the lines
are overlaid.
The ) (parenthesis) line commands (see below), move text the full number of columns
specified, but only within the set boundaries, therefore, part of the moved text could disappear.
) Moves this line right by one column beginning with left boundary.
)n Moves this line right by n columns.
))n Marks first line of a block to be moved right by n columns. A second ))n is required to
delineate the block. The move is performed after the second ))n command is entered. Two
unqualified )) line commands move the block right by 1 column.
( Moves this line left by one column.
288 Editors
Creating and Modifying Data
If you use the > (greater than) or < (less than) symbols (see below) to move data, the maximum
move possible is up to the next non-blank character within the set boundaries.
> Moves this line right by one column.
>n Moves this line right by n columns.
>>n Marks first line of a block to be moved right by n columns. A second >> is required to delineate
the block. The move is performed after the second >> command is entered. Two unqualified
>> line commands move the block right by 1 column.
< Moves this line left by one column.
<n Moves this line left by n columns.
<<n Marks first line of a block to be moved left by n columns. A second << is required to delineate
the block. The move is performed after the second << command is entered. Two unqualified
<< line commands move the block left by 1 column.
An overlay line command (O, On or OO) allows you to merge single-column lists into multi-column
format (that is, tabular form). You can use an overlay line command in conjunction with a copy
(C, Cn or CC) or move (M, Mn or MM) line command.
Editors 289
Creating and Modifying Data
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Split End Suspe Rfind Rchan Up Down Swap Left Right Curso
In the figure above, lines 180 to 210 are marked by the MM (Move) line command. They are to be
overlaid on lines 140 to 170, which are marked by the OO (Overlay) line command.
This figure shows the result of the line commands displayed in the previous figure. Lines 180 to
210 have been overlaid on lines 140 to 170:
290 Editors
Creating and Modifying Data
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Split End Suspe Rfind Rchan Up Down Swap Left Right Curso
You can specify a window with data for move or copy operations. This allows you to copy or
move data that does not start or end at the beginning or end of a line. This function can be per-
formed by using editor line commands and/or main commands.
When you define a window, all data on your screen between start and end of the window becomes
part of the window.
Before defining a new window, reset the old window with the RESET command to avoid a
command conflict.
WEn Data window ends in column n of this line.
WC Copies the data window. The cursor position marks the column at which this line is to be
split to insert the copied data.
WCn Splits this line in column n, and copies the data between the two parts of the line.
WM Moves the data window. Works in the same way as WC, but the original data is deleted after
the copy operation.
WMn Splits this line in column n, and moves the data between the two parts of the line.
Editors 291
Creating and Modifying Data
WINDOW 5 10 24 13
Defines a window starting in line 5 / column 24, and ending in line 10, column 13.
WINDOW 5 10 24
Defines a window starting in line 5 / column 24, and ending in line 10 / last column.
WINDOW 5 10
Defines a window starting in line 5 / first column, and ending in line 10 / last column.
WINDOW 5 5
Defines a window starting in line 5 / first column, and ending in line 5 / last column.
CWINDOW Copies a window defined with the WINDOW command. Optional parameters specify the line
at which the window is to be inserted. Examples:
CWINDOW 5
CWINDOW 5 24
Splits line 5 at column 24 and copies the window in between the two parts.
DWINDOW Deletes a window of data defined by the WINDOW command.
MWINDOW Moves window defined by the WINDOW command. Works like the CWINDOW command, but
data in the original window is deleted after the copy operation.
This section provides an example of defining and moving text with a data window by using either
line commands or corresponding main commands.
The example refers to the text shown in Step 1 below and assumes that you want to move the
whole sentence starting Note that when... (line 8) to follow the first sentence of the displayed
text ending ...copy operations (line 3).
292 Editors
Creating and Modifying Data
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Split End Suspe Rfind Rchan Up Down Swap Left Right Curso
2 Type the line command WS in line 8, the first line of data to be moved, place the cursor in the
required column (N of the word Note) and press ENTER.
Editors 293
Creating and Modifying Data
The message WS55 appears in the prefix area of line 8, indicating the column number selected:
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Split End Suspe Rfind Rchan Up Down Swap Left Right Curso
3 Type the line command WE in line 10, the last line of data to be moved, move the cursor to the
last column to be moved (full stop (.) after window) and press ENTER.
294 Editors
Creating and Modifying Data
000007
WS55 Below are some examples of copying windows with data. Note that when
000009 you define a window, all data on your screen between start and end of
WE37 the window become part of the window. Available line commands are:
****** **************************** bottom of data ****************************
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Split End Suspe Rfind Rchan Up Down Swap Left Right Curso
4 Type the line command WM in line 3 (the data will be moved to the following line, line 4), and
move the cursor to the column at which line 3 is to be split (the blank before the word This).
Press ENTER.
Editors 295
Creating and Modifying Data
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Split End Suspe Rfind Rchan Up Down Swap Left Right Curso
You can achieve the same result described in the instructions above when using the command
sequence indicated below.
WINDOW 8 10 55 37;MWINDOW 3 64
The editor provides commands which allow you to set horizontal and vertical boundaries within
which certain functions can be performed such as the main commands FIND, CHANGE, CENTER,
ORDER, JLEFT and JRIGHT, as well as their corresponding line commands (for example, TC, TO, LJ
or RJ).
■ Setting Boundaries
296 Editors
Creating and Modifying Data
Setting Boundaries
With the BNDS main command, you can define horizontal boundaries as described in the following
example instructions.
BNDS 20 50
BNDS
The following figure shows the result of the BNDS 20 50 main command followed by a BNDS
line command in line 2:
Editors 297
Creating and Modifying Data
000230 CMD C C * FM #FL DBID #FD FNR #FF TO #TL DBID #TD FNR #TF REP
000240 FIN
000250 /*
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Split End Suspe Rfind Rchan Up Down Swap Left Right Curso
You can label the current line (line currently at the top of editing area) or a block of lines by using
either the LABEL main commands or corresponding line commands.
LABEL .X
LABEL .Y
The new current line is labeled .Y denoting the last line of a block of lines.
1 Next to the first line to be labeled, issue the following line command:
.X
.Y
The specified line is labeled .Y delimiting a block of lines that starts with the line labeled .X.
Tip: You can use any string to label lines, for example .START and .END.
For examples of using labeled lines, see the sections Finding a Character String and Replacing a
Character String.
298 Editors
Creating and Modifying Data
You can define data that is automatically placed in a line added through a line insertion operation
(for example, by using the line command I or W). Such a line is referred to as a mask line. A mask
line is useful when you must write several lines of code which are identical or very similar.
Note: You can only have one mask line during an editing session. If you define a new mask
line, any existing mask line definition is automatically updated with the new value.
MASK
A blank line indicated by =mask> appears above the line in which you entered the command.
2 In the blank line, enter the data you want to define as a mask line and press ENTER.
The mask line is now available for the current source until you update the mask with a new
mask line or until you deactivate the mask function.
3 Issue the following main command:
MASK ON
The mask function is activated. The defined mask line now appears in all lines added through
a line insert operation.
4 Issue an insert line command, for example:
I2
Two new lines are inserted into the source with the text of the mask line. The text of a mask
line appears in all lines added with an insert command.
5 Modify the text in the new lines. If you do not modify the text, any inserted line is deleted
the next time you press ENTER.
6 If required, deactivate the mask function with the following main command:
MASK OFF
The MASK OFF command deactivates the mask function but does not delete the contents of the
mask line.
Editors 299
Creating and Modifying Data
You can change the indentation of specified lines by using the ORDER main command together
with a boundary setting. For example, the command sequence:
BNDS 3;ORDER 5 20
Note: If the end of any ordered line traverses the right boundary, it is automatically split.
You can also change the indentation of lines or of a block of data by using line commands. Here,
too, if the end of any line traverses the right boundary, it is automatically split.
Data can be ordered within set boundaries and justified to the left boundary, right boundary or
both by using the JUSTIFY command. For example, the command:
activates justification to columns 5 and 60. To perform the ordering, mark a block of data with
two TOO line commands.
The editor also provides a line command with which you can split a single line into two. Type the
line command S in the prefix area of the line you wish to split, move the cursor to the position
where the split is to occur and press ENTER.
300 Editors
Creating and Modifying Data
Centering Data
The editor also provides commands with which you can center specified data within set boundaries.
For example, the sequence:
BNDS 5 60;CENTER 5 15
Note: Only text already within the boundaries is centered. Text to the left and right of the
boundaries is not affected.
Alternatively, you can use line commands to perform the centering function:
Justifying Data
A number of main commands and line commands are available to rearrange lines or blocks of
data on your screen, depending on the setting of your horizontal boundaries (BNDS main command);
see the section Setting Horizontal and Vertical Boundaries.
The JLEFT and JRIGHT main commands justifies the specified data with the left and right bound-
aries respectively. For example, the sequence:
justifies the data between columns 16 to 80 in lines 140 to 170 with column 16.
Editors 301
Creating and Modifying Data
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Split End Suspe Rfind Rchan Up Down Swap Left Right Curso
The following screen shows the result of the command displayed in the command line of the
previous screen:
302 Editors
Creating and Modifying Data
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Split End Suspe Rfind Rchan Up Down Swap Left Right Curso
The sequence:
BNDS 10;JRIGHT 15
justifies the data on the right of column 10 in line 15 to the end of the screen with the last column
of your editor screen (column 88 of your terminal screen).
Alternatively, you can justify lines or blocks of data by using any of the line commands listed in
the following table:
You can also justify data to the left boundary, or order data between left and right boundary in
conjunction with the JUSTIFY command.
enables justification to the left boundary. Mark a block of data with two TOO line commands (ex-
plained below) to reformat the data between columns 10 and 60, justified to column 10.
Editors 303
Creating and Modifying Data
This section provides instructions for using the TABS main command and/or the TABS line command
to control tabulator settings.
In the examples of tabulation provided in this section, the ampersand (&) is assumed to be the
tabulation character; the COLS line command has been issued to display column positions.
When you issue the TABS ON main command, the standard tab positions set in your editor profile
are turned on and tabs on std appears in your profile. Issue the TABS OFF main command to
turn tabulation off again.
For detailed information on the command syntax that applies to TABS, see the relevant section in
Summary of Main Commands.
To turn tabulation on and set the standard tab positions for your profile to columns 10, 20, 30, 40
and 50, for example, issue the main command TABS 10 20 30 40 50.
304 Editors
Creating and Modifying Data
To turn tabulation on and set the logical tab character to & (ampersand), for example, issue the
main command TABS &.
You can enter data and automatically move it to a specific tab position by preceding it with a lo-
gical tab character. One tab character moves the data to the next tab position, two tab characters
moves the data to the second tab position, and so on.
Apart from tab positions, you can specify the following parameters with the TABS main command:
Parameter Explanation
DECIMAL Orders data with the decimal point in the data at the tab position.
To display the current logical tab character and shift parameter (excluding tab positions), issue
the PROFILE main command.
When you issue the TABS line command in any line, the current tab positions set in your editor
profile are displayed in that line and marked with asterisks (*) if no logical tab character has been
set. This command does not turn tabulation on.
For example, issue the TABS line command to display the positions set with the main command
TABS 10 20 30 40 50.
Editors 305
Creating and Modifying Data
=tabs> * * * * * *
To tabulate data in a specific column and with a specific shift, multiple logical tab characters and
mixed justification parameters are possible.
To set the multiple logical tab characters, issue the TABS line command and type a special character
over each asterisk (*). Any data typed in preceded by any of these logical tab characters are tabulated
in the corresponding column.
To set the mixed justification parameters, type L (Left), R (Right) or D (Decimal) to the right of each
logical tab character for left, right or decimal ordering.
The command
TABS 10 20 40 LEFT
activates logical tabs with tabulation columns 10, 20, and 40 with left justification. After you press
ENTER, the input text line
is displayed as follows:
=cols> ----+----1----+----2----+----3----+----4----+----5----+----6
abc def ghi
306 Editors
Creating and Modifying Data
The command
TABS RIGHT
activates logical tabs with right justification. After you press ENTER, the input text line
is displayed as follows:
=cols> ----+----1----+----2----+----3----+----4----+----5----+----6
abc def ghi
The command
TABS DECIMAL
activates logical tabs with justification of the decimal point in the tab position. After you press
ENTER, the input text line
is displayed as follows:
=cols> ----+----1----+----2----+----3----+----4----+----5----+----6
15.27$ 16.3 EUR 13 IS
TABS 10 20 30 40 50
Editors 307
Creating and Modifying Data
Then issue the TABS line command. This displays the current tab positions as follows:
=tabs> * * * * *
Type an L, R or D next to each tab position as required (unmarked tab positions assume the value
of the last TAB command):
=tabs> *R *D *D *D *L
is displayed as follows:
=cols> ----+----1----+----2----+----3----+----4----+----5----+----6
start 0.01 0.02 0.03 end
which activates tabulation with one blank as tabulation character. This means that words separated
by one blank are tabulated. After you press ENTER, the input text line
is displayed as follows:
=cols> ----+----1----+----2----+----3----+----4----+----5----+----6
this is a blank tabulation
308 Editors
Creating and Modifying Data
You can sort data lines in ascending or descending alphabetical order according to sorting criteria.
For example, the command:
SORT 10 15
sorts all lines in the source in ascending order according to the characters beginning in column 10
and ending in column 15.
To sort only a block of lines, for example, label the lines where the block is to start and end with
.X and .Y respectively. The command:
SORT .X .Y D
sorts all lines in the block marked with .X and .Y in descending order.
To sort a block of lines according to the characters beginning in column 5 and ending in column
20, for example, label the lines where the block is to start and end with .X and .Y respectively. The
command:
SORT 5 20 .X .Y
sorts all lines in the block marked by .X and .Y in ascending order according to the characters
beginning in column 5 and ending in column 20.
To locate a specific character string, you can use the FIND main command with operands defining
the string, the area to be searched and the direction of search. The cursor is placed on the first
character of the string. If the line containing the string was excluded from display, it is now included
in the display.
Editors 309
Creating and Modifying Data
Operand Explanation
* Finds the string specified in previous FIND command.
'abc' Finds the string abc regardless of whether the string is upper case or lower case.
C'Abc' Finds the string exactly as entered here.
P'a(char)c' Finds the string whose first character is a and third character is c. (char) stands for a
special character acting as a wildcard character with the following meaning:
= any character
§ alphabetic character
# numeric character
$ special character
^ non-blank character
- non-numeric character
< lower-case character
> upper-case character
T'abc' Finds the string abc regardless of whether the string is upper case or lower case.
X'D4A8' Finds the string that corresponds to hexadecimal D4A8.
String-Matching Operand
The string-matching operand specifies whether any special occurrence of the string is to be located.
The following options are possible:
Operand Explanation
CHARS No restrictions (any occurrence of the string).
PREFIX Only those occurrences which are the prefix of a word.
SUFFIX Only those occurrences which are the suffix of a word.
WORD Only those occurrences which form a word.
Default is CHARS.
310 Editors
Creating and Modifying Data
Direction Operand
Operand Explanation
ALL Any occurrence of the string (search all directions).
FIRST First occurrence of the string.
LAST Last occurrence of the string.
NEXT Next occurrence of the string starting from the cursor position.
PREV Previous occurrence of the string.
Default is NEXT.
Line-Type Operand
This line-type operand specifies whether excluded or included lines only are to be searched. The
following options are possible:
Operand Explanation
X Search excluded lines only.
NX Search non-excluded lines only.
If this operand is omitted, the editor searches all data for the given string, included and excluded
lines. If the string is found in an excluded line, it is returned to display.
Block Operand
If you have labeled lines or a block of lines, you can use the block operand to restrict the search
area for the FIND command.
Operand Explanation
.X Search from line labeled .X to end of data.
.X .Y Search from line labeled .X to line labeled .Y.
Editors 311
Creating and Modifying Data
Columns Operand
The column operand allows you to restrict the search for the given string between certain columns.
Below are two examples of the columns operand.
Operand Explanation
20 Locate given string starting in column 20 (the first character of the string must be in column 20).
20 40 Locate given string anywhere between columns 20 to 40.
F C'HILITE' X PREV
Find the previous occurrence of the string HILITE exactly as entered here; search excluded lines
only.
F P'RCV#' .X .Z 20 30
Find the string starting RCV with a numeric fourth character within the block .X .Z and between
columns 20 to 30.
F X'6C' SUFFIX NX
Find the character corresponding to the hexadecimal 6C in non-excluded lines only. The character
must end a word.
Command Explanation
F C'HILITE' X PREV Find the previous occurrence of the string HILITE exactly as entered here;
search excluded lines only.
F P'RCV#' .X .Z 20 30 Find the string starting RCV with a numeric fourth character within the block
.X .Z and between columns 20 to 30.
F X'6C' SUFFIX NX Find the character corresponding to the hexadecimal 6C in non-excluded lines
only. The character must end a word.
If single quotation marks are part of the string to be found, you must use a different separator in
the FIND command, for example double quotation marks:
FIND C"'string'"
You can repeat a previous FIND command with the RFIND main command.
312 Editors
Creating and Modifying Data
You can find and replace a given character string by another character string by using the CHANGE
main command.
If apostrophes are part of the string to be replaced, you must use a different separator in the CHANGE
command, for example quotation marks:
The same operands as for the FIND command can be used with the CHANGE command. For the
CHANGE command, however, the ALL directions operand means change all occurrences of the spe-
cified string.
After the replace operation is performed, the message ==chg> appears in the prefix area of the
changed line.
Command Explanation
CHG 'LOW' 'HIGH' Replaces the first occurrence of LOW by HIGH (upper and lower case
ignored).
CHG C'OPS' 'SPF' .X .Y 28 32 Replaces OPS (exactly as entered here) by SPF; replace all
all occurrences in the block labeled .X and .Y and between the columns
28 and 32.
CHG * 'NEW' Replaces the next occurrence of the string specified in the last CHANGE
command by the new string NEW.
CHG 'OLD' * Replaces OLD by the same new string as specified in the last CHANGE
command.
Editors 313
Creating and Modifying Data
The screen below illustrates the second example before the command is executed with ENTER:
The screen below illustrates the second example after the command is executed with ENTER:
314 Editors
Creating and Modifying Data
All occurrences of the string OPS have been replaced by the string SPF between lines 140 and 170
and within the columns 28 to 32.
When changing character strings, good use can be made of the RFIND (repeated FIND) and the
RCHANGE (repeated CHANGE) commands, for example, the sequence:
FIND 'abc'
CHANGE 'abc' 'def'
RFIND
RCHANGE
allows you to find occurrences of a certain string and optionally change them with relatively small
effort.
Editors 315
316
46 Setting the Editor Profile
317
Setting the Editor Profile
Each user has an editor profile with parameters which can be set according to individual needs.
The first time you invoke the editor, it uses the default values determined by your administrator.
You can modify single settings in your editor profile using appropriate commands. The new settings
are valid for the remainder of the editing session or until you change them again using the appro-
priate commands.
PROFILE
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Split End Suspe Rfind Rchan Up Down Swap Left Right Curso
The individual items of the editor profile are described in the following section.
318 Editors
Setting the Editor Profile
This section describes the editor profile items and the appropriate main commands that can be
used to change these items.
For explanations of the syntax symbols used in the main commands, refer to System Command
Syntax in the System Commands documentation.
For detailed information on the main commands listed, refer to Summary of Main Commands.
Non-modifiable item.
empty line Specifies if lines containing only space characters are to be deleted EMPTY ON|OFF
automatically.
escape Specifies whether escape character is used to precede line ESCAPE ON|OFF [char]
commands.
fix Specifies whether fixed number of columns are displayed and FIX ON|OFF n
how many columns are to be fixed.
hex Specifies whether data is to be displayed in hexadecimal format. HEX ON|OFF
init size Number of lines in object when editor was invoked. None
Non-modifiable item.
limit Specifies the maximum number of lines to be searched by a FIND LIMIT n
or RFIND command.
log Enables or disables log file. When enabled, UNDO command can LOG ON|OFF
be used to backout last changes.
mask Activates or deactivates the mask line function. MASK ON|OFF
mso Indicates that multiple-session operations are allowed. A None
multiple-session operation is an operation in which data is
exchanged between two editing sessions, for example, when
copying data from one object to another.
Editors 319
Setting the Editor Profile
Non-modifiable item.
tabs Activates or deactivates tabulation. TABS ON|OFF
var Specifies current line length. BNDS n m
user Current logon user. None
Non-modifiable item.
320 Editors
47 Storing Data and Leaving the Software AG Editor
You can store data and/or leave the editor by using any of the following main commands:
321
322
48 Summary of Line Commands
This section gives a short description of each line command provided by the Software AG Editor.
323
Summary of Line Commands
If you enter no new data in an inserted line and press ENTER, the editor leaves insert mode
and the blank line is deleted (see also the main command EMPTY.
You can also fill an inserted line with a predefined content (see the main command MASK.
In Inserts n lines. You can type data in the new lines. When you press ENTER, unused lines are
deleted but one blank line remains with the cursor in it (editor stays in insert mode).
J Joins next line with this one. Identical to TJ line command.
Ln Includes the last n excluded lines.
LC Changes this line to lower case.
LCn Changes the following n lines to lower case.
LCC Marks the first line of a block to be changed to lower case. A second LCC is required to mark
the last line in the block.
LJ Justifies the data within the set boundaries in this line with the left boundary.
324 Editors
Summary of Line Commands
The moved or copied line(s) are merged with these lines, that is, blank characters in the lines
are overlaid.
R Repeats this line once.
Rn Repeats this line n times.
RR Marks the first line of a block to be repeated. A second RR command is required to mark the
last line of the block to be repeated. The repeat operation is performed after the second RR
has been entered.
RRn Repeats the block of lines n times.
RJ Justifies the data within the set boundaries in this line with the right boundary.
RJJ Marks the first line of a block of data within the set boundaries to be justified to the right. A
second RJJ command is required to mark the last line of the block to be justified. The
justification is performed after the second RJJ has been issued.
S Splits this line into two lines beginning at the cursor position. Type in the command, move
the cursor to the position where the line is to be split, and press ENTER.
T Scrolls the data to make the marked line the top line.
TABS Displays the tab positions in this line.
Editors 325
Summary of Line Commands
326 Editors
Summary of Line Commands
Editors 327
328
49 Summary of Main Commands
329
Summary of Main Commands
330 Editors
Summary of Main Commands
This section gives a short description of each main command provided by the Software AG Editor
and a complete overview of the command syntax.
For explanations of the syntax symbols used in this section, refer to System Command Syntax in the
System Commands documentation.
Note: If line numbers appear in the prefix area, column 8 on the screen corresponds to
column 1 of the editing area. This is important when specifying columns in main commands.
ADVANCE
ON
ADVANCE OFF
PAGE
This command is used to specify whether the cursor moves to the next line automatically after a
line update.
ON
The cursor moves to the next line after an update.
OFF
The cursor does not move to the next line after an update.
PAGE
The line containing the cursor is placed at the top of the editing area after an update.
If an unqualified ADVANCE command is issued, it is interpreted as ADVANCE ON. The default setting
is ADVANCE ON and can be changed by editing your profile; see Setting the Editor Profile.
AORDER
ON
AORDER
OFF
This command is used to specify whether text is to be automatically justified within the set
boundaries.
If an unqualified AORDER command is issued, it is interpreted as AORDER ON. The base setting can
be changed by editing your profile; see Setting the Editor Profile.
Editors 331
Summary of Main Commands
AUTOREN
ON
AUTOREN
OFF
For PDS members and sequential data sets only. This command is used to specify whether the
editor automatically activates the RENUMBER function.
AUTOSAVE
AUTOSAVE ON
ASAVE OFF
This command is used to specify whether the editor executes an automatic SAVE command when
you issue the END command.
BNDS
n m
BNDS
n
This command is used to restrict the effect of certain commands to a specific range of columns.
332 Editors
Summary of Main Commands
These boundaries apply to the main commands FIND, CHANGE, CENTER, ORDER, JLEFT and JRIGHT,
and their corresponding line commands (for example, TC, TO, LJ or RJ).
n
The number of the column at which the left boundary is to be placed.
m
The number of the column at which the right boundary is to be placed.
If n and m are omitted, the boundaries are set at the first and last column of the editing area.
To see the current boundary settings, issue the BNDS line command.
BOTTOM
BOTTOM
This command is used to scroll to the end of the object being edited.
CANCEL
CANCEL
Backs out all changes to data made during the current editing session and leaves the editor. Any
changes made since the last time you saved the data are lost.
CAPS
ON
CAPS OFF
PGM
Editors 333
Summary of Main Commands
ON
The data is translated to upper case.
OFF
The data is not translated; that is, it remains as entered.
PGM
The data is translated to upper case (except for comments, which remain as entered).
The CAPS command issued without a parameter has the same effect as CAPS ON. The default is CAPS
ON. Edit your profile to change this; see Setting the Editor Profile.
CENTER
ALL
CENTER n
n m
ALL
Centers the data of all lines.
n
Centers the data from line n to the last line.
n m
Centers the data from line n to line m.
The CENTER command applies only within the horizontal boundaries as set with the main command
BNDS.
For centering, you can also use the line commands TC and TCC.
CHANGE
*
[T]'string1'
CHANGE *
C'string1'
CHG [X]'string2'
X'string1'
P'string1'
334 Editors
Summary of Main Commands
ALL
CHARS
NEXT
.X n WORD NX
PREV
.X .Y n m PREFIX X
FIRST
SUFFIX
LAST
This command is used to replace a character string (string1) by another character string (string2).
If you want an apostrophe to be part of string1 or string2, you must write it as two apostrophes.
You can specify the string to be replaced (string1) as described in the following section.
T'string1'
Replaces string1 irrespective of whether it occurs in lower case or upper case.
'string1'
Same as T'string1'.
C'string1'
Replaces string1 only if it occurs exactly as specified.
X'string1'
Replaces the string that corresponds to the specified hexadecimal character string string1.
Replace it by the hexadecimal string string2.
P'string1'
Replaces string1 which includes the following wildcard characters:
= any character
§ alphabetic character
# numeric character
$ special character
^ non-blank character
- non-numeric character
< lower-case character
> upper-case character
*
Use the character string specified in a previous command (for example, FIND, CHANGE,
EXCLUDE).
.X
See Line Specifications for an explanation.
.X .Y
n
See Column Specifications for an explanation.
n m
ALL
See Direction of Operation for an explanation.
NEXT
PREV
Editors 335
Summary of Main Commands
FIRST
LAST
CHARS
See Special Occurrences for an explanation.
WORD
PREFIX
SUFFIX
NX
See Displayed or Non-Displayed Lines for an explanation.
To repeat the execution of a CHANGE command, you use the command RCHANGE.
To search the entire data for a character string and then decide occurrence by occurrence whether
to replace it by another character string, you can use a combination of the commands FIND, CHANGE,
RFIND and RCHANGE:
FIND 'string'
When the string has been found, you can decide whether to:
■ replace it:
■ or search for the next occurrence of the string by repeating the FIND command:
RFIND
When the next occurrence of the string has been found, you can again decide whether to:
RCHANGE
336 Editors
Summary of Main Commands
■ or search for the next occurrence of the string by repeating the FIND command:
RFIND
Example 1:
This command replaces the first occurrence of LOW by HIGH, regardless of upper or lower case.
Example 2:
This command changes OPS (exactly as entered here) into SPF; it changes all occurrences in the
block of lines labeled with .X and .Y and between columns 28 and 32.
Example 3:
This command changes all occurrences of prefix NAME (exactly as entered here) into APPL in all
displayed lines in the block labeled with .X and .Y.
Example 4:
CHG * 'NEW'
This command replaces the next occurrence of the string specified in the last CHANGE command by
the string NEW.
Example 5:
CHG 'OLD' *
This command replaces the next occurrence of the string OLD by the same new string as specified
in the last CHANGE command.
Editors 337
Summary of Main Commands
COLS
ON
COLS
OFF
This command displays a line at the top of the editing area showing column positions.
To display the column positions, you can also use the line command COLS.
CURSOR
CURSOR
This command returns the cursor to the command line when you next press ENTER.
CWINDOW
n
CWINDOW
n m
This command is used to copy a data window according to the command parameters.
n
The number of the line in which the data window is to be inserted.
m
The number of the column in which the data window is to be inserted.
338 Editors
Summary of Main Commands
DELETE
*
ALL
[T]'string' CHARS
NEXT
'string' .X n WORD NX
DELETE PREV
C'string' .X .Y n m PREFIX X
FIRST
X'string' SUFFIX
LAST
P'string'
You can specify that only lines which contain a specified character string are to be deleted as
described in the following section.
T'string'
Deletes lines that contain the string irrespective of whether it is in lower case or upper case.
This is the default.
'string'
Same as T'string'.
C'string'
Deletes lines that contain the string exactly as specified.
X'string'
Deletes lines that contain the string which corresponds to the specified hexadecimal character
string.
P'string'
Deletes lines that contain the string which includes the following wildcard characters:
= any character
§ alphabetic character
# numeric character
$ special character
^ non-blank character
- non-numeric character
< lower-case character
> upper-case character
*
Uses the search string specified in a previous command (for example, FIND, CHANGE, EXCLUDE).
.X
See Line Specifications for an explanation.
.X .Y
n
See Column Specifications for an explanation.
n m
ALL
See Direction of Operation for an explanation.
Editors 339
Summary of Main Commands
NEXT
PREV
FIRST
LAST
CHARS
See Special Occurrences for an explanation.
WORD
PREFIX
SUFFIX
NX
See Displayed or Non-Displayed Lines for an explanation.
If you enter the DELETE command without any parameters, the current line is deleted.
To delete lines, you can also use the line commands D, Dn and DD.
Example 1:
This command deletes all lines that contain the string NAME (in upper case exactly as entered here)
as a prefix to a word in all lines not excluded from display, if NAME occurs between columns 1 and
20.
Example 2:
This command deletes all lines that contain the string Abc (exactly as entered here) between columns
10 and 30 within the block of lines labeled with .X and .Y
340 Editors
Summary of Main Commands
DOWN
DOWN [n]
The parameter n specifies the number of lines to be scrolled downwards. If n is omitted, the scroll
amount is determined by the scroll mode.
DWINDOW
DWINDOW
EMPTY
ON
EMPTY
OFF
OFF
Blank lines are not deleted.
ON
Blank lines are deleted.
If you enter EMPTY without any parameter, it is interpreted as EMPTY ON. The default setting is
EMPTY OFF (no suppression) and can be changed by editing your profile; see Setting the Editor
Profile.
Editors 341
Summary of Main Commands
END
Stores the data including all changes and leaves the Software AG Editor.
END
If AUTOSAVE is set to OFF and you have changed data, the editor asks you to issue a SAVE or CANCEL
command.
ESCAPE
ON
ESCAPE [character]
OFF
This command activates or deactivates the escape character to precede line commands entered in
the first column of the data.
The parameter character is the special character to be used. The default escape character is the
period (.).
If you issue the ESCAPE command without any parameter, it is interpreted as ESCAPE ON. Default
is ESCAPE OFF. Can be changed by editing profile; see Setting the Editor Profile.
EXCLUDE
*
ALL
[T]'string' CHARS
NEXT
EXCLUDE 'string' .X n WORD
PREV
X C'string' .X .Y n m PREFIX
FIRST
X'string' SUFFIX
LAST
P'string'
342 Editors
Summary of Main Commands
You can specify that only lines which contain a specified character string are to be excluded from
display as described in the following section.
T'string'
Excludes lines that contain the string irrespective of whether it is in lower case or upper
case. This is the default.
'string'
Same as T'string'.
C'string'
Excludes lines that contain the string exactly as specified.
X'string'
Excludes lines that contain the string which corresponds to the specified hexadecimal character
string.
P'string'
Excludes lines that contain the string which includes the following wildcard characters:
= any character
§ alphabetic character
# numeric character
$ special character
^ non-blank character
- non-numeric character
< lower-case character
> upper-case character
*
Uses the search string specified in a previous command (for example, FIND, CHANGE, EXCLUDE).
.X
See Line Specifications for an explanation.
.X .Y
n
See Column Specifications for an explanation.
n m
ALL
See Direction of Operation for an explanation.
NEXT
PREV
FIRST
LAST
CHARS
See Special Occurrences for an explanation.
WORD
PREFIX
SUFFIX
Editors 343
Summary of Main Commands
If you enter the EXCLUDE command without any parameters, the current line is excluded from
display.
Example 1:
EX 10
Example 2:
This command excludes from display all lines which contain NAME (in upper case as entered here)
as a prefix to a word, starting from the line labeled with .X.
FIND
*
ALL
[T]'string' CHARS
NEXT
'string' .X n WORD NX
FIND PREV
C'string' .X .Y n m PREFIX X
FIRST
X'string' SUFFIX
LAST
P'string'
This command is used to search for a specific character string. The cursor is placed on the begin-
ning of the first found string. If the line containing the string was excluded from display, it is
displayed when found.
If you want an apostrophe to be part of the string, you must write it as two apostrophes.
T'string'
Searches for the string irrespective of whether it is in lower case or upper case. This is the
default.
'string'
Same as T'string'.
C'string'
Searches for the string exactly as specified.
X'string'
Searches for the string that corresponds to the specified hexadecimal character string.
344 Editors
Summary of Main Commands
P'string'
Searches for a string which includes the following wildcard characters:
= any character
§ alphabetic character
# numeric character
$ special character
^ non-blank character
- non-numeric character
< lower-case character
> upper-case character
*
Searches for the string specified in the previous FIND command.
.X
See Line Specifications for an explanation.
.X .Y
n
See Column Specifications for an explanation.
n m
ALL
See Direction of Operation for an explanation.
NEXT
PREV
FIRST
LAST
CHARS
See Special Occurrences for an explanation.
WORD
PREFIX
SUFFIX
NX
See Displayed or Non-Displayed Lines for an explanation.
The FIND command differs from the LOCATE command in the following ways:
■ The FIND command is more effective for text searches while the LOCATE command is used
primarily to find line numbers or line labels.
■ The LOCATE command finds only text in upper case beginning in column one of the editor. In
addition, in order to find a string, the data in the editor must be in alphabetical order.
Editors 345
Summary of Main Commands
■ When a line is located with the LOCATE command, the cursor is placed in the prefix area and the
line is placed at the top of the editor; with the FIND command, the cursor is placed on the string
searched and the line is not necessarily placed at the top of the editor.
Example 1:
This command searches for any occurrence of NAME exactly as entered here as a prefix of a word
in any excluded line within the block delineated by .X and .Y.
Example 2:
F C'HILITE' X PREV
This command searches for the previous occurrence of HILITE exactly as entered here in any ex-
cluded line.
Example 3:
F P'RCV#' .X .Z 20 30
This command searches for any 4-character string that begins with RCV and whose fourth character
is numeric. It searches within the block of lines delineated by .X and .Z and between columns 20
to 30.
Example 4:
F X'6C' SUFFIX NX
This command searches for the character with hexadecimal representation 6C. Only those occur-
rences of the character that are at the end of word are found. The search is valid for non-excluded
lines only.
Example 5:
F '''w'
Example 6:
F 'r''w'
Example 7:
F ''''
346 Editors
Summary of Main Commands
FIX
ON
FIX n
OFF
This command is used to specify the number of columns n, starting with column 1, to remain in
display when scrolling to the right. The default setting is FIX OFF 000 and can be changed by
editing your profile; see Setting the Editor Profile.
HEX
ON
HEX
OFF
The default setting is HEX ON and can be changed by editing your profile; see Setting the Editor
Profile.
INCLUDE
*
ALL
[T]'string' CHARS
NEXT
'string' .X n WORD
INCLUDE PREV
C'string' .X .Y n m PREFIX
FIRST
X'string' SUFFIX
LAST
P'string'
This command is used to re-display lines that were excluded from display by an EXCLUDE command.
The command takes the same parameters as the EXCLUDE command.
If you enter the INCLUDE command without any parameters, it includes the first line of an excluded
block.
Example:
Editors 347
Summary of Main Commands
This command recalls all excluded lines with NAME as a prefix to a word exactly as entered here,
starting from the line labeled .X.
JLEFT
ALL
JLEFT n
n m
ALL
Aligns the data of all lines.
n
Aligns the data from line n to the last line.
n m
Aligns the data from line n to line m.
The JLEFT command applies only within the horizontal boundaries as set with the main command
BNDS.
For left-justification, you can also use the line commands LJ and LJJ.
Example:
BNDS 10;JLEFT 15 20
The data between column 10 and the rightmost column of your screen in lines 15 to 20 is left-
aligned to column 10.
JRIGHT
ALL
JRIGHT n
n m
348 Editors
Summary of Main Commands
ALL
Aligns the data of all lines.
n
Aligns the data from line n to the last line.
n m
Aligns the data from line n to line m.
The JRIGHT command applies only within the horizontal boundaries as set with the main command
BNDS.
For right-justification, you can also use the line commands LJ and LJJ.
Example 1:
BNDS 4 40;JRIGHT 6 18
Example 2:
BNDS 10;JRIGHT 15
The data to the right of column 10 in line 15 is right-aligned to the rightmost column of your
editing screen.
JUSTIFY
LEFT
JUSTIFY RIGHT
BOTH
This command is used to set the justification mode for the line commands TO and TOO.
Editors 349
Summary of Main Commands
TO and TOO are used to join data lines with subsequent lines. Both commands apply only within
the horizontal boundaries as set with the main command BNDS.
LEFT
The data is aligned to the left boundary.
RIGHT
The data is aligned to the right boundary.
BOTH
The data is aligned to both boundaries.
Example:
With these commands, you set the horizontal boundaries to columns 10 and 60, and activate left-
justification:
When you then mark a line with a TO line command (or a block of lines with two TOO line com-
mands), the data between columns 10 and 60 in the marked line(s) is left-aligned to column 10.
LABEL
LABEL .label
This command is used to mark the current line (that is, the line which is currently at top of the
editing area) with the specified .label.
Example:
To label the current line with .X, you enter the command:
LABEL .X
You can also mark a block of lines with two labels. For example, to mark a block with labels .X
and .Y, you first mark the current line (assuming it is the first line of the block to be marked) with
.X as shown in the example above; then you scroll until the last line of the block is the current line;
then you issue the command LABEL .Y to mark that line with .Y.
To mark a line with a label, you can also use the line command .label; see the section Summary
of Line Commands.
350 Editors
Summary of Main Commands
LC
*
ALL
[T]'string' CHARS
NEXT
'string' .X n WORD NX
LC PREV
C'string' .X .Y n m PREFIX X
FIRST
X'string' SUFFIX
LAST
P'string'
You can specify that only lines which contain a specified character string are to be changed to
lower case. If you want an apostrophe to be part of the string, you must write it as two apostrophes.
T'string'
Changes lines which contain the string irrespective of whether it is in lower case or upper
case. This is the default.
'string'
Same as T'string'.
C'string'
Changes lines which contain the string exactly as specified.
X'string'
Changes lines which contain the string that corresponds to the specified hexadecimal character
string.
P'string'
Changes lines which contains a string that includes the following wildcard characters:
= any character
§ alphabetic character
# numeric character
$ special character
^ non-blank character
- non-numeric character
< lower-case character
> upper-case character
*
Changes lines which contain the string used in the previous command in which a string
was specified.
.X
See Line Specifications for an explanation.
.X .Y
n
See Column Specifications for an explanation.
n m
Editors 351
Summary of Main Commands
ALL
See Direction of Operation for an explanation.
NEXT
PREV
FIRST
LAST
CHARS
See Special Occurrences for an explanation.
WORD
PREFIX
SUFFIX
NX
See Displayed or Non-Displayed Lines for an explanation.
If you enter the LC command without any parameters, the current line is changed to lower case.
Example:
This command changes to lower case all displayed lines within the block labeled with .X and .Y
if they contain the string NAME (in upper case as entered here) as prefix to a word.
LEFT
n
LEFT
LEFT
n
Scrolls n number of columns to the left.
LEFT
Scrolls the maximum amount to the left.
352 Editors
Summary of Main Commands
LIMIT
LIMIT [n]
With this command, you specify the maximum number of lines to be searched with a FIND or
RFIND command. The parameter n is the number of lines to be searched. This setting can be changed
by editing your profile; see Setting the Editor Profile.
LOCATE
0
[LOCATE] n
.label
This command is used to scroll a specific line to the top of the editing area (that is, make it the
current line).
0
Makes the first line of the data current.
n
Makes line n current.
.label
Makes the line labeled .label current.
The LOCATE command differs from the FIND command in the following ways:
■ The FIND command is more effective for text searches while the LOCATE command is used
primarily to find line numbers or line labels.
■ The LOCATE command finds only text in upper case beginning in column one of the editor. In
addition, in order to find a string, the data in the editor must be in alphabetical order.
■ When a line is located with the LOCATE command, the cursor is placed in the prefix area and the
line is placed at the top of the editing area; with the FIND command, the cursor is placed on the
string searched and the line is not necessarily placed at the top of the editing area.
Examples:
LOC 32
Editors 353
Summary of Main Commands
32
Same as above.
LOC .X
LOG
ON
LOG
OFF
The log file is a history of all modifications made in the editor since session begin. When the log
file is active, each time you press ENTER, the changes made since the previous ENTER are recorded
in the log file. When using the UNDO command you can consecutively back out changes made since
the beginning of the editing session. Edit your profile to change the setting; see Setting the Editor
Profile.
Important: You must ensure the LOG is activated before starting to edit.
MASK
ON
MASK
OFF
This command activates or deactivates the mask function. When the mask function is active, each
time you insert a line in the editor, a predefined line of text is entered instead of a blank line. The
mask line is defined by using the MASK line command. The mask function is useful when you must
write several lines of code which are identical or very similar.
For detailed instructions on using the mask function, see To define and use a mask line.
The default setting is MASK OFF and can be changed by editing your profile; see Setting the Editor
Profile.
354 Editors
Summary of Main Commands
MWINDOW
n
MWINDOW
n m
This command is used to move a data window according to the command parameters.
n
The number of the line in which the data window is to be inserted.
m
The number of the column in which the data window is to be inserted.
NULLS
ON
NULLS
OFF
This command is used determine if the data lines are to be filled with null characters.
ON
The end of each line is filled with null characters.
OFF
Lines are not filled with null characters.
The default setting is NULLS ON and can be changed by editing your profile; see Setting the Editor
Profile.
ORDER
ALL
ORDER n
n m
Editors 355
Summary of Main Commands
ALL
Joins all lines.
n
Joins the lines from line n to the last line.
n m
Joins lines from line n to line m.
The ORDER command applies only within the horizontal boundaries as set with the main command
BNDS.
Within the set boundaries, the lines are concatenated and are filled to the greatest possible extent;
words that do not fit into one line are automatically placed in the next line.
To join data lines, you can also use the line commands TF, TO and TOO.
POWER
POWER
This command switches the editor to text-entry mode. You are presented with a blank screen into
which you can enter one or more lines of text. After entry, press ENTER and the text is inserted into
the first line of the editing area.
PROFILE
PROFILE [n]
This command displays your editor profile at the top of the edit screen.
With n you specify additional lines to be displayed. Possible values for n are:
6
Displays your editor profile and all tab positions (as specified by TABS command).
7
Displays same as 6, plus the mask line (as specified by the MASK command).
8
Displays same as 7, plus boundaries (as specified by the BNDS command).
9
Displays same as 8, plus column numbers (as specified by the COLS command).
356 Editors
Summary of Main Commands
PROTECT
INS
PROTECT ON
OFF
This command is used to protect the prefix area. To enter line commands with the prefix area
protected, type the line command in column 1 of the editing area preceded by the escape character.
INS
Protects the prefix area of lines added when using the insert line command.
ON
Activates protection.
OFF
Deactivates protection.
The default setting is PROTECT ON and can be changed by editing your profile; see Setting the Ed-
itor Profile.
RCHANGE
RCHANGE
RECOVERY
ON
RECOVERY [n]
OFF
This command is used to activate or deactivate the recovery feature for the current editing session.
You can also specify the number of updates to be performed before a checkpoint save is performed.
When using parameter n, you specify the number of updated lines after which a checkpoint save
is performed.
The default setting is RECOVERY ON and can be changed by editing your profile; see Setting the
Editor Profile.
Editors 357
Summary of Main Commands
RENUMBER
ON
RENUMBER OFF
n1 n2 n3
For PDS members and sequential data sets only. Specifies renumbering of the lines in the editing
area according to the parameters.
ON
Activates renumbering.
OFF
Deactivates renumbering.
n1
Increment of numbering (default is in your edit profile).
n2
Starting column for the new line number (default: 73).
n3
End column for the new line number (default: 80).
RESET
RESET
This command resets all pending line commands and deletes all line labels.
RFIND
RFIND
358 Editors
Summary of Main Commands
RIGHT
n
RIGHT
RIGHT
n
Scrolls n number of columns to the right.
RIGHT
Scrolls the maximum amount to the right.
SORT
.X A
SORT [n m]
.X .Y D
The SORT command sorts lines in the editor in ascending or descending alphabetical order. An
unqualified SORT command sorts all data in the object in ascending order.
n m
Sorts from column n to column m.
.X
Sorts from line labeled .X to end of object.
.X .Y
Sorts from line labeled .X to line labeled .Y (where .X and .Y are any string of up to four characters).
A
Sorts data in ascending order (A to Z).
D
Sorts data in descending order (Z to A).
Editors 359
Summary of Main Commands
TABS
ON [tab-character]
OFF
TABS LEFT
RIGHT [tab-character] [column...]
DECIMAL
You can enable or disable logical or physical tabulation by using the command TABS ON or TABS
OFF. Tabulation is also enabled by any command that changes a tabulation setting.
For example, the following command enables logical tabulation with the ampersand sign (&) as
logical tabulation character:
TABS &
You set tab positions by using the TABS command. For example, the following command sets tabs
in columns 10, 20 and 30:
TABS 10 20 30
You can enter data and automatically move it to a specific tab position by preceding it with a lo-
gical tabulation character. One tabulation character moves the data to the next tab position, two
tabulation characters move the data to the second tab position, and so on.
To display the current TABS command settings, issue the main command PROFILE.
To display the current tab positions, issue the line command TABS.
The default setting is TABS OFF blank and can be changed by editing your profile; see Setting the
Editor Profile.
Apart from tab positions, you can specify the following parameters with the TABS command:
LEFT
Places the data left-justified at the tab position.
RIGHT
Places the data right-justified at the tab position.
DECIMAL
Places the data so that the decimal point in the data is at the tab position.
360 Editors
Summary of Main Commands
To tabulate data in a specific column, multiple tab characters are possible: issue the TABS line
command and type over each asterisk (*) marking the tab positions with another special character.
Any input preceded by any of these special characters are tabulated in the corresponding column.
You can type an L (for LEFT), an R (for RIGHT) or a D (for DECIMAL) after each tabulation character
to specify placement of data for the tab position.
Note: For further instructions and examples of using tabulation, see also Using the Physical
or Logical Tabulator.
TOP
TOP
This command is used to scroll to the beginning of the object being edited.
UC
*
ALL
[T]'string' CHARS
NEXT
'string' .X n WORD NX
UC PREV
C'string' .X .Y n m PREFIX X
FIRST
X'string' SUFFIX
LAST
P'string'
The UC command converts one or more lines to upper case. It applies the same parameters as the
LC command. If you enter the UC command without parameters, it changes the current line to upper
case.
UNDO
ALL
UNDO
n
If the log file is active (see the LOG command), the UNDO command backs out all changes made since
the last time you pressed ENTER. Repeated use of the UNDO command backs out consecutive changes
in reverse order. You can thus back out all changes one by one until you restore the source to its
original status at session begin.
Editors 361
Summary of Main Commands
You can specify the following parameters with the UNDO command:
ALL
All modifications made in the current editing session are backed out.
n
The last n modifications are backed out.
UNREN
UNREN [n m]
n
Specifies the starting column of the line numbers (default: 73).
m
Specifies the end column of the line numbers (default: 80).
UP
UP [n]
The parameter n specifies the number of lines to be scrolled upwards. If n is omitted, the scroll
amount is determined by the scroll mode.
WINDOW
n
WINDOW l1 l2
n m
362 Editors
Summary of Main Commands
This command is used to define a data window to be copied or moved. The starting line and
column and the end line and column of the window are specified in the command parameters.
At least l1 and l2 are required.
l1 l2
Defines a window starting at column 1 of line l1 and ending in the last column of line l2.
l1 l2 n
Defines a window starting at column n of line l1 and ending at the last column of line l2.
l1 l2 n m
Defines a window starting at column n of line l1 and ending at column m of line l2.
Note that all data in the source work area within the specified points becomes part of the window.
For an example, see the section Copying a Window with Data.
XSWAP
XSWAP
The command is used to exchange displayed lines with excluded lines. Lines are excluded by using
the EXCLUDE command.
There are some options which are available with several main commands. These options are de-
scribed in the following section.
■ Redisplay Feature
■ Line Specifications
■ Column Specifications
■ Displayed or Non-Displayed Lines
■ Direction of Operation
Editors 363
Summary of Main Commands
■ Special Occurrences
Redisplay Feature
The editor provides a command redisplay feature: if you precede a command with two ampersands
(&&), it remains displayed in the command line and is executed every time you press ENTER until
you delete the command or overtype it.
Line Specifications
With these options, you can restrict the effect of a command to a certain range of lines:
.X
The command affects only the lines from the line labeled .X to the last line.
.X .Y
The command affects only the lines from the line labeled .X to the line labeled .Y.
X and Y can also be any label of 1 to 4 alphabetic characters (see the LABEL command).
Column Specifications
With these options, you can restrict the effect of a command to a certain range of columns. These
column numbers refer to the actual data columns; the line numbers preceding the data are not
counted. So, if you specify column 1 with a command, this may physically be the 8th column of
your screen, but it is in fact the 1st column of the data you are editing.
n
The command affects only lines in which the specified string begins in column n (that is, the first
character of the string must be in column n).
n m
The command affects only lines in which the specified string occurs anywhere between columns n
and m.
With one of the following options, you can specify that only excluded or only included lines are
to be affected by a command:
NX
The command affects only non-excluded lines; that is, lines which are currently being displayed.
X
The command affects only excluded lines; that is, lines which are currently not being displayed as
specified by the EXCLUDE command. An excluded line remains excluded from display if a main command
function is performed on it.
364 Editors
Summary of Main Commands
Direction of Operation
With these options, you can specify the direction in which a command is to operate:
NEXT
The command affects the next line (starting from the cursor position) in which the specified string
occurs.
PREV
The command affects the line that contains the previous occurrence of the specified string.
FIRST
The command affects the first line in which the specified string occurs.
LAST
The command affects the last line in which the specified string occurs.
ALL
The command affects all lines in which the specified string occurs.
Special Occurrences
With these options, you can specify whether only special occurrences of the specified string are
to be affected by a command:
CHARS
The command affects any line in which the specified string occurs.
WORD
The command affects only those lines in which the specified string forms a word.
PREFIX
The command affects only those lines in which the specified string is the beginning of a word.
SUFFIX
The command affects only those lines in which the specified string is the end of a word.
Editors 365
366
Index
E
editors
overview of, 1
367
368