View previous topic :: View next topic
|
Author |
Message |
gotlamitla
New User
Joined: 31 Oct 2006 Posts: 11
|
|
|
|
Hi,
I want to save the data written to file even the operator/user cancelled the job forcefully.
Following was the scenario..
In the begining of the cobol program I opened 3 files (Input/Output/Error).
As per the logic, All the files will be closed only at the End of the Input file is reached.
Assume I had 100 records in input file.
While reading the records sequentially upto 40 records, I already occured 5 error records.
So by this time I written 35 records to output file. 5 records to error file.
At this point of time user/operator cancelled the job forcefully. The abend might be S222/S522.
When I check the datasets cataloged in JCL, The output/Error files were empty. This is because the records were written
to the output datasets and the files were not closed.
Is there any way I can handle the unexpected Operator/Job Cancellation return codes S222/S522 handling in cobol.
In the above scenario, even though the job was cancelled by the operator/User I still want to save the data as
35 records written to output file and 5 records written to output file.
Please help out in the above scenario.
Thanks & Regards,
Gotlamitla. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please post the jcl for this step of the job.
For my $.02, the operator should not normally cancel jobs. If a job needs to be canceled for some reason, the data usually needs to be re-run from the beginning. |
|
Back to top |
|
|
mytags
New User
Joined: 28 Apr 2008 Posts: 63 Location: US
|
|
|
|
Hi,
You can specify the Disposition as cataloged in normal and abnormal terminations,So you can check your out put.Using some tools like Abend-aid you can easily locate this errors,if it is so tedious to track the programs.You can also check the class.
Thanks,
Hari |
|
Back to top |
|
|
gotlamitla
New User
Joined: 31 Oct 2006 Posts: 11
|
|
|
|
dick scherrer wrote: |
Hello,
Please post the jcl for this step of the job.
For my $.02, the operator should not normally cancel jobs. If a job needs to be canceled for some reason, the data usually needs to be re-run from the beginning. |
Hi,
In the same scenario, If am updating the database for each read from the input file and also performing commit after each update, there will be some mismatch with the database updates happened and the number of records written to the output file.
For each input record read, I thought of open/write/close the output/error files. It seems to be this will work.
I need some other way to handle the above scenario to handle S222/S522 Abends from Cobol code/Any other utilities.
Please let me know ur suggestions/ideas.
Thanks & Regards,
Gotlamitla. |
|
Back to top |
|
|
Atul Tamboli
New User
Joined: 12 May 2008 Posts: 3 Location: Pune, India
|
|
|
|
I don't think it is a good idea to open/close file for each record if you are concerned with the performance of the job.
When you say there is a mismatch between the records updated in database and records written to the file, is there a consistency. What I mean is - Are the number of records written in the file always less/more/1 less, etc?
Explicit closing of files is also not required, though recommended. So losing entire data (if already written to the file) due to a job failure seems strange.
If you have the set up available in test, I would recommend put displays after each write statement is executed then cancel the job. Then cross check the display and the actual records in the file.
So long the database updates are concerned, they should not be lost if your checkpoint logic is correct.
Taking a look at your JCL may be helpful.
Thanks,
Atul. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
As I recall, the system abend routines close all open files thereby emptying the buffers and making all O/P data available at EOJ. Use ,CATLG,CATLG as Hari suggested and you s/b able to access your data. |
|
Back to top |
|
|
|