It is currently 18 Oct 2017 9:17


Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 15 Jan 2013 11:15 
Offline
Nouveau
Nouveau
User avatar

Joined: 29 Nov 2012 12:00
Posts: 6
Hi all,

I need to get a notification mail body in the format given below

Sat Jan 12 03:36:00 2013 US PT


I tried to get form the auto edit variables but failed to achieve as they are giving the day and month values in numbers.

can any on e suggest the solution for this.

Thanks in advance.





Naresh


Top
   
 Post subject:
PostPosted: 25 Jan 2013 12:14 
Offline
Nouveau
Nouveau
User avatar

Joined: 08 Jun 2007 12:00
Posts: 807
Location: Varese - Italy
Use the system variables:

%%$DATE AND %%TIME

The best if you check the documentation about autoedit variables, there you find the system variables list, examples and how define user variables.

See also documentation to the e-mail body filed, chars allowed, spaces, variables, etc.

Regards


Last edited by mauriziog on 08 Feb 2013 12:05, edited 1 time in total.

Top
   
 Post subject:
PostPosted: 31 Jan 2013 7:25 
Offline
Nouveau
Nouveau
User avatar

Joined: 29 Nov 2012 12:00
Posts: 6
Hi mauriziog


Both these variables are returning values in Number Format But in my requirement I them in String Format.

Is there a way to convert them in to String format.


Thanks


Top
   
 Post subject:
PostPosted: 31 Jan 2013 6:01 
Offline
Nouveau
Nouveau
User avatar

Joined: 13 Jul 2006 12:00
Posts: 134
Location: Switzerland
There is pobably a 'cleverer' way to do (and if BMC are reading then it would nice if they could expand the range of system defined variables provided by the Control-M Server) but I do the following -

Just after midnight I run a shell script (my Control-M server is Unix-based) and I set up a load of 'user-friendly' variables based on the Control-M system variables. I have many different variables that I create but here is one part of the script that sets up short monthly names -

set `ctmstvar 0 "%%MONTH"`;
if [ "$1" = "01" ]
then V2=Jan;
elif [ "$1" = "02" ]
then V2=Feb;
elif [ "$1" = "03" ]
then V2=Mar;
elif [ "$1" = "04" ]
then V2=Apr;
elif [ "$1" = "05" ]
then V2=May;
elif [ "$1" = "06" ]
then V2=Jun;
elif [ "$1" = "07" ]
then V2=Jul;
elif [ "$1" = "08" ]
then V2=Aug;
elif [ "$1" = "09" ]
then V2=Sep;
elif [ "$1" = "10" ]
then V2=Oct;
elif [ "$1" = "11" ]
then V2=Nov;
else V2=Dec;
fi;
ctmvar -action set -var "%%#\shortmonthis" -varexpr $V2 -quiet

... so on the back of this I create a variable called %%shortmonthis and today resolves to Jan and tomorrow it should resolve to Feb.

I know that somewhere on this forum somebody posted a method of doing this purely from the command line (within a Control-M job) and it was a very elegant (and efficient) way of doing things. Unfortunately it was a French language version and I never got round to putting it into English, hence my method as shown above.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited
The site created by Franck YOT. Images, logo, content and trademarks about Control-M products are property of BMC Software.
All the comments are property of their posters. Images, logo, content and design are © copyright by Scheduler-Usage.com. All Rights Reserved