View previous topic :: View next topic
|
Author |
Message |
ravikumar15
New User
Joined: 27 Mar 2006 Posts: 68
|
|
|
|
I have 100,000 records in a file. I am processing this file in a COBOL program. It processed 40000 records and it got abend due to a bad data. I solved the abend and have to restart the job. If the job is restarted, the program esecutes from the beginning. I dont want to process the 40000 records which is already processed. I want to process from 40001st record. can any one tell me the process in detail. A sample code would definetly help me.
Instead of file if DB2 is used, then what would be the procedure. |
|
Back to top |
|
|
socker_dad
Active User
Joined: 05 Dec 2006 Posts: 177 Location: Seattle, WA
|
|
|
|
Quick & Dirty solution (Gee - Looking over my last few posts I seem to specialize in these. Too many years of on-call support!)
Use your favorite data utility tool to create a new input file, stripping the first 40,000 records. For audit and recovery purposes, keep the original file by copying it or renaming it.
Then restart the job with the smaller file. Be sure to notify everyone who may be interested in the final record counts, etc., that the results of the first job and the resubmitted job will need to be combined to see the actual results.
Permanent solution:
Develop some sort of a restart process. We actually have an internal process that keeps track of production jobs and maintains a file with the last successfully executed key for all system critical processes. Then when an abend occurs, we can restart the job as normal and the internal restart process looks to this file for the last successful key, spins through the input till it gets to that point, and then reads the next record to continue processing.
It varies from site to site and depends on what your people have purchased. |
|
Back to top |
|
|
ramfrom84
New User
Joined: 23 Aug 2006 Posts: 93 Location: chennai
|
|
|
|
As per socker_dad suggestion ,
How to get the record count fron teh ABEND Job , since ABEND job does not display the record count , when u created the output PS Mention DISP parameter as (NEW,CATLG,KEEP) and chack the output file how much record is written .
Now u get the record count from the abend Job
Th efollowing process to be done for this:
Program Code Changes :
Code: |
LINKAGE SECTION
01 LINK-PARM-CARD.
05 LINK-LENGTH PIC S9(004) COMP.
05 LINK-COUNT PIC 9(5).
In READ Statement :
READ INPUT -FILE AT END MOVE 'Y' TO EOF-FILE.
REC-COUNT = REC-COUNT + 1
IF REC-COUNT > = LINK-COUNT
GO TO PROCESS
ELSE
READ AGAIN
END-IF.
|
JCL Code changes:
For First run :
Code: |
//STEP1 EXEC PROCNAME ,PARM = 0
|
When ABEND Occurs u know the record count, Just pass teh value thru PARM
Code: |
//STEP1 EXEC PROCNAME ,PARM = 50000
|
|
|
Back to top |
|
|
priyamnavada
New User
Joined: 24 Dec 2005 Posts: 52 Location: hyderabad
|
|
|
|
Use the Restart logic in your COBOL program |
|
Back to top |
|
|
ravikumar15
New User
Joined: 27 Mar 2006 Posts: 68
|
|
|
|
Hi priyamnavada,
Can you please provide me the Restart Logic |
|
Back to top |
|
|
socker_dad
Active User
Joined: 05 Dec 2006 Posts: 177 Location: Seattle, WA
|
|
|
|
Ravi, dude -
Unless our buddy priya has a personally-developed solution that he is willing to share at no charge, nearly every Restart packages of which I am aware are licensed proprietary software and giving you the code would be a violation of copyright laws.
Either talk to your systems people or develop your own based on the extensive knowledge already shared here. |
|
Back to top |
|
|
|