Using %%JOBNAME in email

Tools and several solutions to manage Control-M products
Post Reply
User avatar
jabali
Nouveau
Nouveau
Posts: 10
Joined: 06 Sep 2013 12:00

Using %%JOBNAME in email

Post by jabali » 24 Mar 2014 2:03

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.

User avatar
jCarlos
Nouveau
Nouveau
Posts: 36
Joined: 19 Jun 2013 12:00

Post by jCarlos » 24 Mar 2014 9:21

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

User avatar
jdj420
Nouveau
Nouveau
Posts: 32
Joined: 06 Aug 2008 12:00

Re: Using %%JOBNAME in email

Post by jdj420 » 04 Apr 2014 5:33

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.

Post Reply