JOBCNT


Syntax:     JOBCNT(job_match [,joblist_var])

Defn: A CI evaluator function that returns the number of jobs
and/or sessions that match 'job_match'. Optionally, these
matching job/session numbers are returned in the CI variable
named by the 'joblist_var'. All jobs/sessions matching
"job_match" are counted, including waiting, suspended and
scheduled jobs.

Type: Integer.

Parms
Job_match: Required. String identifying the target jobs and/or sessions.

Supported formats:

"@" - all jobs and sessions
"@J" - all jobs
"@S" - all sessions
"user.acct" - all job/sessions matching "user.acct"
"jobname,user.acct" - all job/sessions matching
"jobname,user.acct"
"@J:[jobname,]user.acct" - all jobs-only matching
"[jobname,]user.acct"
"@S:[jobname,]user.acct" - all sessions-only matching
"[jobname,]user.acct"

Note: "jobname", "user" and "acct" may be wildcarded.

Note: ",user.acct" (empty 'jobname') can be passed to
specify that only jobs or sessions without job names
are desired. If 'jobname' is specified then only
job/sessions with job names are considered.

Joblist_var: Optional. The name of a CI variable that holds the
job/session numbers that match the 'job_match' argument.
Each job/session number is separated by a single space.
For example:

"J2 S34 S36 J12 J31 S44"

Note: it is possible that more jobs match than will fit
in the CI variable. In this event, the variable is
filled to capacity without reporting an error. The
caller can detect this condition by comparing the
number of jobs matching against the number of tokens
in the 'joblist_var' variable.

Example: JOBCNT("@S") # find all sessions
Result: 12

Example: JOBCNT("@J:@.sys") # find all jobs in SYS account
Result: 4

Example: setvar x JOBCNT('@', jlist) # find all jobs/sessions
if x <> wordcnt(jlist) then
# not all matching job/sessions fit into var
...

Example: JOBCNT("@!hpjobtype:!hpjobname,!hpuser.!hpaccount")
Result 1 # find all jobs or sessions
# logged on exactly as "you"