'Is there a command to get the job name from the command in autosys?

I wanted to know if there's any autosys command to get the job name from the command.

For example, suppose there's a job with the name 2450_O_MiscStg_TraFKKR_AP and it has a command with the name $(GLOBAL_DDI_PROJ_DIR)/bin/GENERIC_WRAP.ksh ODS_MISC_TRANSACTOR_FY_KR.

I want an autosys command which would give me the job name when I provide the command as an argument, like this ODS_MISC_TRANSACTOR_FY_KR (or maybe grep " ODS_MISC_TRANSACTOR_FY_KR" from jil file to display the job name).



Solution 1:[1]

There is no autosys command that will do this. egrep and grep from a jil file is what I do from the command line.

The web based tool we use, iXp, allows for a "Find job by Command" I'm pretty sure the CA WCC web tool does the same.

Solution 2:[2]

I think you're looking for something like this...

autorep -J ALL -q | egrep "$(GLOBAL_DDI_PROJ_DIR)/bin/GENERIC_WRAP.ksh ODS_MISC_TRANSACTOR_FY_KR" -b5 | egrep "insert_job" | awk '{print $3}'

It works for me when replaced with a command from my environment. BTW this is the unix version of the command, if you need to run in windows you'd need to replace the egrep with findstr and the awk commmand with a for loop. Good luck!

Solution 3:[3]

autosys creates an environmental variable AUTO_JOB_NAME when the job is run. It contains the name of the job. You can log it or print it just like any variable. For example:

echo AUTO_JOB_NAME: ${AUTO_JOB_NAME} >> "someLog.log"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 clmccomas
Solution 2 Russia Must Remove Putin
Solution 3 john ktejik