Wednesday, October 3, 2012

Define In/out condition with PRECMD/POSTCMD

Define In/out condition with PRECMD/POSTCMD

%%PRECMD ctmcontb -ADD condition-ok ODAT


Examples

The following command deletes prerequisite condition bckp_end with condition
dates in December:


ctmcontb -DELETE bckp_end “12*"

yoou can define this to PRECMD/POSTCMD.


The following command deletes the prerequisite condition aa* with condition date
ODAT:


ctmcontb -DELETENOWILD “aa*” ODAT

AutoEdit variables (Date and Time)


Few examples:
Below %%BB is resolved to 5PM on current system date
%%AA= %%$CALCDATE %%$DATE
%%BB= %%AA.1700

Below %%BB is resolved to 6:40 AM on next day of current system date
%%AA= %%$CALCDATE %%$ODATE +1
%%BB= %%AA.0640

AutoEdit functions
%%CALCDATEAdds or subtracts a specified number of days from a specified date.

On October 1, 2012, %%A resolves to 120930 in any of the following expressions:

%%A=%%CALCDATE %%DATE -1
%%A=%%CALCDATE 121001 -%%DAY
%%A=%%CALCDATE 120929 +1

%%$CALCDATESame as %%CALCDATE, but handles 4-digit years.

On October 1, 2012, %%A resolves to 20120930 in any of the following expressions:
%%A=%%$CALCDATE %%$DATE -1
%%A=%%$CALCDATE 20121001 -%%DAY
%%A=%%$CALCDATE 20120929 +1

%%SUBSTRExtracts a substring from a specified string.

Syntax:
%%SUBSTR variable start_position length

In the following series of expressions, %%Number resolves to TWO:
%%Nstring=ONETWOTHREE
%%Start=4
%%Number=%%SUBSTR %%Nstring %%Start 3

An example for Date & time.
%%HH %%SUBSTR %%TIME 1 2
%%MM %%SUBSTR %%TIME 3 2
%%SS %%SUBSTR %%TIME 5 2
%%PARM1 %%$OYEAR:%%OMONTH:%%ODAY%%BLANK1.%%HH..%%MM..%%SS
result is : 2012:10:01 10.58.02

Few important Control-M variables