Exports records from selected tables into documents.


ZOMDataSave <object specification> [<option>...]


;k <keyword> [!]

The ;k option is used to assign a keyword to the selected object(s). If the keyword is already assigned, this assignment is ignored. If "!" is specified, the keyword assignment is removed for the object(s).

;p <property> [!]

Set the specified user-designated property for the selected object(s). If "!" is indicated, the specified property is reset for the selected object(s).

;d <document>

This is the name of the document to be used to store the data that is saved. The document does not need to exist prior to invoking data save.
The document is (re)created with field definitions that make it suitable for saving data stored in the table.
If you specify a specific document, you should execute the data save against one object, since the document contains only data from the last saved object after the command has executed.
If you do not specify a document, ZOM creates a special internal document for each object.

;f <filename>

If you specify the document used to store the data and the document does not exist, you must specify the filename to be used by the document. This can be omitted if the data save document already exists.

;r <document>

This option generates a program that executes the data save function. This program is normally put in a temporary document. By specifying the name of the document to be used to store the program, ZOMDataSave reroutes the program code to this document instead.


This option causes ZOMDataSave to skip actually saving the data. Datasave documents and the programs to save data in those documents are created.


ZOMDataSave can be used to save data (including null values) in objects that can contain data (e.g. an EntitySet or relationship). The data is saved in a document that has special fields defined by ZOM. This document is (re)created every time ZOMDataSave is executed for an object. If you do not specify a document name as a parameter, ZOM generates a document name for you and internally associates this document name with the object.

The ;r option can be used to also generate a program that actually carries out the save operation. This program could be incorporated directly into your application where it could be necessary to temporarily save data in an object.

Reload the data into the object by using ZOMDataLoad.


The following command saves the contents of the EntitySet "Customers" to an ASCII file.

ZOMDataSave Customers

The following command saves the contents of the EntitySet "Customers" to the document "dsCusts." The filename of the document is "custs.ds." The program that executes the data save is generated into the document "pCustDataSave."

ZOMDataSave Customers ;d dsCusts ;f custs.ds ;r pCustDataSave

As long as the definition of Customers does not change, subsequent data saves can be accomplished by executing the generated program, as shown below. This program can be compiled and embedded in your shipping applications.


The following command saves the data in all objects with the datasave property set (i.e., EntitySets and relationships with fields).

ZOMDataSave +p ds

The following command makes sure that all objects with the datasave property have associated datasave documents so that, in subsequent ZOMCreate, ZOMReCreate, ZOMErase, and ZOMMove commands, the data  is preserved. The data is not actually saved at this point.

ZOMDataSave +p ds ;q