InterSystems FAQ rubric
When exporting using the Export() method of the %Library.Global class, if the export format (fourth argument: OutputFormat) is set to 7, "Block format/Caché block format (%GOF)," mapped globals cannot be exported (only globals in the default global database of the namespace are exported). To export mapped globals in "Block format/Caché block format (%GOF)," specify the database directory to which you want to map them in the first parameter of %Library.Global.Export().
An example of execution is shown below.
set DB = "^^c:\InterSystems\Cache\Mgr\Test\" ; "^^\<path to database folder>\"
set sc = ##class(%Library.Global).Export(DB,"TESTGBL.gbl",FULLPATH,7,,"")
If you specify the export format as 5 (default), "ISM/ObjectScript format (ISM/Cache format) (*)," you can also export mapped globals, but the output file will be larger than if you set the export format (fourth argument: OutputFormat) to 7, "Block format/Caché block format (%GOF).
Also, if binary data is recorded in the global, that data will not be output correctly.
For more information, see the following documentation.
Class Reference: %Library.Global.Export() [IRIS]
Class Reference: %Library.Global.Export()
[Note]
Globals that contain $LIST format or control characters cannot be exported correctly with the default export format of 5 (ISM/ObjectScript format (ISM/Cache format) (*)). In this case, you must export on a database-by-database basis with the export format (fourth argument: OutputFormat) set to 7 (Block format/Caché block format (%GOF)).
* Sequential file format