IBM Cognos script incorrect

Recently when setting up some Reporting to be controlled by ControlM/EM I experienced an issue using the IBM supplied script. It worked perfectly well when using a single word Namespace, but once we tried against a two word Namespace it failed.

All documentation that I found on the web and in the supplied manuals indicated that a two word Name space should work by just putting it in quotes. Nup, No Way, FAIL! This might work OK under a Windows environment but not AIX.

The Problem

The problem is that the IBM Supplied script does not handle spaces in positional parameters, the line towards the bottom of the script is coded as;

${JAVA_HOME}/bin/java -classpath ${CLASSPATH} Trigger ${1} ${2} ${3} ${4} ${5}

So it thinks it is getting 6 arguments instead of 5 when handling the Namespace of “Novell eDirectory” and instantly fails as it only expecting 5.

The Fix

A quick and simple change to make it work was to change it to;

${JAVA_HOME}/bin/java -classpath ${CLASSPATH} Trigger "$@"

This retains the space when parsing the parameters. Sweet! All Good!.

You may also like...

2 Responses

  1. Nathan says:

    Thank you!

  2. Andrés Pi says:

    THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

Leave a Reply

Your email address will not be published. Required fields are marked *