IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to bypass records already processed.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 68

PostPosted: Thu May 17, 2007 11:21 pm
Reply with quote

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
View user's profile Send private message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 177
Location: Seattle, WA

PostPosted: Fri May 18, 2007 12:31 am
Reply with quote

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
View user's profile Send private message
ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Fri May 18, 2007 5:05 pm
Reply with quote

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
View user's profile Send private message
priyamnavada

New User


Joined: 24 Dec 2005
Posts: 52
Location: hyderabad

PostPosted: Mon May 21, 2007 6:47 pm
Reply with quote

Use the Restart logic in your COBOL program
Back to top
View user's profile Send private message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 68

PostPosted: Mon May 21, 2007 6:57 pm
Reply with quote

Hi priyamnavada,

Can you please provide me the Restart Logic
Back to top
View user's profile Send private message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 177
Location: Seattle, WA

PostPosted: Mon May 21, 2007 10:13 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts To fetch records that has Ttamp value... DFSORT/ICETOOL 4
No new posts ICETOOL returns no records JCL & VSAM 1
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top