Reputation: 3
I'm trying to modify current code such that a JobList.addJobSelectionCriteria using SELECTION_JOB_NAME can take wildcards - is this possible?
Documentation for JobList.html#SELECTION_JOB_NAME indicates that the filter String can be "A generic name." - what does this mean exactly?
The current jobs names I need to query can be represented by a Java regex like "JOB.RUN|JOB.PROCESS" - but I can't get that to work with addJobSelectionCriteria and I'm trying to minimize job names in the application configuration and also do the filtering on the JobList query itself.
Even though I can do a filtering post-query, the time it takes to process a large number of jobs is an issue.
Upvotes: 0
Views: 198
Reputation: 1259
I've not looked at the docs [to which no link was given], but the generic-name capability for the Qualified JOB() Name, on/at the server, is effected by omission of the values for Job.Number and/or the Job.User; i.e. the Job.Name is required, and if that is the only value specified, then all jobs with that name, irrespective the Job.User and Job.Number qualifiers, will be searched -- the search is aspecific for user and number, thus is generic to those elements. If a Job.User and Job.Name are specified, then all jobs with those specific qualifiers are searched, irrespective the Job.Number; the search is generically inclusive of all job numbers for the specified user-name and job-name.
Typically the term generic name on the server means a name prefix, for which the *
asterisk character as suffix suggests searching across all values with that name-as-prefix; one or a few interfaces may allow for prepending an asterisk for a similar purpose, but typically the other form of a generic specification is by a special value such as *ALL to indicate there is no filtering, or something like for examples, either token *ALLEXEC used to filter by inclusion of only EXECutable variants of what is being searched or token *PGM used to filter by inclusion [or if on an OMIT() specification, then filter by omission] of only Program Objects. The qualified job name is atypical, such that the aforementioned as-typical-generics are disallowed on any of the JOB parameter of the Commands on the server, best I can recall.
04-Oct-2016 addendum:
For a reference on the more generic [pun intended] usage of the term generic name, of the server vernacular, the following Help Text from the TYPE parameter of the Parameter (PARM) command, used to define the type of parameter as a name that allows a generic* specification. Note: I could find no explicit definition of the term within the Toolbox docs, just the references, but I did find an example of an OS Command (CMD) with a Job (JOB) parameter that also allows the same generic name specifications [user-name and job-name elements], and that is the Start Database Monitor (STRDBMON) command:
Type of value (TYPE) - Help
*GENERIC
The parameter value is a character string that represents a
generic name. A generic name contains one or more characters
followed by an asterisk (*) and must conform to the rules for
generic names. The name identifies a group of objects whose
names all begin with the characters preceding the asterisk (*).
If an asterisk (*) is not included, the system assumes that the
generic name is a complete object name.
Upvotes: 2
Reputation: 23823
"Generic name" on the IBM i is a simple wildcard, not a reg-ex.
MYJOB*
Would find any job with a name that starts out MYJOB. eg: MYJOB1, MYJOB2, MYJOBEOM.
Note: for the most part, when providing a generic name on the IBM i, the wildcard symbol * has to be at the end. So you can't look for objects ending with a certain pattern.
Upvotes: 2