Command Line Options

Cognos® Transformer can perform certain modeling and cube-building tasks from the Windows, UNIX or Linux® command line.
Note: You must invoke the command line utilities from the directory where the Cognos Transformer executable resides. In Cognos Transformer version 8.x and later, this is the bin directory.

This document provides the syntax for the following routine tasks:

  • creating or updating cubes
  • updating a model with new categories created during the category generation process
  • running a set of batch jobs with different preference settings or input files
  • changing the current date setting so that relative time calculations in batch cube creation are based on a specific date
  • supplying database signon information
  • changing the degree of detail for log file messages
  • opening and deleting checkpoint files
  • verifying and, if necessary, updating the scales used in MDL model columns and measures to match those used in the data source
  • publishing cubes in Content Manager
  • copying and activating new versions of published cubes
  • supporting IBM® Cognos prompts
  • opening specified .mdl files and executing MDL statements
  • specifying the number of records for a test cube
  • regenerating categories, and the measure scales used with them, without building the cube

Windows-only command line options enable you to

  • run AutoDesign, build a model, create a cube, and display the results in a supported reporting component
  • open the Cognos Transformer executable without showing a splash screen
  • open the Cognos Transformer executable with the Main windows minimized
Note: On Windows, cogtr builds cubes in the model by default. If you want to disable category creation and cube rebuild, use the -oxoption with the applicable options.

In IBM Cognos Analytics, cogtr replaces the Series 7 Cognos Transformer executables (trnsfrmr.exe on Windows and rsserver on UNIX). However, the syntax is the same.

You can combine options using the space character to separate them. However, do not add spaces between an option and its argument, and enclose any intentional spaces found in an argument within double quotes. For example, the following is a valid Windows combination:

cogtr -n -k"field three=CarlosR/pw462" Field3.mdl

The following example, run from the bin folder where Cognos Transformer is installed, tests to ensure that your Windows operation ended successfully. If a non-zero error code is returned, the process failed, or Cognos Transformer terminated unexpectedly without completing the specified sequence.

cogtr.exe -n2 -s -i -nologo install_dir:\
filename.py? if errorlevel 1 goto error
:noerror echo no error was encountered pause goto end :error echo
Error
pause :end

In the following UNIX/Linux example, a Bourne Shell script is appended to the cogtr command to perform a second action (b) on successful completion of the first action (a):

#!/bin/sh if cogtr command_line_options then #perform action a if exit  status is 0 
else #perform action b fi