We found another workaround , fortunately we used to keep WLA JOB object name "SAP_JOB#S4.Test" here "test" name will appear in SAP SM37.
Original Message:
Sent: 10-28-2020 12:16 PM
From: Stephane LAFLUTTE
Subject: Job name variable in email
Well sorry, I never used SLO
I have another suggestion but it's not very...elegant
use a SQL request with a SQLI (or SEC_SQLI) object, the SAP Job Name is in JBA table -> JBA_REST but in a string whith other parameters
JBA_REST result should be the following string :
8='01'C='C'E='1'A=''9='TEST'B=''I='0'e='0'u=''v=''w='0'x='0'y='0'z='0'X='0'Y=''Z=''1='0'L='0'
Here is the request (use it in a SQLI or a SEC_SQLI, depending on your security parameters)
SELECT OH_NAME, JBA_REST
FROM JBA, OH
WHERE JBA_OH_IDNR = OH_IDNR
AND OH_NAME = &uc_slm_service_name#
AND OH_Client = &$CLIENT#
AND OH_DeleteFlag = 0
And the code to get the result (split with quote separators)
: SET &HND0# = PREP_PROCESS_VAR(VARA.SQLI_SAPJOBNAME)
: PROCESS &HND0#
: SET &CONTENT# = GET_PROCESS_LINE(&HND0#,3)
: DEFINE &STRING1#, string, 15
: FILL &STRING1#[] = STR_SPLIT(&CONTENT#, "'")
: SET &SAP_JobName# = &STRING1#[10]
: ENDPROCESS &HND0#
: CLOSE_PROCESS &HND0#
not really clean but that's all i can think of.
If this doesn't work, i'm really out of ideas, sorry
Original Message:
Sent: 10-28-2020 10:42 AM
From: viral pabari
Subject: Job name variable in email
Hello Stéphane ,
Thank you for taking time and checking in your system.
Your suggestion is working fine. I think this will helpful when we limited number of jobs.
But as I have mentioned in beginning we are using SLO object to monitor the jobs and we have thousand of jobs.
Whenever job will get failed SLO object will trigger notification so we don't have to write any code in JOB object.
Generic notification object has all coding.
As you can see in line no 22, I want to add there SAP job name using &SAP_JOBname# variable (which I have passed in job object ) in subject line but its not working.
Notification object will only understand variable passed by SLO object so I am still struggling on how to pass here JOB_NAME attribute.
Appreciate any lead to resolve this.
Regards,
Viral
Original Message:
Sent: 10-26-2020 10:47 AM
From: Stephane LAFLUTTE
Subject: Job name variable in email
Hello
Contrary to SET command, PSET is here to define the variable for the entire process (so, normally it's inherited by the objects starded either in post process or in an action "Return code handling" in the general tab)
How do you start your CALL object?
1. action "Return code handling"?
Personnaly i tried both 1 and 2 and it worked
Here is my CALL
the following screenshot is the CALL's report after starting the JOBS
Original Message:
Sent: 10-26-2020 09:41 AM
From: viral pabari
Subject: Job name variable in email
Hello Stephane ,
I have placed :pset &SAP_JobName# = &$JOB_NAME# in JOB object's post-process step but I am not sure how can I pass variable value &SAP_JobName# in CALL object.
Original Message:
Sent: 10-23-2020 06:44 AM
From: Stephane LAFLUTTE
Subject: Job name variable in email
Hello
Not sure how read function work so i don't know how to get you JOBS's JOB_NAME from your CALL object whithout getting it beforehand in the JOBS's post-process
but if you use Christoph's suggestion
:pset &SAP_JobName# = get_att(JOB_NAME)
or
:pset &SAP_JobName# = &$JOB_NAME#
in your JOBS post-process and use the inherited variable &SAP_JobName# in your CALL object, it should work.
I'm new here so i hope i'm not mistaken.
Regards,
Stéphane
Original Message:
Sent: 10-22-2020 01:45 PM
From: viral pabari
Subject: Job name variable in email
Hello Pete ,
Thanks for an update but error is not to pointing GET_ATT() function .Because I tried to use same code provided by Christoph however ended with same error.
Error
Attribute JOB_NAME is not allowed for object type "CALL"
Original Message:
Sent: 10-22-2020 11:29 AM
From: Pete Wirfs
Subject: Job name variable in email
I think you are mis-using the GET_ATT() function. You need to code it exactly the way Christoph did.
https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/12.3/Automic%20Automation%20Guides/help.htm#Script/Reference/GET_ATT.htm
------------------------------
Pete Wirfs
SAIF Corporation
Salem Oregon USA
Original Message:
Sent: 10-22-2020 07:29 AM
From: viral pabari
Subject: Job name variable in email
Hello Christoph ,
We tried to use JOB_NAME variable but getting an error its not allowed to use in object type "call"
Could you please let us know what is wrong here.
Apologies for multiple screenshot .Due to restriction unable to copy paste content from Citirx.
Original Message:
Sent: 10-12-2020 10:54 AM
From: Christoph Rekers
Subject: Job name variable in email
Hi @viral pabari,
Try this:
:pset &JobName# = get_att(JOB_NAME)
or (from):
https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/12.3/Automic%20Automation%20Guides/help.htm#AWA/Variables/Variables_ObjectAttributes.htm?Highlight=JOB_NAME
Name: Job name
Variable name: &$JOB_NAME#
Description: The name that is used to execute the job in the destination system
Attribute: JOB_NAME, JN
Object type: JOBS (BS2000, OS400, SAP, VMS, ZOS)
Security level: 2
Cheers
Christoph
------------------------------
----------------------------------------------------------------
Automic AE Consultant and Trainer since 2000
Original Message:
Sent: 10-12-2020 10:05 AM
From: viral pabari
Subject: Job name variable in email
Hello Expert ,
We have similar kind of requirement whenever job failed in failure notification SAP Job name (name is displaying in SM37) should appear instead of WLA JOBS object name.
Our WLA JOBS object name is : JOBS.SAP_ABAP_TIME_CHECK but in SAP job name field we have mentioned job name as a "test ".
Once job will fail notification we will trigger with subject name WLA JOBS object "JOB failed :'JOBS.SAP_ABAP_TIME_CHECK"
Now I am not sure what WLA variable we have to mentioned in notification object process tab to display SAP job name (SM37 name ) in subject line.
Note : We are using SLO object to monitor failed job so WLA variable should be required to update in notification object.
And @Pete Wirfs do we have any other option instead of updating alias name in JOBS object as since beginning we have configured all the jobs without using alias field.
Regards,
Viral
Original Message:
Sent: 08-11-2014 01:05 PM
From: Anon Anon
Subject: Job name variable in email
What Version and Product (OM or AM) are you using?
When you say "failing jobs name" do you mean the Job object name? If they are, for your purposes, the same you could use something like the following under OM V8 .
:SET &job_name = SYS_ACT_ME_NAME()