Month with a single character

All questions about Control-M jobs definitions
Post Reply
User avatar
Saint_ago
Nouveau
Nouveau
Posts: 13
Joined: 27 Sep 2011 12:00
Location: São Paulo

Month with a single character

Post by Saint_ago » 26 Feb 2013 2:55

Hi, everybody!

I need an auto-edit variable for MONTH (current month) but in format "M" instead of "MM". Is there a way to do that?

I mean, 1 for January (instead of 01), 2 for February, and so on. Of course 10, 11 and 12 will remains the same.

In other words, is there a easy way to strip the 0 from the months before October without using a script?

Thanks in advance

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

Post by fyot » 06 Mar 2013 10:03

Hi

Yes it's possible using SUBSTR function in AUTOEDIT.

example
%%yy=%%SUBSTR %%b 1 2

User avatar
Saint_ago
Nouveau
Nouveau
Posts: 13
Joined: 27 Sep 2011 12:00
Location: São Paulo

Post by Saint_ago » 23 Mar 2013 10:54

fyot wrote:Hi

Yes it's possible using SUBSTR function in AUTOEDIT.

example
%%yy=%%SUBSTR %%b 1 2
Thanks, but that one doesn't work for me. If i do this with %%MONTH, it will give me 01, 02, 03 instead of 1, 2, 3 (what i need)...

User avatar
rumbler75
Nouveau
Nouveau
Posts: 22
Joined: 16 Oct 2006 12:00
Location: Helsinki

Post by rumbler75 » 27 Mar 2013 10:36

Quick and dirty way is using the %%LIBMEMSYM defined in Server directory/file

User avatar
CTMUSERIND
Nouveau
Nouveau
Posts: 5
Joined: 12 Feb 2013 12:00

Post by CTMUSERIND » 12 Apr 2013 8:43

Hi

You can achieve using SUBSTR function in AUTOEDIT.

example:
%%REQ=%%SUBSTR %%MONTH 2 2


Thanks

Post Reply