Page 1 of 1

Using %%JOBNAME in email

Posted: 24 Mar 2014 2:03
by jabali
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.

Posted: 24 Mar 2014 9:21
by jCarlos
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

Re: Using %%JOBNAME in email

Posted: 04 Apr 2014 5:33
by jdj420
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.