Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to bypass records already processed.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ravikumar15

New User


Joined: 27 Mar 2006
Posts: 64

PostPosted: Thu May 17, 2007 11:21 pm    Post subject: How to bypass records already processed.
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: 147
Location: Columbia, MO

PostPosted: Fri May 18, 2007 12:31 am    Post subject: Re: How to bypass records already processed.
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    Post subject:
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    Post subject:
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: 64

PostPosted: Mon May 21, 2007 6:57 pm    Post subject:
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: 147
Location: Columbia, MO

PostPosted: Mon May 21, 2007 10:13 pm    Post subject: Re: How to bypass records already processed.
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us