IBM Support

About ClearCase variables run within a batch file

Troubleshooting


Problem

This technote explains why an IBM® Rational® ClearCase® []cleartool[] command that uses a variable works fine from the command line but generates various syntax errors when run from a batch file on Microsoft® Windows®.

Symptom


Cleartool commands that use variables fail when run from a batch file on Windows. The very same command functions properly when run outside of the batch file from a command prompt.


Example 1:

cleartool find . -type f -exec "cleartool co -nc %CLEARCASE_PN%" -print

The command runs fine by itself from the command line but you get the following error when you try to run it from a batch file:

cleartool: Error: Element pathname required.
Usage: checkout | co [-reserved] [-unreserved [-nmaster]]
[-out dest-pname | -ndata] [-ptime]
[-branch branch-pname | -version] [-nwarn]
[-c comment | -cfile pname | -cq | -cqe | -nc]
[-query | -nquery] pname ...
.\test2.h@@


Example 2:

cleartool find . -nxn -vers "created_since(yesterday)" -exec "cleartool desc -fmt %u\t%c  %CLEARCASE_XPN%" -print



cleartool: Error: Bad command line: unterminated quoted string

cleartool: Error: Can't exec "(null)": The operation completed successfully.

[{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Environment Variables","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.0.1;7.0;2003.06.00","Edition":"","Line of Business":{"code":"LOB77","label":"Automation Platform"}},{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Environment Variables","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB77","label":"Automation Platform"}},{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Environment Variables","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB77","label":"Automation Platform"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
29 September 2018

UID

swg21149187