7.1.8 Executing the jamimport (import) command
This subsection gives the function, format, options, return values, notes about command execution, and an execution example of the jamimport command, which is used for import operations.
The executable file for the command is stored in the following folder:
Asset-Console-installation-folder\exe
- Organization of this subsection
(1) Function
The jamimport command registers data in a CSV file into the asset management database and updates the database. The command registers all data in the CSV file into the asset management database as is in a batch operation. A CSV file to be registered is created for each class.
To register information about multiple classes at one time, you must use a data files definition file.
(2) Format
jamimport {{-f data-file-name -gc object-class-name-or-association-class-name} |-dc data-files-definition-file} [-e log-file-name[-s]] [-l message-type]
(3) Options
- -f data-file-name
-
Specifies the name of the data file if there is only one data file to be imported. The data file name can be a full or relative path.
Make sure that this option is specified together with the -gc option. The -f and -dc options are mutually exclusive.
- -gc object-class-name-or-association-class-name
-
Specifies the class name corresponding to the data file if there is only one data file to be imported.
If you are importing an object class, specify the name of the object class. If you are importing an association class, specify the name of the association class. For details about class names, see 14.1 Organization of classes.
Make sure that this option is specified together with the -f option. The -gc and -dc options are mutually exclusive.
- -dc data-files-definition-file
-
Specifies that multiple data files are to be imported in a batch operation. You cannot specify this option together with the -f or -gc option.
The name of the data files definition file can be a full or relative path.
- -e log-file-name
-
Specifies the file to which messages, which are usually output to the console, are to be output. Specify the name of the log file to which messages are to be output.
This option can be omitted, in which case the system outputs the messages to the console where the jamimport command was executed.
For details about the log file output format, see Chapter 11. Troubleshooting.
- -s
-
Specifies that the number of imported items is to be displayed on the console as the progress status. You can specify this option only when the -e option is specified. When the -s option is omitted, the number of processed items is not displayed.
The progress status is displayed each time 50 items are processed.
- -l message-type
-
Specifies the type of messages to be output to the log file. This option can be omitted. When the option is omitted, E is assumed.
The following shows the permitted message types and the information that is output:
- E
-
Outputs only messages that report a serious error requiring termination of the program.
- W
-
Outputs the following two types of messages:
-
Messages with type E
-
Messages reporting an error that does not require termination of the program but that disables some functions
-
- I
-
Outputs information messages plus messages with types E and W.
(4) Return value
The jamimport command returns the following values.
Return value |
Description |
---|---|
0 |
Normal end |
1 |
Warning occurred, but processing terminated normally. |
11 |
Format error was detected in the command options. |
21 |
The file to be imported is not accessible or contains an error. |
52 |
Processing was canceled by the user. |
101 or greater |
The command terminated due to some other error. |
(5) Notes on command execution
-
A user with administrator permissions must execute the jamimport command.
-
If an import operation is executed while a window operation is underway or JP1/IT Desktop Management 2 - Manager management information is being registered, the data might not be registered or updated correctly due to other data updating operations. When you execute an import operation, you should ensure that no other operations are underway, such as window operations or registering JP1/IT Desktop Management 2 - Manager management information.
-
If the import operation is terminated by pressing Ctrl+C or Ctrl+Break or due to a system error (such as a database error or file I/O error), an error message to that effect is displayed and the processing is terminated. In this case, the data up to the data that was being processed when the operation was stopped or canceled has been imported into the asset management database.
However, data conformity might be lost in the asset management database because the import operation terminated when the operation was stopped or canceled. To be prepared for such events, Hitachi recommends that you make a backup of your asset management database.
-
If the import operation is canceled or stopped due to an error and the same data file is re-imported with the same operation code A (addition), a warning error occurs for the data that has already been registered into the asset management database.
-
If the specified jamimport command contains an invalid option, the error message and command format are displayed on the screen. This error is not output to the log file.
-
If the command contains an option argument that specifies a character string containing a space, you must enclose the entire argument in double quotation marks (").
(6) Example
jamimport -f "c:\temp\Hardware.csv" -gc HardwareInfo