Chapter 12:  Editing in ACCENT R

Within ACCENT R there is a need to edit commands as they are being entered.  There is also a need for an editor to make it possible to create and modify DBL objects.

If you are simply typing in a command and make a typing error, you need a way to correct it.  If you are creating an item such as a Command Module (CM) then you need to be able to enter and edit individual lines.

ACCENT R provides interline editing with SLIM for immediate correction of typing errors.  This is the single line edit mode.  ACCENT R also has TED a line number oriented text editor.  For entering DBL objects, use TED in conjunction with SLIM an external Editor such as VI, Emacs or EDT may be used instead of TED and SLIM.  How to use each of these is explained in this chapter.

EXTERNAL EDITORS

A favorite editor may be specified for creating various Data Base Library (DBL) objects.  By SETting the system field @EDITOR to the equated command that calls the external editor (see example below).  The DEFINE, EDIT or MODIFY commands will invoke the external editor from @EDITOR.  Each external editor has variations in how it operates.  The specific editor's manual should be referenced if questions arise.

The default value for @EDITOR is spaces.  The ACCENT R editor (TED) is called by default if an external editor is not specified in @EDITOR.

When modifying an existing DBL object, ACCENT R will transfer the text to a file and call the editor as specified in the System Field @EDITOR.

Example

SET "EVE" TO @EDITOR MODIFY CM TEST

After editing is complete, give the external editor commands to save the file and exit.  After editing an ACCENT R DBL object control is returned to the subcommand level of the ACCENT R editor (TED) and a "_ _" prompt will appear.

The SAVE or HOLD subcommand of TED must be given to save the object in the DBL even if it has been saved with the external editor.  If the object has errors, you may give the HOLD command to save the text of the object and then give the STOP command.  To return to the ACCENT R command level, or you may use TED to correct them or return to the external editor by issuing the command EDIT.

HOLD or SAVE will reassign line numbers to the objects starting from one with increments of one.

An external editor can only be called from a command file (.CMD) with the EDIT command.  If a DEFINE or MODIFY command is executed in a command file the ACCENT R editor (TED) is called.

Example

*SET "EVE" TO @EDITOR
*MODIFY CM EXAMPLE

This will load the text of the CM example into EVE and transfer control to EVE.

SLIM (Single Line IMage editing)

SLIM is an intro to a line editor.  SLIM addresses the line image of the previous line entered.  The line image is a copy of the last line of input.

The full range of SLIM’s capabilities is described in this chapter.  Becoming familiar with even a few of SLIM’s capabilities can save much time by eliminating unnecessary retyping.

SLIM is invoked by typing the control and V key twice at the ACCENT R command level on OpenVMS and esc key on UNIX platforms.

The line being modified is displayed on the screen with the cursor placed on the first character in the line.

Invoking SLIM immediately following an ACCENT R prompt allows image editing of the previous line entered at the same-level prompt.  For example, invoking SLIM at the first position following the command level prompt (*) allows editing of the previous command, regardless of any editing commands or data entry that may have occurred.  Invoking SLIM anywhere other than the first position of a line allows editing of the current line.

If the command or statement contains multiple lines with line continuations (ampersands, &) SLIM allows free movement between lines and edit all the lines in the command or statement.

SLIM’s line image edit mode is terminated by typing one of the following:  <CR>, <LF>, or Control-Z.

Image Editing Of Commands

The previous command line, providing one exists, can be edited by invoking SLIM after ACCENT R’s command level prompt (*).

Image Editing Of Editing Commands & Line-Numbered Statements

The previous editing command or numbered line, providing one exists, is accessed by invoking SLIM at the first position following the edit level prompt (--).  As with image editing of commands, consecutive lines can be generated by using each newly edited line as an image for the next line.  When editing is completed, ACCENT R accepts that line as if it were entered directly.

Image Editing During Insert & Replace Mode

Line image editing can also be used during text entry with the INSERT and REPLACE editing commands.  (See description of INSERT and REPLACE later in this section.)  Invoking SLIM in the first character allows editing on the previously inserted line.  Invoking SLIM at any other position than the first character of the line allows editing on that line.  When editing with SLIM is completed, the line is accepted by ACCENT R and the INSERT or REPLACE process continues until the terminator "END" or Control-Z is typed.

SLIM’s Line Image Operations

The SLIM editing operations are described here.  Until image editing is terminated, any number of different editing operations may be employed.

SLIM OPERATION

PURPOSE

 

The B character deletes the previous word.  A word is defined as one or more letters or digits followed by a space or tab.  Many special characters are individually considered a word:

B

&

>

]

*

{

}

!

[

\

ç

<

¢

/

(

-

:

-

Ù

,

+

;

²

#

@

=

?

Three special characters, period (.), percent sign (%), and the dollar sign ($) are treated as letters or digits.  They are NOT treated as words.

Backspace (or) Control-H

The backspace key or Control-H moves the cursor to the previous character.  A line continuation (&) is treated as a character.

<CR>

The carriage return key displays the rest of the line and terminates SLIM editing.  If the line is a command, it will be executed.

D

The D character deletes the current character and positions the cursor on the next character.

Delete/Rubout

The Delete/Rubout key deletes the previous character and leaves the cursor on the current character.

F/S

The F (find) or S (search) character, followed by a "character" moves the cursor to the next occurrence of the specified ”character“.

I

The I character invokes the insert mode, allowing text to be inserted at the current position.  The insert mode can terminated by a carriage return or the Esc key.

P

The P character redisplays the current line and leaves the cursor at the current position.

R

The R character redisplays the current line and positions the cursor at the beginning of the line.

A

Set cursor at the end of the line and invoke insert mode.

Z

Erase to the end of the line and invoke insert mode.  (See I)

Space Bar

The space bar moves the cursor to the next position.

TAB

The TAB key moves the cursor to the end of the line.

Control-U

Control-U ignores all SLIM changes entered on the line, and redisplays the original line with the cursor at the beginning of the line; allows editing anew on the line restart editing.

W

The W character moves the cursor to the next word.  Refer to the B operation for a discussion of what constitutes a "word".

X

The X character deletes the current word.  Refer to the B operation for a discussion of what constitutes a "word".

The power of TED lies in its capability to manipulate multiple lines of text.  It can manipulate the text of any ACCENT R object that contains line-numbered statements.  When this editor is invoked for a System File (SF), line numbers are automatically assigned.

TED provides a variety of editing commands used to establish and change statements of all those ACCENT R objects that are defined with the DEFINE command.  The DEFINE and MODIFY commands cause ACCENT R to enter an interactive environment called the edit level.  In that environment, use TED editing commands to enter, display, change, or save statements while defining or modifying an ACCENT R object.  At the edit level, a double-hyphen prompt (--) is displayed at the terminal to indicate that ACCENT R is ready to accept an editing command or text.

The TED editing commands are discussed in this chapter in alphabetical order.  They are listed below with their minimum abbreviations underlined.

COMMAND

FUNCTION

ALTER

invokes SLIM on existing line(s)

COPY

copies existing line(s)

DELETE

removes line(s)

EDIT

invokes external editor if one specified in @EDITOR, otherwise SLIM is invoked on existing line(s)

FIND

locates specific text

HOLD

stores current line(s)

INSERT

allows new line(s) to be entered

MOVE

moves line(s)

NUMBER

renumbers line(s)

PRINT

display line(s)

REPLACE

replaces line(s)

SAVE

compiles and saves line(s)

STOP

leaves the edit level without compiling

STRUCTURE

accesses a Schema Definition

SUBSTITUTE

changes multiple occurrences of specific text

UP

moves to preceding line

USE

reads a specified System File

Creating New Lines

ACCENT R provides two ways to enter new lines.

First, use the INSERT editing command, which prompts for new text by supplying the line numbers (see discussion of INSERT later in this chapter).

Second, enter new lines by typing a line number and the line of text.

Type the lines in any numerical order, and ACCENT R will put them into ascending numerical sequence.

NOTES:  If typing the number of an existing line, ACCENT R will replace the old line with the new line that is entered.

Changing Existing Lines

TED provides several editing commands for changing existing lines.  The following list points out the differences of these editing commands.  See the following pages for detailed discussion of each editing command.

COMMAND

FUNCTION

ALTER

invokes SLIM for line image editing

EDIT

invokes the external editor if one is specified in @EDITOR, otherwise, SLIM is invoked for line image editing; same as ALTER

REPLACE

deletes old lines; prompts for insertion of new lines by displaying replacement line numbers

SUBSTITUTE

replaces a given string wherever it occurs in specific lines

It is possible to replace a line by typing its number and the new text.

Line Addressing

Many TED editing commands allow one line, a range of lines, or up to ten line ranges to be addressed.  The following form applies to all editing commands that allow line addressing.

A TED line address can be specified in any of the following ways:

The default line range is 1:  *

Where several individual line addresses or line address ranges are allowed, the general form shows the line address specification enclosed in back slashes.  In these cases, up to ten line addresses and/or ranges of addresses can be used.  They are separated by commas.  For example, if the general form contains:

\\addr1 [:addr2]\\

The following groups of line addresses could be entered:

5,10:50,70,90,200:270
.:*
10,20:90,.:.+5,*

When using a number to address a particular line, an existing line number must be specified.  However, if specifying a range, or if using a single line number as a destination pointer, use line numbers that don’t exist.  For example, if editing a Process Module (PM) that includes lines 10, 20, 30, 40, 50, 60, 70, any of the following line specifications are acceptable:

PRINT 60:79
DELETE 15:35
EDIT 20
MOVE 20:40 TO 55

TED Editing Commands

The following pages explain the TED editing commands.  These commands generate and alter statements from ACCENT R objects (which are created with the DEFINE command).

Alter

Purpose:  The ALTER editing command invokes the single line image editor (SLIM), described earlier in this section, on a line or range of lines.  Each line image is made available for editing.

Syntax

A/LTER/ \\addr1 [:addr2]\\

addr1

is the address of a line to be edited or the address of the first line of a range of lines to be edited.

addr2

is the address of the last line of a range to be edited

Example

--ALTER 810
00810  TYPE @QUALIFIED

The cursor is positioned at the first character of the line, e.g., "T" of "TYPE".  Use the SLIM operations to edit the current line, terminating with a carriage return.

NOTES:  Up to ten lines or line ranges can be specified, separated by commas.

Because the ALTER editing command invokes SLIM, the line image editing characters (described earlier in this chapter) must be used to edit the specified line(s).  When line image editing is terminated on a line in a specified line range, TED prompts with the next line number until all lines in the range have been edited.

ACCENT R also provides an ALTER command which performs an entirely different function.  It is used for changing the values of a Data Set (DS) records and must be invoked at the command level.

Copy

Purpose:  The COPY editing command copies a line or range of lines to another location.  If necessary, COPY adjusts the line numbers to make room for the inserted lines.

Syntax

C/OPY/ addr1 [:addr2] TO addr3

addr1

is the address of the line to be copied, or the first address in a range of lines to be copied.

addr2

is the address of the last line of a range to be copied.

addr3

specifies the address of the line at which the copied lines are to be inserted.  If addr3 is an already existing line number, the copied text will be inserted after that line number.  If addr3  references a non-existing line number, the copied text will be inserted at the newly created line number.  A comma can be used in place of the TO.

Example

--PRINT
00002  PUB_CODE,CHAR,4
00004  PUB_NAME,CHAR,40
00006  CITY,CHAR,20
00008  STATE,CHAR,2
00010  COUNTRY,CHAR,20
--COPY 2:4,5
--PRINT
00002  PUB_CODE,CHAR,4
00004  PUB_NAME,CHAR,40
00005  PUB_CODE,CHAR,4
00006  PUB_NAME,CHAR,40
00007  CITY,CHAR,20
00008  STATE,CHAR,2
00010  COUNTRY,CHAR,20
--

NOTES:  ACCENT R numbers the duplicated lines, incrementing by one, so that ascending sequence is maintained where they are copied.  If a conflict occurs, existing lines will also be renumbered to prevent them being overwritten.

Delete

Purpose:  The DELETE editing command deletes one or more existing lines.

Syntax

D/ELETE/ \\addr1 [:addr2]\\

addr1

is the address of a single line to be deleted, or the first line number of a range of lines to be deleted

addr2

is the address of the last line to be deleted when a range of lines is intended

Example

--DELETE 10, 70:140,190

Here DELETE deletes line 10, all lines with line numbers between 69 and 141, and line 190.

--15

This entry deletes the text on line 15 but retains the line number.

NOTES:  Up to ten individual lines or ranges of lines can be specified, separated by commas.

Edit

Purpose:  EDIT with no line address, invokes the external editor if one is specified in @EDITOR.  If a line address is specified, the line image editor (SLIM) is invoked on each specified line or range of lines.  Each line is displayed at the terminal before its line image is available for editing.

Syntax

E/DIT [\\addr1 [:addr2]\\]

addr1

is the address of a line to be edited or the address of the first line of a range of lines to be edited.

addr2

is the address of the last line of a range to be edited.

Example

--EDIT 290:300
00290  25  TO @LINES

The first line is displayed and cursor is positioned at the first character of the line, e.g., “2” of 25.  Use SLIM operations to edit the line, terminating with a carriage return.  When editing is completed for the first line, the next line is displayed.

NOTES:  Up to ten lines or line ranges can be specified, separated by commas.

After entering an EDIT, ACCENT R displays the indicated line and enters SLIM for line image editing.  The line image editing characters were described earlier in this chapter under SLIM.

Find

PURPOSE:  FIND locates specified text and displays the lines containing the text at the terminal.

Syntax

F/IND/ [/AND/ SIGNAL] \\[addr1 [:addr2] ;ALL] \\"string" [,n]

FIND

issued with no options searches the entire file for "string" and displays each line containing it.

/AND/ SIGNAL

rings the bell or beeps (Control G) every time a line containing the string is found.

addr1

is the address of the line to be searched or the address of the first line of a range to be searched.

addr2

is the address of the last line in a range to be searched.

ALL

specifies that all existing lines are to be searched for the string, this is the default condition when no n is specified.

string

is the character(s) to be located.  They are enclosed in delimiters.  Acceptable delimiters are pairs of quotation marks (" "), number signs (# #), dollar signs ($ $), or slashes (/ /).

n

specifies the number of repetitions that are to be found.

Example

--FIND "SECTION"
00010  CONTROL SECTION
00040  DECLARE SECTION
00090  INITIAL SECTION
00130  HEADINGS SECTION
00180  DETAILS SECTION
--

NOTES:  Up to ten single lines or line ranges can be specified, separated by commas.

If n is specified without a line range, the search begins at the current line and continues until n occurrences of "string" have been found.  If n is specified with one or more line ranges, the search begins at the first lines specified and continues until n occurrences of "string" have been found.  The delimiters of string can be "", ##, //, and $$.

Hold

Purpose:  HOLD is used to save a current copy of the text being created or modified.  HOLD will store text that is incomplete or contains errors, and returns control to the edit level.

Syntax

HO/LD/

Example

--HOLD
--PRINT
CITY,CHAR,20
STATE,CHAR,2
COUNTRY,CHAR,20
--STOP
*LIST SF DATA1
CITY,CHAR,20
STATE,CHAR,2
COUNTRY,CHAR,20

NOTES:  Statements stored in the Data Base Library (DBL) by using the HOLD command cannot be executed.  SAVE must be used to create an executable version.  If an object has previously been saved, HOLD deletes the old compiled version when it stores the current text version.

HOLD should be issued at intervals to save text being created or modified, particularly when working on a sizable object.  Then if the computer fails all work will not be lost, since text created before the last HOLD will be written in the DBL.  HOLD is also useful for saving an object being edited which contains errors that cannot be fixed immediately or when work has to be interrupted.

After a HOLD, it is possible to leave edit level with the STOP editing command.

Insert

Purpose:  INSERT allows new lines to be entered at a specified location and supplies line numbers for the new lines.

Syntax

I/NSERT/ [/AT/ addr] [BY incr]

/AT/addr

specifies the address of the line after which new lines will be inserted.  If this option is omitted, new lines are inserted after the current line.  If INSERT is given in an empty object, ACCENT R begins numbering at 100 by default.

BY incr

specifies the value by which new lines are to be incremented.  A comma (,) can be used instead of BY.  The default increment value, if this option is not included, is 10.

Example

In the following example, note that ACCENT R has renumbered the last line so that it follows inserted lines.

*MODIFY SD DISCOUNTS_DBM2
--PRINT
00010  DISCOUNT_TYPE,CHAR,40
00020  STORE_CODE,CHAR,4
00030  LO_QTY,INT,6
00040  HI_QTY,INT,6
00050  DISCOUNT,FLOAT,3
--INSERT AT 10 BY 5
00015  CONTRACT,CHAR,40
00020  CO_CODE,CHAR,4
00025  LOW_AMT,INT,6
00030  MID_AMT,INT,6
--PRINT
00010  DISCOUNT_TYPE,CHAR,40
00015  CONTRACT,CHAR,40
00020  CO_CODE,CHAR,4
00025  LOW_AMT,INT,6
00030  MID_AMT,INT,6
00040  HI_QTY,INT,6
00050  DISCOUNT,FLOAT,3
--SAVE

NOTES:  The INSERT mode is terminated by typing Control-Z as the first entry on a new line or by typing END as a new line.

If necessary, INSERT mode renumbers existing lines so that they follow all inserted lines.  INSERT does not delete or replace any existing lines.

Text may also be entered by typing a line number and the line of text.  However, if you enter a line number that already exists, the new line will replace the old line.

SLIM may be invoked to edit the current or previous editing command.

Line length can be controlled through the system field @TERM_LINE.  This can only be change at the command level with the set command or in a Process Module (PM).  The minimum length is 25 and the maximum length is 4095.

Move

Purpose:  MOVE moves a line or range of lines to a different location.  MOVE deletes the lines from the original location and moves them to the specified position.  If necessary, MOVE adjusts the line numbers of the current lines to make room for the inserted lines.

Syntax

M/OVE/ addr1 [:addr2] TO addr3

addr1

is the address of the line to be moved, or the first address in a line range to be moved.

addr2

is the last address in a range of lines to be moved.

TO addr3

specifies the address of the line at which the lines are to be inserted.  A comma (,) can be used instead of TO.  If addr3 is an already existing line number, the moved text will be inserted after that line number.  If addr3 references a non-existing line number, the moved text will be inserted at the newly created line number.

Example

--PRINT
00100  AUTHOR_CODE,CHAR,11
00110  TITLE_CODE,CHAR,6
00120  AUTHOR_ORDERED,INT,6
00130  ROYAL_PERCENT,INT,3
--MOVE 120:130,100
--PRINT
00100  AUTHOR_CODE,CHAR,11
00101  AUTHOR_ORDERED,INT,6
00102  ROYAL_PERCENT,INT,3
00110  TITLE_CODE,CHAR,6
--

NOTES:  MOVE renumbers the lines, incrementing them by one, so that the sequence of line numbers is in ascending order where they are inserted.  If necessary, MOVE changes numbers of following lines, incrementing them by one, until there is room for all intervening lines to have ascending numbers.

Number

Purpose:  NUMBER enables new line numbers to be assigned to all current lines or to a range of lines.

Syntax

N/UMBER/ [[addr1[:addr2],startnum [,incr]]

NUMBER

with no options renumbers the entire current set of lines, assigning 100 as the first line number and increasing each subsequent line number by 10.

addr1

is the address of the first line to be renumbered.

addr2

is the address of the last line in the range, if addr2 is omitted, ACCENT R renumbers from addr1 to the end of the file.

startnum

is the new line number to be assigned to the first line being re-sequenced.

incr

is an integer that specifies the value by which each subsequent new line number is to be increased.  If not supplied, it is 10 by default.

Example

The following interaction includes the NUMBER editing command.

--PRINT
00010  PUB_CODE,CHAR,4
00020  PUB_NAME,CHAR,40
00030  CITY,CHAR,20
00040  STATE,CHAR,2
--NUMBER 10:30,1,3
--PRINT
00001  PUB_CODE,CHAR,4
00004  VPUB_NAME,CHAR,40
00007  CITY,CHAR,20
00040  STATE,CHAR,2
--NUMBER 1, 5, 15
--PRINT
00005  PUB_CODE,CHAR,4
00020  PUB_NAME,CHAR,40
00035  CITY,CHAR,20
00050  STATE,CHAR,2
--

NOTES:  If just one value is given, it is assumed to be startnum and is applied to the first line of the file.  If two values are given separated by a comma, they are assumed to be startnum, incr.

Print

Purpose: PRINT enables a line or range of lines to be displayed.

Syntax

P/RINT/ [\addr1 [:addr3]\; NEXT [n]]

PRINT

with no options displays the entire current set of lines

addr1

is the address of a single line to be displayed or the first address of a range of lines to be displayed

addr2

is the address of the last line when a line range is to be displayed

NEXT n

causes ACCENT R to display the following n lines from the current position in the file.  The default value of n is 10, but it remains set to the last specified value.

Example

--PRINT
00010  PUB_CODE,CHAR,4
00020  PUB_NAME,CHAR,40
00030  CITY,CHAR,20
00040  STATE,CHAR,2

NOTES:  PRINT NEXT [n] can be abbreviated to PN [n].

Up to ten individual addresses or line ranges can be specified by separating them with commas.

Replace

Purpose: REPLACE allows a line or range of lines to be replaced with lines that are typed in at the terminal.  More or fewer new lines can be entered than what is wished to be replaced.  ACCENT R will renumber following lines if necessary to accommodate all new lines.  Terminate the REPLACE mode by typing END as the first entry on a new line or by typing Control-Z anywhere.

Syntax

REP/LACE/ addr1 [:addr2] [BY incr]

addr1

is the address of a line to be replaced or the first line of a line range to be replaced

addr2

is the address of the last line of a range to be replaced

BY incr

specifies the value by which the replacement line numbers are to be incremented.  The default, if this option is not included, is 10.  A comma (,) can be used instead of BY

Example

--PRINT
00010  A
00020  B
00030  C
00040  D
00050  E
00060  F
--REPLACE 30:40
00030  1
00040  2
00050  3
00060  4
00070  END
2 LINE(S) DELETED
--PRINT
00010  A
00020  B
00030  1
00040  2
00050  3
00060  4
00061  E
00062  F

NOTES:  REPLACE combines the functions of DELETE and INSERT.  It deletes all lines in the range specified, then prompts for new lines.  By default, REPLACE with no options begins prompting with the line number of the first line deleted, then increments further line number prompts by 10.  Enter as many new lines as is needed.  If necessary, ACCENT R will renumber existing lines that follow the range of lines deleted to accommodate the new lines.

SLIM may be invoked to edit the current or the previous replacement line.  The use of SLIM is described earlier in this chapter.

Save

Purpose: SAVE checks the lines for errors-except in System Files (SF), Code Segment (CS) and System Information (SI) objects.  If no errors are found, object is are compiled and stored in the DBL.  Control is then returned to the ACCENT R command level.  By default, if errors are found, ACCENT R displays the lines that contain errors and remains at the edit level so that corrections can be made.  The command also has an option which allows actions (that will be taken if errors are found) to be specified ahead of time.  This option is useful when trying to create Data Base Library (DBL) objects under the control of a program.  SF’s, CS’s and SI’s do not create a compiled version while CM's, PM's, SD's, DI's and ID's do.

Syntax

SA/VE/ [DEBUG] [/BUT/ {HOLD; STOP; HOLD /AND/ STOP} /ON ERROR/]

DEBUG

causes shadow lines to compile and execute.  Shadow lines are those prefaced with an asterisk (*).  If  DEBUG is not expressed, these lines are treated as comments; i.e., they are not compiled.  This option is allowed only for Process Modules (PM) and Command Modules (CM).

[/BUT/{HOLD;STOP;

HOLD/AND/STOP} /ON ERROR/]

is used to specify an alternate action in case errors are encountered.  This clause can be used interactively, or in a CM.

Example

*DEFINE SF PUB_REP
--10  CO_ID,CHAR,4
--20  NAME,CHAR,20
--30  PHONE,INT,10
--SAVE
*LIST SF PUB_REP
CO_ID,CHAR,4
NAME,CHAR,20
PHONE,INT,10
*MODIFY SF PUB_REP
ACCENT-R HAS ASSIGNED LINE NUMBERS
--PRINT
00100  CO_ID,CHAR,4
00200  NAME,CHAR,20
00300  PHONE,INT,10
--

If compile errors are encountered in the DECLARE or CONTROL section of a PM, ACCENT R stops checking and returns to edit level, so the errors found to that point can be fixed.  This saves resources that would otherwise be used in attempting to compile the remaining parts of the PM as well as eliminates printing numeral error cause because of error in these sections.

The status of ERROR ABORT does not affect SAVE; if ERROR ABORT is ENABLED, the abort will take place after any indicated SAVE options are executed.  If STOP is used, control will be returned to ACCENT R command level.

All objects must be successfully stored with SAVE before they can be executed.

When CM’s and PM’s are created, the shadow feature allows lines to be included that are useful for debugging but are not used for production runs.  Any line prefaced with an asterisk (*) compiles and executes when SAVE DEBUG is specified, but does not compile or execute when SAVE is specified without DEBUG.

Stop

Purpose: STOP ends the current DEFINE or MODIFY command without saving any editing changes that have been made during the current session.

Syntax

STOP

Example

--HOLD
--PRINT
00100  CO_ID,CHAR,4
00200  NAME,CHAR,20
00300  PHONE,INT,10
--STOP
*LIST SF PUB_REP
CO_ID,CHAR,4
NAME,CHAR,20
PHONE,INT,10

NOTES:  The object is not affected by any editing that was performed since entering the edit level.  Control is returned to the ACCENT R command level.  If the code had been previously compiled with a SAVE command, it is still available for execution.

Structure

Purpose: STRUCTURE displays the field descriptions of a Data Set (DS), Schema Definition  (SD), record type, or field.

Syntax

STR/UCTURE/ [/FOR/ {DS; SD} name [IN DBL dbl_name]] [/FOR/ FIELD name]

STRUCTURE

with no options displays out the field descriptions of the SD for the DS last declared with a USE command.

/FOR/ {DS; SD} name

displays the named SD or the SD for the named DS.  If combined with the RECORD name and/or FIELD name option, it displays only the specified information from the designated SD or DS.  This option must be included if no DS has been declared, or to display information for a DS other than the declared one.

IN DBL dbl_name

is used to list the structure of an object in another Data Base Library (DBL).

/FOR/FIELD name

displays the field definition for the named field.  If the field is not contained in the current DS, the indicated field name must be preceded by the name of its DS or SD.

Example

--STRUCTURE SD BOOK_AUTHOR_DBM2
AUTHOR_CODE CHAR,11
TITLE_CODE CHAR,6
UAUTHOR_ORDERED,INT,6
ROYAL_PERCENT,INT,3

NOTES:  STRUCTURE does not display all of the options available to field definitions.  It generates a basic working version of a SD that includes decimal places, OCCURS clauses and record types.

Substitute

Purpose: SUBSTITUTE replaces all or specified occurrences of one string with another string.

Syntax

S/UBSTITUTE/ {ALL; addr1 [:addr2]} "newstring" "oldstring"

ALL

specifies that all lines are affected by this editing command.

addr1

is the address of the line to be affected by this editing command or the address of the first line when a range of lines is to be affected.

addr2

is the address of the last line when a range of lines is to be affected.

newstring

specifies a character or string of characters that is to replace all occurrences of oldstring in the specified range.

oldstring

is a character or string of characters that is to be replaced by newstring.

Example

In this example, the user discovers that instead of using the TOT field in lines 620 and 630, he should have used the SUM1 field.  With SUBSTITUTE, the user instructs ACCENT R to substitute SUM1 for each occurrence of TOT in these two lines.  The SUBSTITUTE command displays changed lines after the substitution has been made.

--P579:630
00590  DETAILS SECTION
00600  OLDTOT TO TOT
00610  TOT - AMT_PAID TO CUR_AMT
00620  IF TOT > 100
00630  TOT/10 TO TOT
--SUBSTITUTE 620:630 "SUM1""TOT"
00620  IF SUM1 > 100
00630  SUM1/10 TO SUM1

NOTES:  The delimiters for new-string and old-string can be pairs of quotation marks (" "), number signs (# #), dollar signs ($ $), or slashes (/ /).

Up

Purpose: UP moves the line pointer from the current line to the line immediately preceding, and displays the line.

Syntax

U/P/

Example

00191  NEW DATA OR LET ACCENT R COMPUTE IT.
--UP
00181  USING THE ALTER COMMAND, YOU CAN SPECIFY THE
--

Use

Purpose: USE directs ACCENT R to begin reading a specified System File (SF)at the edit level and to treat each line of input as though it had been typed at the terminal.

Syntax

US/E/ /SF/ name

name

references the SF to be used.

Example

The contents of an SF named PUB_REP are first illustrated with the LIST command.  The edit level is then invoked with the DEFINE command to create the Schema Definition (SD) CONTACTS.  The USE editing command is issued on SF PUB_REP.  The results of ACCENT R reading the SF at the edit level are revealed with a final PRINT editing command.

*LIST SF PUB_REP
INSERT
CO_ID,CHAR,4
NAME,CHAR,20
PHONE,INT,10
END
*DEFINE SD CONTACTS
--USE SF PUB_REP
--PRINT
0001  CO_ID,CHAR,4
0002  NAME,CHAR,20
0003  CITY,CHAR,220
0004  PHONE,INT,10

NOTES:  In the editor, the USE SF is often used to insert external pieces of code, like subroutines.