capturing Job's Version Number for audit meta-data
Moderators: chulett, rschirm, roy
capturing Job's Version Number for audit meta-data
Hi,
I want to capture a job's version number (i.e. the version number in the General tab of the Job Properties window) in my runtime meta-data. A perfect solution would be a using an InfoType in the DSGetJobInfo function, but this does not seem to be supported (at least its not documented). Neither does the version number appear in the output of the DSMakeJobReport function.
Are there any other means that I use to obtain the job's version number?
Thanks,
katz
I want to capture a job's version number (i.e. the version number in the General tab of the Job Properties window) in my runtime meta-data. A perfect solution would be a using an InfoType in the DSGetJobInfo function, but this does not seem to be supported (at least its not documented). Neither does the version number appear in the output of the DSMakeJobReport function.
Are there any other means that I use to obtain the job's version number?
Thanks,
katz
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Version Control also increments the version number, and it's possible that developers do also.
You can query the Repository using a "UV" command in DSExecute.
You will need to parse out the penultimate field from the result.
You can query the Repository using a "UV" command in DSExecute.
Code: Select all
SELECT NAME, EVAL "@RECORD<8>" AS VERSION FROM DS_JOBOBJECTS WHERE OBJTYPE = 'J' AND OBJNAME = 'ROOT' AND OBJIDNO = (SELECT JOBNO FROM DS_JOBS WHERE NAME = '<<Job Name>>') COL.SUP COUNT.SUP;
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Here's a cute variation on the theme, retrieving the result as a single expression (for example to set a job parameter value). You need the job name from somewhere.
It returns a zero length string if the job is not found.
Code: Select all
Trans("DS_JOBOBJECTS", "J\" : Trans("DS_JOBS", JobName, 5, "X") : "\ROOT", 8, "X")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Thanks Mucho! I have it working now. The proof-of-concept Routine is below.
From this point there are a couple of directions that I can take it...
...obtain the job version of a specfic job at run-time, to include with my job run audit data.
...generalise it a bit and select the job names and versions for all jobs LIKE the input argument (i.e. what are the job versions running in Production for all jobs LIKE 'abc%').
katz
From this point there are a couple of directions that I can take it...
...obtain the job version of a specfic job at run-time, to include with my job run audit data.
...generalise it a bit and select the job names and versions for all jobs LIKE the input argument (i.e. what are the job versions running in Production for all jobs LIKE 'abc%').
katz
Code: Select all
FUNCTION TestJobVersion(Arg)
v_Cmd = ''
v_Cmd = "SELECT JOBNO TO SLIST 9 FROM DS_JOBS WHERE NAME = '":Arg:"';"
Perform v_Cmd
* Convert Select List 9 into dynamic array
ReadList d_jobNumber From 9
Then v_jobNumber = d_jobNumber<1>
Else
Ans=-2
Return(Ans)
End
v_Cmd = ''
v_Cmd = "SELECT EVAL '@RECORD<8>' TO SLIST 9 FROM DS_JOBOBJECTS WHERE OBJTYPE = 'J' AND OBJNAME = 'ROOT' AND OBJIDNO = '":v_jobNumber:"';"
Perform v_Cmd
* Convert Select List 9 into dynamic array
ReadList d_jobVersion From 9
Then Ans = d_jobVersion<1>
Else
Ans=-1
End
RETURN(Ans)
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
How about:
Code: Select all
FUNCTION TestJobVersion(TheJobName)
* Returns job version number if found, or "" otherwise
Ans = Trans("DS_JOBOBJECTS", "J\":Trans("DS_JOBS", TheJobName, 5, "X"):"\ROOT", 8, "X")
RETURN(Ans)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: