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

Version 1
    Share:|

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


    PRODUCT:

    Control-M/Server for UNIX and Microsoft Windows


    COMPONENT:

    Control-M/Server for UNIX and Microsoft Windows


    APPLIES TO:

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



    PROBLEM:

    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.


    CAUSE:

    The variable is set as a global variable/autoedit


    SOLUTION:

    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'
    %%\$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:

    000127665


    Article Type:

    Solutions to a Product Problem



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