Page 2 of 2

Re: pass timestamp from jcl to cobol

PostPosted: Mon Jan 04, 2016 2:15 pm
by iaccbond
my solution is not the solution which is required, i still need job start timestamp in my pgm


its a temporary solution not a standard solution

Re: pass timestamp from jcl to cobol

PostPosted: Mon Jan 04, 2016 2:52 pm
by NicC
What do you mean by "standard" solution? "Standard" as per your shop? If so then how are we, who do not work there, expected to know the answer? Otherwise there is no such thing as a "standard" solution. Most places will use a business date dataset to get the date to be used and will use the ACCEPT TIME, or similar for other languages. If you really need the job start time then you create your own program that will step through th control blocks for your job as stated above. Or you could have a small program at the very start of your job, before any housekeeping, which will get the current time and store it.

Re: pass timestamp from jcl to cobol

PostPosted: Mon Jan 04, 2016 6:21 pm
by BillyBoyo
Which takes you back to the Control Blocks, as mentioned earlier. If this is for Production, that means write it in Assembler, because IBM supplies updated Assembler macros when the Control Blocks change, and provides no standard structures for other languages.

The chances that you actually need the "timestamp" of the JOB are small. You have to provide a reason why running that SORT step as the first one in the JOB does not give everything that is needed for the requirement.

Re: pass timestamp from jcl to cobol

PostPosted: Mon Jan 04, 2016 6:23 pm
by Aki88
Fwiw, its really curious that the time-stamp passed by the SORT step (which is not the actual job start-time) is not causing any problems to the COBOL program, which would mean that there is no mechanism coded in the program itself to validate the time-stamp which is input to it.

In an after-thought, Nicc's earlier question is actually relevant here: 'Why do you need the job start time?' if you're not validating it in any way in the COBOL; else the time-stamp passed by the SORT step would not have sufficed.


<Edit: Sorry Billy didn't see you'd already posted>

Re: pass timestamp from jcl to cobol

PostPosted: Tue Jan 05, 2016 5:08 am
by Akatsukami
FTR, my assumption that the date and time in the JCT are BCD was wrong. The time is a 3-byte binary of centiseconds since midnight. The date, OTOH, is a packed-decimal ordinal date, but with with the century coded as excess-19.

Re: pass timestamp from jcl to cobol

PostPosted: Tue Jan 05, 2016 3:29 pm
by NicC
Whatever. It cannot be done by JCL. Locking. If further assistance is required then a new topic can bestarted under the appropriate programming language or utility.