Page 1 of 1

File Watcher in Mainframe

PostPosted: Tue Dec 11, 2012 8:42 pm
by saketsd
Hi,

I am new to the mainframe. Does anyone know how to write a JCL which can check the presence of a specific file at a specific time?
I need to run this check 3 times everyday and shoot a mail/start another process accordingly.

Thanks in advance.

Re: File Watcher in Mainframe

PostPosted: Tue Dec 11, 2012 9:06 pm
by dick scherrer
Hello and welcome to the forum,

First - JCL cannot do this. JCL can only execute "things".

You need to talk with your scheduling to define when this process should be submitted/run.

Do you merely want to check for the presence of the file or determine if it is empty?

You don't "shoot" e-mails. Sending the email should just be part of the job that looks at the file.

Re: File Watcher in Mainframe

PostPosted: Tue Dec 11, 2012 9:09 pm
by Robert Sample
how to write a JCL which can check the presence of a specific file at a specific time
This cannot be done -- period. JCL does only one thing - execute programs. You can write code and then write JCL to execute that code, if desired.

Furthermore, what you want to do is generally accomplished by the site scheduling software; most of them can identify when a new file is allocated on the system and start up a job based on the presence of that job. This also removes human intervention from the process, allowing you (or whomever) to take a vacation every now and then.

Re: File Watcher in Mainframe

PostPosted: Tue Dec 11, 2012 9:20 pm
by Ed Goodman
saketsd, if your background is Linux, then the mainframe equivalent to CRON is the scheduling software. In my shop, we use BMC's Control-M. Last place was something different. your place is probably something different still.

Most of those products have something built in that can watch for files to be cataloged and then start a task, run a job, or send a message.