SAVE Verb - Save File



SAVE fileid
SAVE fileid,int


For BBj-specific information, see SAVEP Verb - BBj for BBj version 6.0 and higher. Also refer to SAVE Verb - BBj for BBj versions prior to 6.0.

The SAVE verb writes a copy of the workspace program to a program file on the disk. SAVEP may be used instead of SAVE (see below).




Name of the file to be saved. If this parameter is not included, PRO/5 uses the same name last used in a LOAD, RUN, SAVE, or START statement. The PGM(-1) function returns the name saved.


File size, not to exceed 64,000 bytes. This syntax is used to create a new program file while performing the SAVE. If the file already exists, PRO/5 issues an error.

The first two syntax examples save a program to a file that already exists. On some systems, the file may be dynamically resized to accommodate the program. The third syntax example creates a new program file while performing the SAVE. The int specifies the file size, though most systems ignore the value of int and create the file dynamically.

SAVEP stores the file in a protected form. If SAVEP is used, the file cannot be LISTED or restored to a LISTable form. The file may be edited, as outlined in the Program Editing section in the User's Reference Guide, with the exception that the line cannot be LISTed.

With Versions 2.20 and later, the algorithm used for SAVEP has changed. To use the algorithm in previous releases, set SETOPTS Byte 1, Bit $04$.

PRO/5 6.0 and higher supports three different versions of the SAVEP algorithm.  PRO/5 18.0 and higher supports four different versions of the SAVEP algorithm.  PRO/5 6.0 and higher also supports an STBL() global variable to specify which SAVEP algorithm should be used. The variable is defined as follows:

A$=STBL("!SAVEPVER","1") - Selects the original SAVEP format

A$=STBL("!SAVEPVER","2") - Selects the SAVEP format introduced in Rev 2.2

A$=STBL("!SAVEPVER","3") - Selects the SAVEP format introduced in Rev 6.0

A$=STBL("!SAVEPVER","4") - Selects the SAVEP format introduced in Rev 18.0

The following errors may occur during execution of SAVE:

  • !ERROR=12 occurs if the file is not found. Use SAVE with int to create a new program.

  • !ERROR=15 occurs if there is insufficient room on the disk.

  • !ERROR=19 may occur if the program file is not large enough. To correct this error, ERASE and redefine the file.



See Also

Data Server Syntax

Verbs - Alphabetical Listing

STBL Formats


Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.