Job Management Partner 1/Software Distribution Administrator's Guide Volume 2

[Contents][Glossary][Index][Back][Next]

4.5 dcmcsvu.exe (exporting to a CSV-formatted file)

This section explains how to use the dcmcsvu command, which exports inventory information to a text file in CSV format or in the parameter file format.

Organization of this section
(1) Function
(2) Format
(3) Arguments
(4) Parameters in a parameter file and corresponding command arguments
(5) Format of the command without using a parameter file
(6) Return codes
(7) Example 1
(8) Example 2
(9) Example 3
(10) Example 4

(1) Function

This command connects the managing server running on the local machine and exports the current inventory information to a text file in CSV format or in the parameter file format. In addition, the results of detecting hosts in which JP1/Software Distribution is not installed or the results of searching for hosts on the network can be output to CSV-formatted files. Note that you can output a CSV file in Unicode, in which case the only supported encoding is UTF-8.

The template by which inventory information can be output is the same as the template used in the CSV output utility. Information is output for the items included in the specified template (the columns in the template). If you use a parameter file to specify this command, you can set details about the output items or filter the output information.

For output of information on hosts on which JP1/Software Distribution is not installed, host information that is specified as outside the range of detection cannot be output.

(2) Format

dcmcsvu.exe /i parameter-file-name /o result-output-file-name [/LC {ON|OFF}]

(3) Arguments

(4) Parameters in a parameter file and corresponding command arguments

You can also use command arguments to specify the template used for exporting and output file format instead of specifying these parameters in a parameter file. The table below shows the correspondence between the contents of a parameter file and the command arguments.

Table 4-8 Correspondence between parameter file contents and arguments (dcmcsvu command)

Parameter file specification contents Description Specification Command argument
Tag Parameter
OUTPUT_CONSTRAINTS template Template used for exporting R template-key
format Output file format O#1 /par or /csv
group_membership Membership group O#2 --
row Item (row) you want to output O#3 --
condition Comparison condition O --
unicode Whether a CSV file in Unicode is to be output O#4, #5 /uniY or /uniN

Legend:
R: required.
O: optional.
--: Cannot be specified in a command argument.

#1
The default is to output the inventory information to a file in CSV format.

#2
If specified for the output of search results on a host in which JP1/Software Distribution is not installed, this parameter is ignored.

#3
The row parameter takes effect only when you export inventory information to a file in CSV format. If you specify the row parameter when exporting to a file in the parameter file format, the row parameter is ignored.

#4
In order to output a CSV file in Unicode, all the following conditions must be satisfied:
  • JP1/Software Distribution Manager is used for command execution
  • The following relational database is used in JP1/Software Distribution:
    [Figure] Microsoft SQL Server 2005 or later
  • One of the following templates is specified:
    [Figure] System information
    [Figure] Installed package information
    [Figure] Registry collection item
    [Figure] Microsoft Office products
    [Figure] Anti-Virus products

#5
If this parameter is omitted, the registry setting for output of CSV files in Unicode is effective. If you specify the registry setting for output of CSV files in Unicode and omit this parameter, CSV files are output in Unicode. For details about the registry setting, see 4.6 Registry settings (JP1/Software Distribution Manager) in the manual Setup Guide.

(5) Format of the command without using a parameter file

The following shows the format of the command when you specify the command by using arguments only instead of using a parameter file.

dcmcsvu.exe template-key [/par|/csv] [/uniY|/uniN]
/o result-output-file-name [/LC {ON|OFF}]

For details about available template keys, see Table 4-23 Export file formats and templates that can be specified in 4.26.14 OUTPUT_CONSTRAINTS (specifying the output information). The items that you can output with each template are the same as those you output with the CSV output utility. For details about the items that are output, see 9.1.1 Items eligible for output to a CSV-formatted file in the manual Administrator's Guide Volume 1.

With respect to the output file format, specify format=par (or csv) for a parameter file. Note however, that you must specify dcmcsvu.exe /par (or /csv), in which a slash (/) is inserted at the beginning for the command argument.

Note that the specification for output of CSV files in Unicode is unicode=Y (or unicode=N) in a parameter file, while it is dcmcsvu.exe /uniY (or dcmcsvu.exe /uniN) as a command argument.

When you use command arguments instead of using a parameter file, you cannot specify details of the output items or filter the output information.

(6) Return codes

The following explains the return codes that the dcmcsvu command may return:

Code Meaning Action
0 The file output was successfully completed. None.
1 The command cannot open the specified parameter file or the format of the specified parameter file is incorrect. Check the pathname or format of the parameter file.
2 An invalid value is specified in a command argument or in the parameter file. Check the values of command arguments or the values of the parameters in the parameter file.
3 An error occurred during connection or access to the managing server. Check that the managing server and database server are running and that their settings are correct.
4 The results output file cannot be opened. Check the status of the results output file, because it may have been opened by another application or there may be insufficient space for the file.
5 The operating environment is incorrect. Ensure that the operating environment settings for the managing server or database server are correct.
10 The command could not output the information because the number of rows to be written to the parameter file exceeded the maximum when /par was specified. Check the information that will be output and reduce the number of rows to be output.
11 The information to be written to the output file does not exist, so the command did not create the output file. None.
12 Other errors occurred. Check the event log.

If JP1/Base is linked to manage JP1/Software Distribution users, see 1.3.3 Setting for executing commands.

(7) Example 1

The following is an example in which the execution status of a transferred job is waiting for installing/collecting, and in which the job execution status for a host whose job destination name is dmp4* is output to the JOB_DESTINATION tag using the parameter file format:

(a) Creating a parameter file

Create the following parameter file and save it with any name:

OUTPUT_CONSTRAINTS{
template = J_STAT
condition = result=Waiting for installing/collecting AND dstname = dmp4* ;
}

You can also use the status parameter to extract the jobs in the waiting for installing/collecting status. To use the status parameter to extract jobs, specify the first six characters of the maintenance code: for example, status=2000B0.

(b) Executing the command

When you created the parameter file with the name C:\temp\in.txt and you want to export the result to the C:\temp\parmjob.txt file, specify the following command:

dcmcsvu.exe /i C:\temp\in.txt /o C:\temp\parmjob.txt /par
(c) Checking the result output file

After the command terminates normally, the result is output to the JOB_DESTINATION tag in the C:\temp\parmjob.txt file in the parameter file format:

JOB_DESTINATION {
host_name = dmp410; dmp4200; dmp4system
}

(8) Example 2

The following is an example in which the execution status of a transferred job is waiting for installing/collecting and in which job name, job execution date/time at the server, and job destination name on a host whose job destination name is dmp4* are output to a CSV-formatted file. In this example, the status item, instead of the job status item, is used to refine the specification of the job execution status.

(a) Creating a parameter file

Create the following parameter file and save it with any name:

OUTPUT_CONSTRAINTS{
template = J_STAT
row = jname; execdate; dstname
condition = status=2000B0 AND dstname = dmp4*;
}
(b) Executing the command

When you created the parameter file with the name C:\temp\in.txt and you want to export the result to the C:\temp\jobout.csv file, specify the following command:

dcmcsvu.exe /i C:\temp\in.txt /csv /o C:\temp\jobout.csv

(9) Example 3

The following is an example in which system information on a host with a minimum installed RAM size of 256 megabytes and belonging to either a host group A or a host group B is output to a CSV-formatted file.

(a) Creating a parameter file

Create the following parameter file and save it with any name:

OUTPUT_CONSTRAINTS{
template = SYS_INFO
condition = ram>=256;
group_membership = \A;\B;
}
(b) Executing the command

When you created the parameter file with the name C:\temp\in.txt and you want to export the result to the C:\temp\system.csv, specify the following command:

dcmcsvu.exe /i C:\temp\in.txt /csv /o C:\temp\system.csv

(10) Example 4

The following is an example in which installed package information on the following host is output to a CSV-formatted file: a host on which a package with a package name *OFFICE and whose first-digit value of the latest version is 6 or less is installed.

(a) Creating a parameter file

Create the following parameter file and save it with any name:

OUTPUT_CONSTRAINTS{
template = INSTLD_PKG
condition = pname = *OFFICE;
condition = newver < 6;
}
(b) Executing the command

When you created the parameter file with the name C:\temp\in.txt and you want to export the result to the C:\temp\inspack.csv, specify the following command:

dcmcsvu.exe /i C:\temp\in.txt /csv /o C:\temp\inspack.csv