When using %%ORDERID, %%ODATE or other system variables in Control-M/Server job, these resolve to the wrong value

Version 1

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    Control-M/Server for UNIX and Microsoft Windows


    Control-M/Server for UNIX and Microsoft Windows


    Control-M/Server for UNIX and Microsoft Windows 6.4.01 and higher


    When using %%ORDERID, %%ODATE or other system variables (as identified in the Control-M Parameters Guide), these variables are resolving incorrectly.  For example, job 00abc using %%ORDERID in the job itself, will return a value of 000xc when used.


    The variable is set as a global variable/autoedit


    Find the variable using the 'ctmvar -ACTION LIST' utility on the Control-M/Server .  Delete the variables using the 'ctmvar -ACTION DELETE' operation.  More information on the ctmvar utility can be found in the Control-M Utility Guide.

    When using a csh or tcsh  shell an  escape characters may be needed.

    This can reproduce this by simply running:
    echo "%%\$DATE"
    DATE: Undefined variable.

    Use single quotes and add an extra backslash the echo command will return the autoedit name value to pass into the ctmvar utility
    echo '%%\\$DATE'

    You should be able to successfully run the ctmvar command like this to delete that variable :
    ctmvar -action delete -var '%%\\$DATE'

    It's the way the shell interprets the $DATE as a shell variable and you have to escape that w/ single quotes, and escape the backslash with an extra backslash


    Article Number:


    Article Type:

    Solutions to a Product Problem

      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles