Save

PurposeSAVE compiles the current item if it is an SD, CM, PM, DI, or ID.  If no errors are found, the lines are compiled and stored as an object of the appropriate type.  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 have a compiled form and no error checking is done since ACCENT R cannot identify what type of item is stored there.

Syntax

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

DEBUG

causes shadow lines to compile.  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 SD PUB_REP
--10  CO_ID,CHAR,4
--20  NAME,CHAR,20
--30  PHONE,INT,10
--40  LOCATION,C,X1
--SAVE BUT HOLD AND STOP ON ERROR
00040  LOCATION, C,X1
NO FIELD SIZE SPECIFIED
*

ACCENT R displays the error message but continues with the command HOLD and the STOP.

NOTES:  ACCENT R displays an explanatory message with each line in which there is an error to help isolate any problems that prevent compilation.  If it is necessary to temporarily store a set of statements that contains errors, use HOLD and STOP described elsewhere in this chapter.

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 as a result of errors in these sections.

All objects must be successfully compiled 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.  Therefore the object should be SAVEd without the DEBUG option before using it in production.