Operating System - OpenVMS
1828617 Members
5380 Online
109983 Solutions
New Discussion

Tracking child batch jobs

 
Sandeep_30
Occasional Advisor

Tracking child batch jobs

Hi,

I use sys$sndjbc to submit job and monitor them for the job completion.

I want to be able to track the child job that gets called inside the batch script.

Below are an example of the batch job

$! type test.com
$ show time
$ <<<< CALL CHILD JOB >>>>
$ show time
$ exit

In my C Code, I use sys$sndjbc (0, SJC$_SYNCHRONIZE_JOB ...) which provides me with the job completion information for test.com, but at times the child job may still be running and I want to wait till the child job is complete.

Is it possible to track the child job?

Is there a API that can be called from C program?

Please help.

Sandeep
6 REPLIES 6
Eberhard Wacker
Valued Contributor

Re: Tracking child batch jobs

Hi Sandeep,

if you simply want to wait within the DCL procedure till the "child job" has been finished then the following should be one of various solutions (if, as I understand, the child job is also a batch job, and of course depending on your VMS version):
$! type test.com
$ show time
$ <<<< CALL CHILD JOB >>>>
$ loop:
$ show time
$ wait 0:0:5
$ show entry child-job-processname/user=owner-of-child-job-process/by_job_status=executing
$ if .not. $status then goto loop
$ exit

Too, have a look at the many things the lexical function f$getqui offers.

Cheers,
EW

Eberhard Wacker
Valued Contributor

Re: Tracking child batch jobs

Sorry, wrong statement, in the case above the status query should be
$ if $status then goto loop
Cheers again,
EW
Peter Quodling
Trusted Contributor

Re: Tracking child batch jobs

Note sure exactly what you want to "track" from the child job, but if just completion, then explore the Synchronize DCL command.


q
Leave the Money on the Fridge.
Antoniov.
Honored Contributor

Re: Tracking child batch jobs

Hi Sandeep,
warning, if you call a child job inside executing batch job you could stall application. Batch job, usually can execute 3 jobs concurrently but it's possible limit to 1 this feature.

About tracking, I'm not sure what is your real intention. If you simply want to wait for end execution you can execute SYNC command as posted above.

Antonio Vigliotti
Antonio Maria Vigliotti
Jan van den Ende
Honored Contributor

Re: Tracking child batch jobs

Sandeep,

I am not much into C, but let me first make sure I get your exact intention:

- From your image, you submit a batch job to execute test.com
- in test.com you "CALL CHILD JOB"

>> I am now assuming that the CHILD JOB is done by a separate batch job, by SUBMIT or by an other image executing SYS$SNDJBC

I guess your intention would be to get a timestamp at the beginning and at the end. Is that correct?
If so, then:

. If the child is started by SUBMIT, then in test.com after calling CHILD JOB add a line:
$ SYNCHRONISE '$ENTRY

. If it is submitted using SYS$SNDJBC, then retrieve the entry number, do a LIB$SETSYMBOL for some unique name, and then in test.com do a SYNCHRONISE for that unique symbol name.

hth,

Proost.

Have one on me.

jpe

Don't rust yours pelled jacker to fine doll missed aches.
Jan van den Ende
Honored Contributor

Re: Tracking child batch jobs

Sandeep,

from your Forum Profile:


I have assigned points to 4 of 17 responses to my questions.


Maybe you can find some time to do some assigning?

Mind, I do NOT say you necessarily need to give lots of points. It is fully up to _YOU_ to decide how many. If you consider an answer is not deserving any points, you can also assign 0 ( = zero ) points, and then that answer will no longer be counted as unassigned.
Consider, that every poster took at least the trouble of posting for you!

To easily find your streams with unassigned points, click your own name somewhere.
This will bring up your profile.
Near the bottom of that page, under the caption â My Question(s)â you will find â questions or topics with unassigned points â Clicking that will give all, and only, your questions that still have unassigned postings.

Thanks on behalf of your Forum colleagues.

PS. â nothing personal in this. I try to post it to everyone with this kind of assignment ratio in this forum. If you have received a posting like this before â please do not take offence â none is intended!

Proost.

Have one on me.

Jan
Don't rust yours pelled jacker to fine doll missed aches.