PARM1 - Month

All questions about Control-M jobs definitions
Post Reply
Planif

PARM1 - Month

Post by Planif » 21 Mar 2011 3:34

Hi,

We need a parameter that take the last day of the month of the two last months. For example:

If the job is execute on 20110321 the parameter will be 20110131.

Can you help me please?

Thanks in advance! :wink:

User avatar
Jean-Mi
Nouveau
Nouveau
Posts: 19
Joined: 08 Sep 2006 12:00
Contact:

Post by Jean-Mi » 24 Mar 2011 9:47

Hi,

You can compute it in two steps :
- Compute the last day of the previous month (Line 1)
- Extract the Year and the month (Line 2 and 3)
- Compute the last day of the previous month already computed (Line 4)

in the 'Set' tag, put:


Var Name____________________Value
%%LastDayMM1____________%%$CALCDATE %%OYEAR.%%OMONTH.01 -1
%%AAAA__________________%%SUBSTR %%LastDayMM1 1 4
%%MM___________________%%SUBSTR %%LastDayMM1 5 2
%%LastDayMM2____________%%$CALCDATE %%AAAA.%%MM.01 -1
%%PARM1_________________%%LastDayMM2
    Have a nice day.
    Jean-Michel.

    Planif

    Post by Planif » 29 Mar 2011 12:30

    Hi,

    Thanks a lot for your help.

    Best Regards!!! :wink:

    Post Reply