Can you use CALCDATE to determine the date 3 months ago?

All questions about Control-M jobs definitions
Post Reply
User avatar
wrenchos
Nouveau
Nouveau
Posts: 7
Joined: 07 Jan 2010 12:00

Can you use CALCDATE to determine the date 3 months ago?

Post by wrenchos » 15 Jan 2015 4:21

Hi, I am trying to run a job which must ran for a date 3 months in the past and I can't find an easy way to do this...ideally it would be something like:

%%3MONTHSAGO = %%CALCDATE %%MONTH -3
but that would be too easy...

Using V.8

Many thanks

User avatar
fyot
Nouveau
Nouveau
Posts: 736
Joined: 26 Apr 2005 12:00
Location: PARIS
Contact:

Re: Can you use CALCDATE to determine the date 3 months ago?

Post by fyot » 19 Jan 2015 9:18

To do that use this :

%%NEWDATE = %%CALCDATE %%DATE -90
%%NEWDATE = %%CALCDATE %%ODATE -90

%%3MONTHSAGO = %%SUBSTR %%NEWDATE 3 2

User avatar
jstarkw
Nouveau
Nouveau
Posts: 58
Joined: 14 Jan 2010 12:00

Re: Can you use CALCDATE to determine the date 3 months ago?

Post by jstarkw » 30 Jan 2015 9:54

CALCDATE is an internal function that adds or subtracts days. I do not think you can get an exact date 3 months ago using it. -90 days does get you close.

Post Reply