It is currently 23 Oct 2017 1:39


Post new topic  Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Using %%JOBNAME in email
PostPosted: 24 Mar 2014 2:03 
Offline
Nouveau
Nouveau
User avatar

Joined: 06 Sep 2013 12:00
Posts: 10
Hi all,

In the job properties, i need ot send an email on job failure with the name of the failed job. I know we can use %%JOBNAME to do this. But our job naming convention is very lengthy.
XX_XX_ActualName_XX_XXX.

Is there any way by which i can remove the Begining and ending parts of the JOBNAME variable?
I need the ActualName part only. Is there anything similar to SubString function?

Note: All job names begin and end with the same string.


Top
   
 Post subject:
PostPosted: 24 Mar 2014 9:21 
Offline
Nouveau
Nouveau
User avatar

Joined: 19 Jun 2013 12:00
Posts: 36
I don't know what version you are using but mine is 7 and it have this:
----------------------------------------------------------------------------------
%%SUBSTR
%%SUBSTR is a string function that is used to extract a substring from within a larger string. This function has the following format:


result=%%SUBSTR variable startpos length



The components of this expression are described in the following table:


result: Any user variable or job submission variable.
variable: Any AutoEdit variable.
startpos: Numeric literal or variable that indicates the first position in the original: string from which to extract the substring. The first character is position 1.
length: A number or variable, indicating the length of the substring to extract.
------------------------------------------------------------------------------------


The values specified for both <startpos> and <length> must be (or resolve to) a number greater than zero.
==Note==


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


Top
   
PostPosted: 04 Apr 2014 5:33 
Offline
Nouveau
Nouveau
User avatar

Joined: 06 Aug 2008 12:00
Posts: 32
why not make use of %%MEMNAME and %%JOBNAME to your benefit? The jobname does not have to match the memname so as long as your memname is the actual name of your script then you can make the jobname what you want it to be without the variables. then you can use %%JOBNAME as you would like.


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
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