Using the Batch Import Tool

Syntax for the Batch Import Tool

ImportPackage
-host target-host-name
-port target-port-number
-user user-id
-password password
-domain domain-name
<-profile connection-profile-name>
-package package-path-and-filename
-target target-metadata-location
<-types object-type-1, object-type-2....object-type-n>
<-newOnly>
<-includeACL>
<-subprop <substitution-properties-filename>>
<-preservePaths>
<-log log-path | log-path-and-filename | . >
<-noexecute>
<-? | --help>

Batch Import Tool Syntax Description

-host target-host-name
specifies the machine name of the metadata server to which the package is being imported.
Requirement Required if –profile is not specified.
-port target-port-number
specifies the port number of the metadata server to which the package is being imported.
Requirement Required if –profile is not specified.
-user user-id
specifies the user ID that is to be used to connect to the target metadata server. Make sure that this user has the appropriate credentials. See Ensure Appropriate User Credentials.
Requirement Required if –profile is not specified, or if the specified connection profile does not contain user credentials.
-password password
specifies the password of the user who is specified in –user.
Requirement Required if –profile is not specified, or if the specified connection profile does not contain user credentials.
-domain domain-name
specifies the SAS authentication domain in which the user ID is to be authenticated.
Requirement Not required. You can omit this option if your installation has only one SAS authentication domain. You can also omit this option if you specify –profile and if the specified connection profile contains a domain name.
-profile connection-profile-name
specifies the name of the connection profile that is to be used to connect to the target metadata server. You can specify this option instead of –host, –port, –user, –password, and –domain.
The connection profile must exist on the computer where the import command is executed. You can specify any connection profile that has been created for use with client applications such as SAS Management Console, SAS Data Integration Studio, and SAS OLAP Cube Studio. When you open one of these applications, the available connection profiles are displayed in the drop-down box in the Connect Profile dialog box.
If the connection profile name contains spaces, then use quotation marks. If the connection profile contains a user ID and password, then make sure that the user has the appropriate credentials).
Requirement You can omit this option if –host and –port are provided.
Interaction If you specify this parameter, then –host, –port, and –domain can be omitted. If the specified connection profile contains a user ID and password, then –user and –password can also be omitted.
-package package-path-and-filename
specifies the path and filename of the package file that you want to import. The filename must have the extension .spk. If the path or filename includes spaces, then use quotation marks. The path is optional, but if you do specify a path, it must be fully qualified.
You must specify a package that was created with one of the following methods:
Default If you do not specify a path, then the package is assumed to be located in the directory where the command was launched.
Requirement You must specify a filename, but the path is optional.
-target target-metadata-location
the location, relative to SAS Folders, to which the package is to be imported on the target metadata server. For example:
–target/ imports the package to the root level (directly under SAS Folders).
–target"/Shared Data" imports the package to the Shared Data folder.
Note: To import objects to your personal folder, you must specify the actual path (/User Folders/user-name/My Folder or /Users/user-name/My Folder) rather than the shortcut (/My Folder).
Requirement Required
-types object-type-1, object-type-2....object-type-n
specifies a comma-separated list of the types of objects that are to be imported. If you specify this option, then the tool imports only objects that are of the specified types; all other objects are ignored.
For a list of object types, see Specifying Object Types. Object types are case sensitive.
Requirement Not required.
Note Folder is not a valid value for the –types option. When an object of the specified type is imported, the folder structure that contains it is also imported.
-newOnly
specifies that objects are to be imported only if they do not already exist in the specified location on the target metadata server. If objects of the same name and type already exist, then they are not imported.
For example, suppose the package file contains a relational information map called Customer Orders in the location /Shared Data/Orion Star Data, and that the target metadata server contains a relational information map of the same name in that location. If –newOnly is specified, then the information map is not imported.
Default If you do not specify this option, then objects that already exist on the target metadata server are overwritten by any imported objects that have the same location, name, and type.
Requirement Not required.
-includeACL
specifies that access controls are to be imported for all of the objects in the package. If the objects already exist on the target metadata server, then any existing access controls for these objects (including access controls that are inherited) will be overwritten by the imported access controls.
Requirement Not required.
See Promoting Access Controls.
-subprop <substitution-properties-filename>
specifies that imported objects are to be updated based on properties that are specified in the substitution properties file. You must manually update this file to specify how imported objects are to be mapped to existing servers and directories in the target environment. For instructions, see Using the Substitution Properties File.
The substitution-properties-filename argument is not required with this option. If the filename is omitted, then the name is assumed to be package-name.subprop. For example, if your package is named Package1.spk, then the import tool expects the substitution properties file to be named Package1.subprop. If your properties file has a different name, then you must either rename it or specify the filename in the –subprop option. The filename must have the extension .subprop.
CAUTION:
If you do not update the properties file or if you do not specify this option, then some imported objects might not function properly.
You might need to log on to the target metadata server after the import is complete and modify servers, paths, and other values that are associated with the imported objects.
Requirement Not required.
-preservePaths
specifies that objects and folders are to be placed in the same path where they were located in the source environment. If the folders that are included in the path do not exist, they are created.
For example, suppose you export a library from /Shared Data/Libraries. If you import the library to the root level (SAS Folders) in the target environment, then the import wizard determines whether a Libraries folder exists under Shared Data. If the folder does not exist, the wizard creates it and places the imported library in that folder.
If you import objects into a folder below the root level, then this option is ignored.
Requirement This option is required if you import individual objects (independently of the folders that contain them) and you have specified the root folder (SAS Folders) as the import target by specifying –target /. This option is necessary because the root folder can contain folders, but it cannot contain individual objects.
-log log-path | log-path-and-filename
specifies one of the following:
  • the path (or the path and filename) where the log file is to be written
  • that the log file is to be written to the current directory. To specify this option, use a period, as shown here:
    -log .
The log file contains messages that are generated during the batch tool's execution.
Default If you do not specify this option, then the log is directed to the default log path and filename as described in “Viewing the Batch Export or Import Log.”
Requirement Not required.
-noexecute
specifies that the package is not to be imported to the target metadata server. Instead, a list of all of the objects that are included in the import is displayed, and a log file is created. This option is useful if you want to verify that the command is constructed correctly before you execute it.
Default If you do not specify this option, then the package is imported to the target metadata server.
Requirement Not required
[-? | --help]
specifies to display help for the batch import tool.
Requirement Not required

Example: Batch Import Command

ImportPackage -profile "My Profile" -package "c:\SAS Promotion Files\Package_1.spk" -target / -includeACL-subprop
This command does the following:
  • imports folders, subfolders, and objects from Package_1.spk and writes them to the root location under SAS Folders on the target metadata server
  • updates objects on the target metadata server with values that are specified in the substitution properties file
  • imports access controls for all of the objects in the package
  • imports physical content (for example, SRX files) that is associated with the imported objects
    Note: When you use the batch tools, the promotion automatically includes all associated content except physical files for tables and external files. (The batch tools do not provide the option of promoting physical files for tables and external files.)