Page 1 of 2

Job Start Time

PostPosted: Tue Oct 05, 2010 11:01 pm
by tpattison
Is there any way for a z/OS COBOL program to acquire it's Job Start Time? In iSeries programs, I believe TIME will provide this, but I haven't seen anything comparable for z/OS

Re: Job Start Time

PostPosted: Wed Oct 06, 2010 12:04 am
by dick scherrer
Hello and welcome to the forum,

I'm not aware of any built-in COBOL function to retrieve job start time.

If the program is step 15 of a job, is the "beginning of job" time wanted or would when the code began executing be sufficient?

Re: Job Start Time

PostPosted: Wed Oct 06, 2010 12:09 am
by tpattison
I believe what my Designer is after is the start time of the COBOL program itself, as opposed to a Jobstream which contains it as a step

Re: Job Start Time

PostPosted: Wed Oct 06, 2010 12:51 am
by steve-myers
tpattison wrote:I believe what my Designer is after is the start time of the COBOL program itself, as opposed to a Jobstream which contains it as a step
I'm sure there are functions in Cobol that will give you the current date and time. Just execute them as soon as possible after your program starts and save the result and you'll have it. I think you can retrieve the job start time, but, as Dick Scherrer says, there is no built in function for this. This is true even for us Assembler dinosaurs. In 40+ years I don't think I was ever tasked with that, except in the task of analyzing SMF data, where the date and a job enters the system (which is not the same as the job start time) is a secondary key with the job name as a primary key.

Re: Job Start Time

PostPosted: Wed Oct 06, 2010 1:14 am
by tpattison
Thanks, Steve. I must agree, in 40+ years I have never needed this specific information in either Assembler or COBOL programs, and I'm not certain why this Designer thinks we need it now. I would think an immediate invocation of CURRENT-DATE would be accurate enough.

Re: Job Start Time

PostPosted: Wed Oct 06, 2010 2:12 am
by dick scherrer
Hello,

Lots of old programs move the current date/time into working-storage before any "real" processing (including opens - which sometimes take a while)) is done. This is then used for report headings header/trailer time stamps for created files and whatever.

Don't see so many newer programs that do this . . .

Re: Job Start Time

PostPosted: Wed Oct 06, 2010 2:50 am
by tpattison
Thank you both; the technique of immediately acquiring current date/time at the beginning of the program execution should do the trick......the Designer is even relatively happy with that approach.

Re: Job Start Time

PostPosted: Wed Oct 06, 2010 3:02 am
by dick scherrer
Thanks for letting us know - good luck :)

d

Re: Job Start Time

PostPosted: Thu Oct 14, 2010 1:26 pm
by shindeswap
i think any job shaduler will help like CA7 is i am right dick scherrer?

Re: Job Start Time

PostPosted: Thu Oct 14, 2010 2:27 pm
by NicC
I doubt if the scheduler could pass that information into a job. I do not know when the scheduler does any symbolic substitution but even if it is at job submission time that is not necessarily the job start time.