ExportCubes and ImportCubes Batch Tools

Overview

The ExportCubes and ImportCubes batch tools enable you to move your SAS 9.1.3 SP4 cubes to the second maintenance release after SAS 9.2. To use the batch tools, you must go to the DOS command line on your operating system.

ExportCubes Batch Tool

Overview

The ExportCubes batch tool is a command-line tool that enables you to export SAS 9.1.3 OLAP cube metadata. This tool exports the metadata for your cubes into individual XML files that are stored in a designated directory. The ExportCubes batch tool exports all cubes on the metadata server. It is available for use on Windows and is executed from a DOS command line.
When exporting cubes, you designate the output directory that you want to store the XML files to and whether you want to generate a log file of the export process. You can also designate whether security should be exported with the cube metadata or not. When you export cube metadata, the name of the XML file is generated from a combination of the name of the cube's OLAP schema (if there is one) and the name of the cube. If the OLAP schema or cube name contains characters that are not allowed for a filename on that particular operating system, then those characters are changed according to the native Java interface for that operating system.
When you export your cube metadata, the output directory is populated with an XML file for each extracted cube. All cubes in the Foundation and Custom repositories are exported. However, cubes in Project repositories are not exported and are ignored. A log file of the export execution is created in the output directory.
Note: The ExportCubes batch tool is supported in a hot fix that is applied to SAS 9.1.3 SP4. Cube metadata that is exported with the ExportCubes tool can then be imported in the second maintenance release after SAS 9.2 with the ImportCubes batch tool. In addition, cube metadata that is created with a version of SAS that is later than SAS 9.1.3 SP4 cannot be exported with the ExportCubes batch tool. If attempted, an error message is printed to the log.

Syntax

To use the ExportCubes batch tool, go to the DOS command line on your operating system. The batch tool can be found in the following directory path:
SAS-Installation-directory\sasmanagementconsole\9.1\commands
You can enter the ExportCubes command with the needed options.
ExportCubes - <option(s)>
The following example shows the ExportCubes command:
ExportCubes -user "x2345\sasxxx" -password "Passwordxxx" -host
"X2345.xy.abc.com"
-port 8561 -extractSecurity -outputDirectory c:\myextractedcubes
ExportCubes Options
Option Name
Description
-extractSecurity
Specifies to extract security metadata for the cube. If not specified, security metadata is not extracted.
–host
Specifies the server to connect to. The metadata connection can be specified by a profile or the server, port, user, and password options.
-outputDirectory
Specifies the output directory. The cube metadata and log is written to this directory. If the directory exists, then a number (starting with 1) is appended to the end of the directory name until the name is unique. By default, the log file is named ExportCube.log.
-password “pw”
Specifies the password for the user. The metadata connection can be specified by a profile or the server, port, user, and password options.
-port number
Specifies the port for the server. The metadata connection can be specified by a profile or the server, port, user, and password options.
-profile filename
Specifies the workspace file to use for metadata connection information. The metadata connection can be defined by specifying the server, port, user, and password options or by specifying a metadata connection profile. This option can be used in place of the server, port, user, and password options.
-user “username”
Specifies the user to connect to the server with. The metadata connection can be specified by a profile or the server, port, user, and password options.

ImportCubes Batch Tool

Overview

The ImportCubes batch tool is a command-line tool that enables you to import SAS 9.1.3 OLAP cube metadata files that have been exported using the ExportCubes batch tool on your SAS 9.1.3 SP4 environment. The metadata for a cube is exported as an XML file. With the ImportCubes batch tool, you can specify the location of multiple exported SAS 9.1.3 XML files and import them to your SAS 9.2 OLAP environment. The SAS 9.1.3 SP4 cube metadata is imported and added to the SAS 9.2 Metadata Server. In addition, you can specify that a log file of the import execution be created. After the metadata files are imported, you can then rebuild your SAS 9.1.3 SP4 cubes on your SAS 9.2 system. You can use SAS OLAP Cube Studio to build the physical data for the cubes.
The ImportCubes batch tool is included with the standard SAS OLAP installation and is available for use on Windows. It is executed from a DOS command line. When you execute the ImportCubes command, all the cube XML extract files in a directory are imported. The cubes are imported into the repository from which they were exported. If that repository does not exist on the target metadata server, then the cubes are imported into the Foundation repository and this is noted in the log.
If needed, you can substitute file paths during the import of your cube metadata. To substitute file paths during the import, each XML file where you want to substitute file paths must be edited. To change file paths for a cube, you must edit the Substitutions section of the XML file. Specifically, you must change the string following the tag “DefaultValue=” to the directory path that you want. Do this for each XML file that you want to change, and then run the ImportCubes batch tool. The following example shows the Substitutions section of an XML file.
<Substitutions>
<Property Id="A5G2Y32Q.AI000EOC" TLObjN="1" Name="INDEXPATH"
   DefaultValue="c:\indexfilesAggrA"/>
<Property Id="A5G2Y32Q.AI000EOD" TLObjN="1" Name="DATAPATH"
   DefaultValue="c:\partitionsAggrA"/>
<Directory Id="A5G2Y32Q.B00000RU" TLObjN="1" Name="c:\v9cubes"
   DirectoryName="c:\v9cubes"/>
<Property Id="A5G2Y32Q.AI000EO9" TLObjN="1" Name="WORKPATH"
   DefaultValue="c:\v9cubes"/>
<Property Id="A5G2Y32Q.AI000EOA" TLObjN="1" Name="INDEXPATH"
   DefaultValue="c:\globalindex1"/>
<Property Id="A5G2Y32Q.AI000EOB" TLObjN="1" Name="DATAPATH"
   DefaultValue="c:\globalpartitions1"/>
</Substitutions>

Cube Connection Points

For each cube, the connection points that the ImportCubes batch tool expects to find must exist in the target repository. If a table, column, UniqueKey, or OLAP schema connection cannot be found in the target metadata server, the import of the cube fails and an error message is written to the ImportCubes log file. For the OLAP schema connection of a cube, if the OLAP schema does not exist on the target metadata server, then the cube is imported and not associated with any OLAP schema.
Note: The ImportCubes batch tool is supported in the second maintenance release of SAS 9.2. The ImportCubes batch tool is compatible only with cubes that were exported with the corresponding ExportCubes batch tool on your SAS 9.1.3 SP4 environment. The ImportCubes batch tool is not compatible with cubes that were exported from SAS 9.1.3 SP4 using the SAS OLAP Cube Studio Export Cube function.

Syntax

To use the ImportCubes batch tool, go to the DOS command line on your operating system. The batch tool can be found in the following directory path:
SAS-Installation-directory\SASPlatformObjectFramework\9.2
You can enter the ImportCubes command with the needed options.
ImportCubes - <option(s)>
The following example shows the ImportCubes command:
ImportCubes  -user "sasadm" -password "Password01" -host
"X7891.xy.abc.com"
-port 8561  -inputDirectory  c:\myextractedcubes 
ImportCubes Options
Option Name
Description
-host
Specifies the server to connect to. The metadata connection can be specified by a profile or the server, port, user, and password options.
-inputDirectory
Specifies the input directory that contains the XML cube extract files from the 9.1.3 ExportCubes batch tool. This option is required.
-log directory
Specifies the directory where the log file named ImportCubes.log is created. If this option is not specified, the log file is created in the user's home directory.
-password “pw”
Specifies the password for the user. The metadata connection can be specified by a profile or the server, port, user, and password options.
-port number
Specifies the port for the server The metadata connection can be specified by a profile or the server, port, user, and password options.
-profile filename
Specifies the workspace file to use for metadata connection information. The metadata connection can be defined by specifying the server, port, user, and password options or by specifying a metadata connection profile. This option can be used in place of the server, port, user, and password options.
-user “username”
Specifies the user to connect to the server with. The metadata connection can be specified by a profile or the server, port, user, and password options.