6.13 Is there a simple way to determine if a scheduled job exists?

1. showjob sched;job=jobname,user.acct

sort of does it. Unfortunately, it does not set a cierror value if there is no job.

What you can do though, is redirect the output of the showjob into a file and then just look at the eof. In the case of no matching job, the eof is 3. If one or more jobs matches, the eof is greater than 3. This should be very quick and does not require any parsing of the re-directed output.

2. Use LISTSPF on your input spool files with a combination of the OWNER and JOBNAME selection parameters with the output directed to $NULL. If the job you specify isn't out there, you'll get a CIWARN 4809. So, you can just set CIERROR = 0, LISTSPF I@;SELEQ=..., and check CIERROR = 0 or 4809 to tell you if the scheduled job exists.

3. If you are on MPE/iX 6.0 PP1, and you know the job "[jname,]user.acct" logon ID you can do this:

if JOBCNT("jname,user.acct") > 0 then ...

HELP JOBCNT and HELP JINFO provide the details.