IBM Support

Run the report builder from the command line

Question & Answer


Question

How can I run the IBM® Rational® ClearCase® Report Builder from the command line on Microsoft® Windows®?

Answer


DISCLAIMER:
IBM is not providing services of any kind for this Solution. IBM is providing the Solution on an "AS IS" basis without warranty of any kind as this is not a supported method to run the Report Builder. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Any report can be run from the command line.


The reports are generated using ccperl scripts, thus the scripts can be called from the command line using ccperl syntax.

The report scripts are stored in the following location:

C:\Program Files\Rational\ClearCase\reports\scripts

The first step is to run the report with the -i option to obtain the necessary parameters. Invoking the scripts using the -i option tells the report to "dump its command line interface".

Example: Running the Elements Created by User report

C:\>ccperl "C:\Program Files\Rational\ClearCase\reports\scripts\elements\Elements_Created_


by_User.prl" -i
description : "Elements Created by User"
id : 2016
helpfile :
parameters : LOOKIN USER
rightclick : Properties_of_Element(single) sep Version_Tree(single) History(single)
fields : "Element Path"(element_xpn, sort 2, rightclick) "Creating User"(user, sort 1)

Note: It is important to invoke the script with its path as some code can strip the path off. To shorten the command, you could define an environment variable:

set mypath=C:\Program Files\Rational\ClearCase\reports\scripts
ccperl "%mypath%\Elements_Created_by_User.prl" -i


IMPORTANT: Quotes are not used in the set command but they are used in the ccperl command.

This will report that two arguments: LOOKIN and USER must be supplied.

The output for Elements_Created_by_User.prl looks like this:

description : "Elements Created by User"
id : 2016
helpfile :
parameters : LOOKIN USER
rightclick : Properties_of_Element(single) sep Version_Tree(single) History(single)
fields : "Element Path"(element_xpn, sort 2, rightclick) "Creating User"(user, sort 1)

In this example, the LOOKIN and USER parameters are specified.

Note: These are the two arguments that the Report Builder GUI would prompt for.


To continue with this example, LOOKIN wants a VOB directory path, and USER wants a username for the Elements_Created_by_User.prl report.

It is important to understand what the script needs to complete and provide that information when prompted.


HINT:
Run the Report from the GUI to see what the report wants as input.


Once the parameters are obtained and defined, run the report as follows:

C:\>ccperl "C:\Program Files\Rational\ClearCase\reports\scripts\elements\Elements_Created_


by_User.prl" LOOKIN=\"m:\dynamic_view\\test_vob\";USER=jdoe

Note: The -i switch is no longer used as the arguments are fed directly in the command.


Considerations:

  • The VOB/DIR path should be enclosed within quotes and must be escaped with backslashes.
  • An absolute path using a drive letter or a UNC path must be specified.
  • The arguments are separated with semicolons. There is no whitespace between the semicolons and the arguments.

Once executed, the ccperl script report will run, and dump out the result fields to the standard output.

Example:


C:\>ccperl "C:\Program Files\Rational\ClearCase\reports\scripts\elements\Elements_Created_
by_User.prl" LOOKIN=\"m:\dynamic_view\\test_vob\";USER=jdoe
m:\dynamic_view\\test_vob;jdoe;
m:\dynamic_view\\test_vob\DownloadDirector;jdoe;
m:\dynamic_view\\test_vob\DownloadDirector\autorun.inf;jdoe;
m:\dynamic_view\\test_vob\DownloadDirector\banner.bmp;jdoe;
m:\dynamic_view\\test_vob\DownloadDirector\dlmgr.pro;jdoe;
m:\dynamic_view\\test_vob\DownloadDirector\doc;jdoe;
m:\dynamic_view\\test_vob\DownloadDirector\libatriagu.dll;jdoe;
m:\dynamic_view\\test_vob\DownloadDirector\mfc42.dll;jdoe;
m:\dynamic_view\\test_vob\DownloadDirector\miniBom.xml;jdoe;
m:\dynamic_view\\test_vob\DownloadDirector\resdll;jdoe;
m:\dynamic_view\\test_vob\DownloadDirector\SETUP;jdoe;
m:\dynamic_view\\test_vob\DownloadDirector\setup.exe;jdoe;
m:\dynamic_view\\test_vob\DownloadDirector\SITEPREP;jdoe;
m:\dynamic_view\\test_vob\DownloadDirector\siteprep.exe;jdoe;
m:\dynamic_view\\test_vob\DownloadDirector\suite.ico;jdoe;
m:\dynamic_view\\test_vob\file.txt;jdoe;
m:\dynamic_view\\test_vob\foo.doc;jdoe;
m:\dynamic_view\\test_vob\Foo.doc;jdoe;

The fields will be separated by semicolons.

Note: The fields were defined in the -i output above.


This method of running reports can be added into a batch job (*.BAT file) where parameters can be passed.

The output can also be redirected into a file.


You can also review the save_results.prl script located in

C:\Program Files\Rational\ClearCase\reports\script_tools.


This is the script used by the GUI to write out results to either HTML or CSV.

Finally if you have any issues and want to terminate a session, hit <Ctrl C>.

Example:


C:\>ccperl "C:\Program Files\Rational\ClearCase\reports\scripts\elements\Elements_Created_
by_User.prl" LOOKIN=\"m:\dynamic_view\\test_vob\";USER=jdoe
Terminating on signal SIGINT(2)
^C

Related Information

[{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"GUI: Report Builder","Platform":[{"code":"PF033","label":"Windows"}],"Version":"2003.06.00;7.0;7.0.1","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
19 February 2019

UID

swg21128614